#define SEED 221238
#define sleep(x) smpi_sleep(x)
-#if _POSIX_TIMERS && _POSIX_C_SOURCE >= 199309L
+#if _POSIX_TIMERS > 0
#define nanosleep(x, y) smpi_nanosleep(x, y)
#endif
#define usleep(x) smpi_usleep(x)
#include <sys/time.h> /* Load it before the define next line to not mess with the system headers */
#define gettimeofday(x, y) smpi_gettimeofday(x, NULL)
-#if _POSIX_TIMERS && _POSIX_C_SOURCE >= 199309L
+#if _POSIX_TIMERS > 0
#define clock_gettime(x, y) smpi_clock_gettime(x, y)
#endif
#if HAVE_MC
XBT_PUBLIC(double) smpi_get_host_consumed_energy(void);
XBT_PUBLIC(int) smpi_usleep(useconds_t usecs);
-#if _POSIX_TIMERS && _POSIX_C_SOURCE >= 199309L
+#if _POSIX_TIMERS > 0
XBT_PUBLIC(int) smpi_nanosleep(const struct timespec *tp, struct timespec * t);
XBT_PUBLIC(int) smpi_clock_gettime(clockid_t clk_id, struct timespec *tp);
#endif
return static_cast<int>(private_sleep(static_cast<double>(usecs) / 1000000.0));
}
-#if _POSIX_TIMERS && _POSIX_C_SOURCE >= 199309L
+#if _POSIX_TIMERS > 0
int smpi_nanosleep(const struct timespec *tp, struct timespec * t)
{
return static_cast<int>(private_sleep(static_cast<double>(tp->tv_sec + tp->tv_nsec / 1000000000.0)));
return 0;
}
-#if _POSIX_TIMERS && _POSIX_C_SOURCE >= 199309L
+#if _POSIX_TIMERS > 0
int smpi_clock_gettime(clockid_t clk_id, struct timespec *tp)
{
//there is only one time in SMPI, so clk_id is ignored.