Commit c85f8af6 authored by Chad Austin's avatar Chad Austin Committed by Facebook GitHub Bot

don't use clock_gettime fallback on modern macOS

Summary:
There were two problems with the clock_gettime fallback logic on
macOS. One is that it used undefined macros if AvailabilityMacros.h
wasn't included. Another is that it compiled the fallback when the
minimum iPhone OS version (as when building on macOS) was not set, and
vice versa.

Fix that.

Differential Revision: D21757362

fbshipit-source-id: 99fd17260cb25ed07c39ba79466e835f08a1fc7c
parent fd295717
......@@ -34,4 +34,6 @@
#ifdef __APPLE__
#include <Availability.h> // @manual
#include <AvailabilityMacros.h> // @manual
#include <TargetConditionals.h> // @manual
#endif
......@@ -27,9 +27,10 @@
// 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 __MACH__ && \
(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 || \
__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)
#if __MACH__ && \
((!defined(TARGET_OS_OSX) || TARGET_OS_OSX) && \
(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12)) || \
(TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0))
#ifdef FOLLY_HAVE_CLOCK_GETTIME
#undef FOLLY_HAVE_CLOCK_GETTIME
......
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