|
P99
|
This defines some macros that can be used to ensure that certain operations are always executed before entering and after leaving a particular block. More...
Collaboration diagram for Preprocessor BLocks:Modules | |
| Checking code validity | |
| Try, catch and finally blocks | |
Defines | |
| #define | P99_AVOID for (;0;) |
| Only execute the depending statement or block if it is jumped into explicitly from the outer block. | |
| #define | P99_BLOCK(...) P99_PREFER(__VA_ARGS__) P99_NOP |
| Execute the statements in the argument list. | |
| #define | P99_BLOCK_DOCUMENT |
| Add some default documentation and links to the following block macro. | |
| #define | P99_GUARDED_BLOCK(T, NAME, INITIAL, BEFORE, AFTER) |
| A meta-macro to protect a dependent block or statement by a guard variable NAME of type T. | |
| #define | P99_HANDLE_ERRNO |
Handle and reset errno. | |
| #define | P99_INVARIANT(EXPR) P99_PROTECTED_BLOCK(assert((EXPR) && "failed on entry"), assert((EXPR) && "failed on leave")) |
| Assert runtime condition EXPR on entry and on leave of the dependent block. | |
| #define | P99_NOP ((void)0) |
| Do nothing. | |
| #define | P99_PREFER(...) if (1) { __VA_ARGS__ } else |
| Prefer the statements in the argument list over the statement or block that follows. | |
| #define | P99_PROTECT |
| The pseudo label to which we jump when we unwind the stack with P99_UNWIND. | |
| #define | P99_PROTECTED_BLOCK(BEFORE, AFTER) |
| A meta-macro to protect a dependent block or statement by statement BEFORE that is executed before the block and AFTER that is executed afterward. | |
| #define | P99_UNCASE P00_UNCASE : |
| A command prefixed with this cannot be a case target from surrounding scopes. | |
| #define | P99_UNWIND(X) p00_unwind(p00_unwind_top, p99_unwind_level, (X)) |
| Preliminary resume from one or several levels of nested P99_UNWIND_PROTECT. | |
| #define | P99_UNWIND_PROTECT |
| Unwind execution from several levels of nesting inside a function. | |
| #define | P99_UNWIND_RETURN |
| Return from the enclosing function after unwinding all levels of nested P99_UNWIND_PROTECT. | |
| #define | P99_XCASE P99_AVOID case |
An exclusive case for a switch statement. | |
| #define | P99_XDEFAULT P99_AVOID default |
| The default case analogous to P99_XCASE. | |
Enumerations | |
| enum | p99_unwind { p99_unwind_level = 0 , p99_unwind_code = 0, p99_unwind_return = INT_MAX } |
This defines some macros that can be used to ensure that certain operations are always executed before entering and after leaving a particular block.
1.7.6.1