Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update versionning info, and add a cheat sheet to the makefile in order to do so...
[simgrid.git] / include / error.h
index 49b91bc..8505083 100644 (file)
@@ -15,8 +15,9 @@
 #include <stddef.h>    /* offsetof() */
 #include <sys/types.h>  /* size_t */
 #include <stdarg.h>
 #include <stddef.h>    /* offsetof() */
 #include <sys/types.h>  /* size_t */
 #include <stdarg.h>
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>  /* to print the backtrace */
 #include <execinfo.h>  /* to print the backtrace */
-
+#endif
 
 /* C++ users need love */
 #ifndef BEGIN_DECL
 
 /* C++ users need love */
 #ifndef BEGIN_DECL
@@ -88,6 +89,7 @@ typedef enum {
   }                                                            \
 } while(0)
 
   }                                                            \
 } while(0)
 
+#if 0 /* FIXME: We don't use backtrace. Drop it? */
 #define _GRAS_ERR_PRE do {                                     \
  void *_gs_array[30];                                          \
   size_t _gs_size= backtrace (_gs_array, 30);                  \
 #define _GRAS_ERR_PRE do {                                     \
  void *_gs_array[30];                                          \
   size_t _gs_size= backtrace (_gs_array, 30);                  \
@@ -101,6 +103,12 @@ typedef enum {
   return code;                                                 \
 } while (0)
 
   return code;                                                 \
 } while (0)
 
+#else
+#define _GRAS_ERR_PRE do {
+#define _GRAS_ERR_POST(code)                                   \
+  return code;                                                 \
+} while (0)
+#endif
 
 #define RAISE0(code,fmt) _GRAS_ERR_PRE     \
   fprintf(stderr,"%s:%d:%s: " fmt "\n",    \
 
 #define RAISE0(code,fmt) _GRAS_ERR_PRE     \
   fprintf(stderr,"%s:%d:%s: " fmt "\n",    \