Function timespec_get is not guaranteed to be declared in MacOS since its standard library is non-conformance to modern standards. Therefore, skip patching timespec_get if it is undeclared by the standard library.
The detection of timespec_get is based on the conjecture that the macro TIME_UTC is only defined when timespec_get is declared.
This PR is motivated by errors I faced when building on x86_64-darwin:
libfaketime.c:2345:29: error: use of undeclared identifier 'timespec_get'
DONT_FAKE_TIME(result = (*timespec_get)(ts, base));
^
libfaketime.c:4022:38: error: use of undeclared identifier 'timespec_get'
DYLD_INTERPOSE(macos_timespec_get, timespec_get);
^
Typing the error into google yielded this: 1, then I got more information and came up with this by looking at others' bits. 24
Function
timespec_get
is not guaranteed to be declared in MacOS since its standard library is non-conformance to modern standards. Therefore, skip patchingtimespec_get
if it is undeclared by the standard library.The detection of
timespec_get
is based on the conjecture that the macroTIME_UTC
is only defined whentimespec_get
is declared.This PR is motivated by errors I faced when building on
x86_64-darwin
:Typing the error into google yielded this: 1, then I got more information and came up with this by looking at others' bits. 2 4