mirror of
https://github.com/zeromq/libzmq.git
synced 2025-02-21 06:37:44 +01:00
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
This commit is contained in:
parent
c6c21cf197
commit
bf6d8a5d17
@ -240,7 +240,11 @@ uint64_t zmq::clock_t::rdtsc ()
|
||||
return(tsc);
|
||||
#else
|
||||
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;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user