From 376e7033435714f45633981536506f1840a06345 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Tue, 6 Dec 2016 18:21:37 +0100 Subject: [PATCH] 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] --- Foundation/src/Timestamp.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Foundation/src/Timestamp.cpp b/Foundation/src/Timestamp.cpp index bba23aa4f..aaf91cb00 100644 --- a/Foundation/src/Timestamp.cpp +++ b/Foundation/src/Timestamp.cpp @@ -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))