mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-25 15:19:21 +01:00
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:
@@ -38,6 +38,15 @@
|
|||||||
#endif
|
#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)
|
#if defined(_WIN32_WCE) && defined(POCO_WINCE_TIMESTAMP_HACK)
|
||||||
|
|
||||||
|
|
||||||
@@ -226,7 +235,7 @@ void Timestamp::update()
|
|||||||
ts.QuadPart -= epoch.QuadPart;
|
ts.QuadPart -= epoch.QuadPart;
|
||||||
_ts = ts.QuadPart/10;
|
_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;
|
struct timespec ts;
|
||||||
if (clock_gettime(CLOCK_REALTIME, &ts))
|
if (clock_gettime(CLOCK_REALTIME, &ts))
|
||||||
|
|||||||
Reference in New Issue
Block a user