libfaketime.c: wrap timespec_get in TIME_UTC macro #415
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 3 4