-#define ex_throw(c,o,v) \
- (( __ex_ctx()->ctx_shielding > 0 \
- || (__ex_ctx()->ctx_deferring > 0 && __ex_ctx()->ctx_deferred == 1)) ? 0 : \
- (__ex_ctx()->ctx_ex.ex_class = (void *)(c), \
- __ex_ctx()->ctx_ex.ex_object = (void *)(o), \
- __ex_ctx()->ctx_ex.ex_value = (void *)(v), \
- __ex_ctx()->ctx_ex.ex_file = __FILE__, \
- __ex_ctx()->ctx_ex.ex_line = __LINE__, \
- __ex_ctx()->ctx_ex.ex_func = __EX_FUNC__, \
- __ex_ctx()->ctx_deferred = 1, \
- (__ex_ctx()->ctx_deferring > 0 ? 0 : \
- (__ex_ctx()->ctx_mctx == NULL \
- ? (__ex_terminate((ex_t *)&(__ex_ctx()->ctx_ex)), -1) \
- : (__ex_mctx_restore(__ex_ctx()->ctx_mctx), 1) ))))
+#define sg_throw(c,v,m) \
+ (( __xbt_ex_ctx()->ctx_shielding > 0 \
+ || (__xbt_ex_ctx()->ctx_deferring > 0 && __xbt_ex_ctx()->ctx_deferred == 1)) ? 0 : \
+ (__xbt_ex_ctx()->ctx_ex.msg = bprintf(m), \
+ __xbt_ex_ctx()->ctx_ex.code = (c), \
+ __xbt_ex_ctx()->ctx_ex.value = (v), \
+ __xbt_ex_ctx()->ctx_ex.host = (char*)NULL, \
+ __xbt_ex_ctx()->ctx_ex.procname = strdup(xbt_procname()), \
+ __xbt_ex_ctx()->ctx_ex.file = (char*)__FILE__, \
+ __xbt_ex_ctx()->ctx_ex.line = __LINE__, \
+ __xbt_ex_ctx()->ctx_ex.func = (char*)_XBT_FUNCTION, \
+ __xbt_ex_ctx()->ctx_deferred = 1, \
+ (__xbt_ex_ctx()->ctx_deferring > 0 ? 0 : \
+ (__xbt_ex_ctx()->ctx_mctx == NULL \
+ ? (__xbt_ex_terminate((ex_t *)&(__xbt_ex_ctx()->ctx_ex)), -1) \
+ : (__ex_mctx_restore(__xbt_ex_ctx()->ctx_mctx), 1) ))))