13
0

fix clock_gettime detection

fixes compilation with mingw64 gcc-4.9.1
This commit is contained in:
Robin Gareus 2014-10-02 02:53:35 +02:00
parent 0d20cd5911
commit 8fe3360c35

View File

@ -118,7 +118,7 @@ FileManager::allocate (FileDescriptor* d)
#ifdef __APPLE__
d->_last_used = mach_absolute_time();
#elif defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK)
#elif defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_C_SOURCE >= 199309L)
struct timespec t;
clock_gettime (CLOCK_MONOTONIC, &t);
d->_last_used = t.tv_sec + (double) t.tv_nsec / 10e9;