X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6be900fe3f149eede7dd54719b172757556a4e81..f4df562c423224b325ba5b809bfac36ffe2f8e97:/include/xbt/ex.h diff --git a/include/xbt/ex.h b/include/xbt/ex.h index 97e4eeacac..b7ea3281ac 100644 --- a/include/xbt/ex.h +++ b/include/xbt/ex.h @@ -391,13 +391,16 @@ extern void __xbt_ex_terminate_default(xbt_ex_t * e); } \ else -#define DO_THROW(running_ctx) \ - /* deal with the exception */ \ - if (running_ctx->ctx_mctx == NULL) \ - __xbt_ex_terminate((xbt_ex_t*)&(running_ctx->exception)); /* not catched */ \ - else \ - __ex_mctx_restore(running_ctx->ctx_mctx); /* catched somewhere */ \ - abort() /* nope, stupid GCC, we won't survive a THROW (this won't be reached) */ +#define DO_THROW(running_ctx) \ + do { /* deal with the exception */ \ + xbt_running_ctx_t *ctx = (running_ctx); \ + if (ctx->ctx_mctx == NULL) \ + __xbt_ex_terminate((xbt_ex_t*)&(ctx->exception)); /* not catched */ \ + else \ + __ex_mctx_restore(ctx->ctx_mctx); /* catched somewhere */ \ + abort(); /* nope, stupid GCC, we won't survive a THROW */ \ + /* (this won't be reached) */ \ + } while(0) /** @brief Helper macro for THROW and THROWF * @hideinitializer @@ -458,15 +461,7 @@ extern void __xbt_ex_terminate_default(xbt_ex_t * e); /** @brief re-throwing of an already caught exception (ie, pass it to the upper catch block) * @hideinitializer */ -#define RETHROW \ - do { \ - xbt_running_ctx_t *ctx = __xbt_running_ctx_fetch(); \ - if (ctx->ctx_mctx == NULL) \ - __xbt_ex_terminate((xbt_ex_t*)&(ctx->exception)); \ - else \ - __ex_mctx_restore(ctx->ctx_mctx); \ - abort();\ - } while(0) +#define RETHROW DO_THROW(__xbt_running_ctx_fetch()) /** @brief like THROWF, but adding some details to the message of an existing exception * @hideinitializer