diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-08-15 21:19:08 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-08-15 21:19:08 +0000 |
| commit | 171c77b7dad4a050aca23ff7ca1b75f87560fefb (patch) | |
| tree | 6e19d3c7bf7e6d2f1b2867adcc984453f9192209 /libcxx/test/support | |
| parent | 9a389fbd79dc0681e898a2e40a00cbbe1b3eba72 (diff) | |
| download | bcm5719-llvm-171c77b7dad4a050aca23ff7ca1b75f87560fefb.tar.gz bcm5719-llvm-171c77b7dad4a050aca23ff7ca1b75f87560fefb.zip | |
Selectively import timespec_get into namespace std, since some C libraries don't have it. Reviewed as https://reviews.llvm.org/D50799
llvm-svn: 339816
Diffstat (limited to 'libcxx/test/support')
| -rw-r--r-- | libcxx/test/support/test_macros.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index d774fc0384d..e008b532300 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -124,22 +124,29 @@ // Sniff out to see if the underling C library has C11 features // Note that at this time (July 2018), MacOS X and iOS do NOT. +// This is cribbed from __config; but lives here as well because we can't assume libc++ #if __ISO_C_VISIBLE >= 2011 || TEST_STD_VER >= 11 # if defined(__FreeBSD__) +// Specifically, FreeBSD does NOT have timespec_get, even though they have all +// the rest of C11 - this is PR#38495 # define TEST_HAS_C11_FEATURES # elif defined(__Fuchsia__) # define TEST_HAS_C11_FEATURES +# define TEST_HAS_TIMESPEC_GET # elif defined(__linux__) # if !defined(_LIBCPP_HAS_MUSL_LIBC) # if _LIBCPP_GLIBC_PREREQ(2, 17) +# define TEST_HAS_TIMESPEC_GET # define TEST_HAS_C11_FEATURES # endif # else // defined(_LIBCPP_HAS_MUSL_LIBC) # define TEST_HAS_C11_FEATURES +# define TEST_HAS_TIMESPEC_GET # endif # elif defined(_WIN32) # if defined(_MSC_VER) && !defined(__MINGW32__) # define TEST_HAS_C11_FEATURES // Using Microsoft's C Runtime library +# define TEST_HAS_TIMESPEC_GET # endif # endif #endif |

