Skip to content

Commit

Permalink
Fix detection of clock_gettime availability (#1724)
Browse files Browse the repository at this point in the history
Summary:
On Apple platforms, following the SDK development [1] guidelines, we can check
for the availability (as in definition) of symbols using macros. This is more
reliable notably when targeting iOS platforms or simulators where the previous
approach used to create redefinition problems [2] & [3].

[1] https://developer.apple.com/forums/thread/67102
[2] #1470
[3] facebook/flipper#834

Pull Request resolved: #1724

Reviewed By: Gownta

Differential Revision: D38406371

Pulled By: Orvid

fbshipit-source-id: c5e37d3cd7d8764049953ffba6c6a449217c8cb1
  • Loading branch information
rcari authored and facebook-github-bot committed Aug 23, 2022
1 parent 974b280 commit 4a2410f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions folly/portability/Time.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
// solve that by pretending we have it here in the header and
// then enable our implementation on the source side so that
// gets linked in instead.
#if defined(__MACH__) && \
((!defined(TARGET_OS_OSX) || TARGET_OS_OSX) && \
(MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)) || \
(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE != 0 && \
(__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0))
#if defined(__MACH__) && defined(__CLOCK_AVAILABILITY)

#ifdef FOLLY_HAVE_CLOCK_GETTIME
#undef FOLLY_HAVE_CLOCK_GETTIME
Expand Down

0 comments on commit 4a2410f

Please sign in to comment.