Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add missing __APPLE__ test in xbt_os_thread.c
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 16 Jun 2015 09:48:52 +0000 (11:48 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 16 Jun 2015 09:48:52 +0000 (11:48 +0200)
src/xbt/xbt_os_thread.c
src/xbt/xbt_os_time.c

index 46a0e7e..c3c588f 100644 (file)
@@ -9,7 +9,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #if defined(WIN32)
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #if defined(WIN32)
-#elif defined(__MACH__)
+#elif defined(__MACH__) && defined(__APPLE__)
 #include <stdint.h>
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #include <stdint.h>
 #include <sys/types.h>
 #include <sys/sysctl.h>
index cd31648..de45dd7 100644 (file)
@@ -357,7 +357,7 @@ void xbt_os_threadtimer_start(xbt_os_timer_t timer)
   timer->elapse.tv_sec = 0;
   timer->elapse.tv_nsec = 0;
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->start));
   timer->elapse.tv_sec = 0;
   timer->elapse.tv_nsec = 0;
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->start));
-#elif defined(HAVE_GETTIMEOFDAY) && defined(__MACH__)//attempt for timing of the thread on OSX
+#elif defined(HAVE_GETTIMEOFDAY) && defined(__MACH__) && defined(__APPLE__)//attempt for timing of the thread on OSX
   timer->elapse.tv_sec = 0;
   timer->elapse.tv_usec = 0;
   int count = THREAD_BASIC_INFO_COUNT;
   timer->elapse.tv_sec = 0;
   timer->elapse.tv_usec = 0;
   int count = THREAD_BASIC_INFO_COUNT;
@@ -397,7 +397,7 @@ void xbt_os_threadtimer_resume(xbt_os_timer_t timer)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
   timer->elapse.tv_nsec += timer->stop.tv_nsec - timer->start.tv_nsec;
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->start));
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
   timer->elapse.tv_nsec += timer->stop.tv_nsec - timer->start.tv_nsec;
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->start));
-#elif defined(HAVE_GETTIMEOFDAY) && defined(__MACH__)
+#elif defined(HAVE_GETTIMEOFDAY) && defined(__MACH__) && defined(__APPLE__)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
   timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
   int count = THREAD_BASIC_INFO_COUNT;
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
   timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
   int count = THREAD_BASIC_INFO_COUNT;
@@ -436,7 +436,7 @@ void xbt_os_threadtimer_stop(xbt_os_timer_t timer)
 {
 #ifdef HAVE_POSIX_GETTIME
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->stop));
 {
 #ifdef HAVE_POSIX_GETTIME
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->stop));
-#elif defined(HAVE_GETTIMEOFDAY) && defined(__MACH__)
+#elif defined(HAVE_GETTIMEOFDAY) && defined(__MACH__) && defined(__APPLE__)
   int count = THREAD_BASIC_INFO_COUNT;
   thread_basic_info_data_t thi_data;
   thread_basic_info_t thi = &thi_data;
   int count = THREAD_BASIC_INFO_COUNT;
   thread_basic_info_data_t thi_data;
   thread_basic_info_t thi = &thi_data;