[libc++] Avoid including <sys/cdefs.h> on non-Apple platforms in <ctime>

This commit is contained in:
Louis Dionne 2020-09-02 18:11:26 -04:00
parent 69289cc10f
commit 5571467879
1 changed files with 5 additions and 3 deletions

View File

@ -59,9 +59,11 @@ int timespec_get( struct timespec *ts, int base); // C++17
// we're detecting this here instead of in <__config> because we can't include
// system headers from <__config>, since it leads to circular module dependencies.
// This is also meant to be a very temporary workaround until the SDKs are fixed.
#include <sys/cdefs.h>
#if defined(__APPLE__) && defined(_LIBCPP_HAS_TIMESPEC_GET) && (__DARWIN_C_LEVEL < __DARWIN_C_FULL)
# define _LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED
#if defined(__APPLE__)
# include <sys/cdefs.h>
# if defined(_LIBCPP_HAS_TIMESPEC_GET) && (__DARWIN_C_LEVEL < __DARWIN_C_FULL)
# define _LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED
# endif
#endif
_LIBCPP_BEGIN_NAMESPACE_STD