fixed GH #1453: _clock_gettime Symbol not found on Mac 10.11 [do not use clock_gettime() on Apple platforms, even if _POSIX_TIMERS indicates it's available]

This commit is contained in:
Guenter Obiltschnig
2016-12-06 18:21:37 +01:00
parent c9c21de32a
commit 376e703343

View File

@@ -38,6 +38,15 @@
#endif
#ifndef POCO_HAVE_CLOCK_GETTIME
#if (defined(_POSIX_TIMERS) && defined(CLOCK_REALTIME)) || defined(POCO_VXWORKS) || defined(__QNX__)
#ifndef __APPLE__ // See GitHub issue #1453 - not available before Mac OS 10.12/iOS 10
#define POCO_HAVE_CLOCK_GETTIME
#endif
#endif
#endif
#if defined(_WIN32_WCE) && defined(POCO_WINCE_TIMESTAMP_HACK)
@@ -226,7 +235,7 @@ void Timestamp::update()
ts.QuadPart -= epoch.QuadPart;
_ts = ts.QuadPart/10;
#elif (defined(_POSIX_TIMERS) && defined(CLOCK_REALTIME)) || defined(POCO_VXWORKS) || defined(__QNX__)
#elif defined(POCO_HAVE_CLOCK_GETTIME)
struct timespec ts;
if (clock_gettime(CLOCK_REALTIME, &ts))