Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MSCV also define _THROW, so pick another name for our internal macro
[simgrid.git] / include / xbt / ex.h
index dd79d32..9ae8f84 100644 (file)
@@ -1,6 +1,6 @@
 /* ex - Exception Handling                                                  */
 
-/* Copyright (c) 2005-2014. The SimGrid Team.
+/* Copyright (c) 2005-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /*  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>       */
@@ -323,9 +323,8 @@ XBT_PUBLIC( void )__xbt_ex_terminate_default(xbt_ex_t * e);
     { \
         xbt_running_ctx_t *__xbt_ex_ctx_ptr = __xbt_running_ctx_fetch(); \
         int __ex_cleanup = 0; \
-        __ex_mctx_t *__ex_mctx_en; \
         __ex_mctx_t __ex_mctx_me; \
-        __ex_mctx_en = __xbt_ex_ctx_ptr->ctx_mctx; \
+        __ex_mctx_t * __ex_mctx_en = __xbt_ex_ctx_ptr->ctx_mctx; \
         __xbt_ex_ctx_ptr->ctx_mctx = &__ex_mctx_me; \
         if (__ex_mctx_save(&__ex_mctx_me)) { \
             if (1)
@@ -430,7 +429,7 @@ XBT_PUBLIC( void )__xbt_ex_terminate_default(xbt_ex_t * e);
   _throw_ctx->exception.bt_strings = NULL;                              \
   xbt_backtrace_current((xbt_ex_t *)&(_throw_ctx->exception));
 
-#define _THROW(c, v, m)                                        \
+#define _XBT_THROW(c, v, m)                                        \
   do { /* change this sequence into one block */               \
     xbt_running_ctx_t *_throw_ctx = __xbt_running_ctx_fetch(); \
     THROW_PREPARE(_throw_ctx, c, v, m);                        \
@@ -439,11 +438,11 @@ XBT_PUBLIC( void )__xbt_ex_terminate_default(xbt_ex_t * e);
 
 /** @brief Builds and throws an exception
     @hideinitializer */
-#define THROW(c, v)             _THROW(c, v, NULL)
+#define THROW(c, v)             _XBT_THROW(c, v, NULL)
 
 /** @brief Builds and throws an exception with a printf-like formatted message
     @hideinitializer */
-#define THROWF(c, v, ...)       _THROW(c, v, bprintf(__VA_ARGS__))
+#define THROWF(c, v, ...)       _XBT_THROW(c, v, bprintf(__VA_ARGS__))
 
 #define THROW_IMPOSSIBLE \
   THROWF(unknown_error, 0, "The Impossible Did Happen (yet again)")
@@ -471,6 +470,8 @@ XBT_PUBLIC( void )__xbt_ex_terminate_default(xbt_ex_t * e);
 
 /** @brief Exception destructor */
 XBT_PUBLIC(void) xbt_ex_free(xbt_ex_t e);
+/** @brief The display made by an exception that is not catched */
+XBT_PUBLIC(void) xbt_ex_display(xbt_ex_t * e);
 
 /** @brief Shows a backtrace of the current location */
 XBT_PUBLIC(void) xbt_backtrace_display_current(void);