Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add Doxygen documentation for mallocators
[simgrid.git] / src / portable.h
index 9a6acb3..b227f89 100644 (file)
@@ -34,6 +34,7 @@
 #  include <netinet/tcp.h>  /* TCP_NODELAY */
 #  include <netdb.h>        /* getprotobyname() */
 #  include <arpa/inet.h>    /* inet_ntoa() */
+#  include <sys/types.h>    /* sometimes required for fd_set */
 # endif
 
 #ifdef HAVE_WINSOCK2_H
@@ -133,6 +134,13 @@ const char *gras_wsa_err2string(int errcode);
 #  include "xbt/context_win32.h" /* Manual reimplementation for prehistoric platforms */
 #endif
 
+/****
+ **** Signals
+ ****/
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+
 /****
  **** string handling (parts from http://www.ijs.si/software/snprintf/)
  ****/
@@ -170,4 +178,17 @@ extern int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
 #  define PRINTF_STR(a) (a)?:"(null)"
 #endif
 
+/*
+ * What we need to extract the backtrace in exception handling code
+ */
+#ifdef HAVE_EXECINFO_H
+#  include <execinfo.h>
+#endif
+
+/****
+ **** Some debugging functions. Can't we find a better place for this??
+ ****/
+void hexa_print(const char*name, unsigned char *data, int size);
+const char *hexa_str(unsigned char *data, int size);
+
 #endif /* GRAS_PORTABLE_H */