X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ffe8ce65fd9a8e18a0469f26f067c3ea6d5d60d4..9dbeb2372ad9a123d0558132ebb6e003e10aa641:/src/xbt/xbt_os_time.c diff --git a/src/xbt/xbt_os_time.c b/src/xbt/xbt_os_time.c index b9912ace94..2819255d33 100644 --- a/src/xbt/xbt_os_time.c +++ b/src/xbt/xbt_os_time.c @@ -22,7 +22,7 @@ #define CLOCK_PROCESS_CPUTIME_ID CLOCK_PROF #endif -#ifdef MACOS +#if defined(__APPLE__) && defined(__MACH__) #include #include #include @@ -357,10 +357,10 @@ 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)); -#elif defined(HAVE_GETTIMEOFDAY) && defined(MACOS) //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; + mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; thread_basic_info_data_t thi_data; thread_basic_info_t thi = &thi_data; thread_info(mach_thread_self(), THREAD_BASIC_INFO, (thread_info_t)thi, &count); @@ -397,10 +397,10 @@ 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)); -#elif defined(HAVE_GETTIMEOFDAY) && defined(MACOS) +#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; + mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; thread_basic_info_data_t thi_data; thread_basic_info_t thi = &thi_data; thread_info(mach_thread_self(), THREAD_BASIC_INFO, (thread_info_t)thi, &count); @@ -436,8 +436,8 @@ void xbt_os_threadtimer_stop(xbt_os_timer_t timer) { #ifdef HAVE_POSIX_GETTIME clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->stop)); -#elif defined(HAVE_GETTIMEOFDAY) && defined(MACOS) - int count = THREAD_BASIC_INFO_COUNT; +#elif defined(HAVE_GETTIMEOFDAY) && defined(__MACH__) && defined(__APPLE__) + mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; thread_basic_info_data_t thi_data; thread_basic_info_t thi = &thi_data; thread_info(mach_thread_self(), THREAD_BASIC_INFO, (thread_info_t)thi, &count);