Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
[simgrid.git] / src / portable.h
index 2afe77c..3676725 100644 (file)
@@ -66,8 +66,8 @@
 
 #       undef  sock_errno
 #       undef  sock_errstr
-#       define sock_errno      WSAGetLastError()
-#       define sock_errstr     gras_wsa_err2string(WSAGetLastError())
+#       define sock_errno         WSAGetLastError()
+#       define sock_errstr(err)   gras_wsa_err2string(err)
 
 const char *gras_wsa_err2string(int errcode);
 
@@ -77,8 +77,8 @@ const char *gras_wsa_err2string(int errcode);
 #else
 #       define tcp_read( s, buf, len)   read( s, buf, len )
 #       define tcp_write( s, buf, len)  write( s, buf, len )
-#       define sock_errno      errno
-#       define sock_errstr     strerror(errno)
+#       define sock_errno        errno
+#       define sock_errstr(err)  strerror(err)
 
 #       ifdef SHUT_RDWR
 #               define tcp_close( s )   (shutdown( s, SHUT_RDWR ), close( s ))
@@ -134,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/)
  ****/
@@ -178,10 +185,10 @@ extern int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
 #  include <execinfo.h>
 #endif
 
-/*
- * Some debugging functions. Can't we find a better place for this??
- */
+/****
+ **** 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);
+const char *hexa_str(unsigned char *data, int size, int downside);
 
 #endif /* GRAS_PORTABLE_H */