[libc++] Provide std::aligned_alloc and std::timespec_get on Apple platforms

rdar://66113878
This commit is contained in:
Louis Dionne 2020-07-27 14:25:03 -04:00
parent 1bd7c02233
commit 67dfba9629
2 changed files with 22 additions and 2 deletions

View File

@ -380,7 +380,17 @@
# define _LIBCPP_HAS_QUICK_EXIT
# define _LIBCPP_HAS_TIMESPEC_GET
# endif
# endif // __linux__
# elif defined(__APPLE__)
// timespec_get and aligned_alloc were introduced in macOS 10.15 and
// aligned releases
# if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500 || \
__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000)
# define _LIBCPP_HAS_ALIGNED_ALLOC
# define _LIBCPP_HAS_TIMESPEC_GET
# endif
# endif // __APPLE__
#endif
#ifndef _LIBCPP_CXX03_LANG

View File

@ -208,7 +208,17 @@
# define TEST_HAS_ALIGNED_ALLOC
# define TEST_HAS_TIMESPEC_GET
# endif
# endif
# elif defined(__APPLE__)
// timespec_get and aligned_alloc were introduced in macOS 10.15 and
// aligned releases
# if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500 || \
__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000)
# define TEST_HAS_ALIGNED_ALLOC
# define TEST_HAS_TIMESPEC_GET
# endif
# endif // __APPLE__
#endif
/* Features that were introduced in C++14 */