Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
yeah, yeah, linux. Don't bother. O_BINARY is a nasty flag from this nasty windows...
[simgrid.git] / src / portable.h
index 15fc63d..a3b1866 100644 (file)
@@ -87,14 +87,18 @@ const char *gras_wsa_err2string(int errcode);
 #include <fcntl.h>
 
 #ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
+#  include <sys/stat.h>
+#endif
+
+#ifndef O_BINARY
+#  define O_BINARY 0
 #endif
 
 /****
  **** Time handling
  ****/
 
-#if TIME_WITH_SYS_TIME
+#ifdef TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
 #else
@@ -109,5 +113,14 @@ const char *gras_wsa_err2string(int errcode);
 #define sleep _sleep /* else defined in stdlib.h */
 #endif
 
+/****
+ **** Contexts
+ ****/
+
+#ifdef HAVE_UCONTEXT_H
+#  include <ucontext.h>
+#else
+#  include "xbt/context_win32.h" /* Manual reimplementation for prehistoric platforms */
+#endif
 
 #endif /* GRAS_PORTABLE_H */