Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
of course, xlC does not like gcc attributes. And since this is a leftover, don't...
[simgrid.git] / include / xbt / ex.h
index 54f8d0f..0899002 100644 (file)
 #include <xbt/misc.h>
 #include <xbt/sysdep.h>
 
+/* do not include execinfo.h directly since it's not always available. 
+   Instead, copy the parts we need (and fake when it's not there) */
+extern int backtrace (void **__array, int __size);
+
 /* required ISO-C standard facilities */
 #include <errno.h>
 #include <stdio.h>
 
-//#define __EX_MCTX_MCSC__ 1
-#define __EX_MCTX_SSJLJ__ 1
 /* the machine context */
 #if defined(__EX_MCTX_MCSC__)
 #include <ucontext.h>            /* POSIX.1 ucontext(3) */
@@ -202,6 +204,7 @@ typedef enum {
   unknown_error=0,  /**< unknown error */
   arg_error,        /**< Invalid argument */
   mismatch_error,   /**< The provided ID does not match */
+  not_found_error,  /**< The searched element was not found */
   
   system_error,   /**< a syscall did fail */
   network_error,  /**< error while sending/receiving data */
@@ -209,7 +212,7 @@ typedef enum {
   thread_error    /**< error while [un]locking */
 } xbt_errcat_t;
 
-const char *xbt_errcat_name(xbt_error_t errcode);
+const char *xbt_errcat_name(xbt_errcat_t errcode);
 
 /** @brief Structure describing an exception */
 typedef struct {
@@ -272,7 +275,7 @@ extern ex_ctx_t *__xbt_ex_ctx_default(void);
 /* the termination handler */
 typedef void (*ex_term_cb_t)(xbt_ex_t *);
 extern ex_term_cb_t __xbt_ex_terminate;
-extern void __xbt_ex_terminate_default(xbt_ex_t *e)  __attribute__((__noreturn__));
+extern void __xbt_ex_terminate_default(xbt_ex_t *e);
 
 /** @brief Introduce a block where exception may be dealed with 
  *  @hideinitializer
@@ -342,7 +345,7 @@ extern void __xbt_ex_terminate_default(xbt_ex_t *e)  __attribute__((__noreturn__
  * The THROW can be performed everywhere, including inside TRY, 
  * CLEANUP and CATCH blocks.
  */
-#include <execinfo.h>
+
 #define _THROW(c,v,m) \
   do { /* change this sequence into one block */                               \
      /* build the exception */ \