Commit bf6d8a5d authored by Ahmad M. Zawawi's avatar Ahmad M. Zawawi Committed by Luca Boccassi

Fix clock_t crash on iOS 9.3.2 and 9.3.5 (#2325)

* Fix possible clock_t crash on iOS 9.3.2 and 9.3.5 + macOS < 10.12

* No need to read return value
parent c6c21cf1
...@@ -240,7 +240,11 @@ uint64_t zmq::clock_t::rdtsc () ...@@ -240,7 +240,11 @@ uint64_t zmq::clock_t::rdtsc ()
return(tsc); return(tsc);
#else #else
struct timespec ts; struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts); #if defined ZMQ_HAVE_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 // less than macOS 10.12
alt_clock_gettime (CLOCK_MONOTONIC, &ts);
#else
clock_gettime (CLOCK_MONOTONIC, &ts);
#endif
return (uint64_t)(ts.tv_sec) * 1000000000 + ts.tv_nsec; return (uint64_t)(ts.tv_sec) * 1000000000 + ts.tv_nsec;
#endif #endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment