P99
Value:
/* This is just there to prevent spurious dangling else warnings */    \
P00_BLK_START                                                          \
for (;                                                                 \
     !(p00_unwind_bottom && !setjmp(p00_unwind_bottom[0]->p00_buf))    \
       /* assign before we unwind all the way down */                  \
       || (p00_unwind_bottom[0]->p00_returning = 1,                    \
           /* If an unwind is possible, i.e if we are not in the outer \
              frame this will stop the evaluation of the expression    \
              here, and unwind as side effect. Otherwise, this will    \
              continue normally and directly proceed with the          \
              return. */                                               \
           P99_UNWIND(-p99_unwind_return),                             \
           1);                                                         \
     ) P99_ALLOW(RETURN) return

Return from the enclosing function after unwinding all levels of nested P99_UNWIND_PROTECT.

By this you can guarantee that all eventually existing P99_PROTECT parts of enclosing P99_UNWIND_PROTECT are properly executed. This is in some similar to the guarantee of C++ to call destructors before returning from a function.

There is one important difference, though: the return expression (if any) is evaluated after the protected parts are unwound. So if these modify parts of that return expression you might not get what you expect. So instead of

You might want do something like

 volatile retType myret = expr;
 P99_UNWIND_RETURN myret;

Definition at line 601 of file p99_block.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines