Bläddra i källkod

Try to fetch the timespec definition from time.h or pthread.h, for those mingw versions which provide it

Samuel Thibault 11 år sedan
förälder
incheckning
685b4b21e9
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      include/starpu_util.h

+ 6 - 0
include/starpu_util.h

@@ -274,7 +274,13 @@ int starpu_data_cpy(starpu_data_handle_t dst_handle, starpu_data_handle_t src_ha
 double starpu_timing_now(void);
 double starpu_timing_now(void);
 
 
 #ifdef _WIN32
 #ifdef _WIN32
+/* Try to fetch the system definition of timespec */
+#include <time.h>
+#if !defined(_MSC_VER) || defined(BUILDING_STARPU)
+#include <pthread.h>
+#endif
 #ifndef _TIMESPEC_DEFINED
 #ifndef _TIMESPEC_DEFINED
+/* If it didn't get defined in the standard places, then define it ourself */
 #ifndef STARPU_TIMESPEC_DEFINED
 #ifndef STARPU_TIMESPEC_DEFINED
 #define STARPU_TIMESPEC_DEFINED 1
 #define STARPU_TIMESPEC_DEFINED 1
 struct timespec {
 struct timespec {