[libc++] Sync TEST_HAS_TIMESPEC_GET and _LIBCPP_HAS_TIMESPEC_GET on FreeBSD
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Tue, 19 Jan 2021 13:02:29 +0000 (13:02 +0000)
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Tue, 19 Jan 2021 15:02:57 +0000 (15:02 +0000)
Commit 5e416ba943b7c737deb8eca62756f7b4fa925845 (D71522) updated the
__config header but didn't change test_macros.h.
This fixes libcxx/language.support/has_timespec_get.compile.pass.cpp on
FreeBSD12/13.

Reviewed By: #libc, dim, ldionne

Differential Revision: https://reviews.llvm.org/D94292

libcxx/test/support/test_macros.h

index 5f8ac2e..b71d739 100644 (file)
 // 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
+#    if __FreeBSD_version >= 1300064 || \
+       (__FreeBSD_version >= 1201504 && __FreeBSD_version < 1300000)
+#      define TEST_HAS_TIMESPEC_GET
+#    endif
 #    define TEST_HAS_ALIGNED_ALLOC
 #    define TEST_HAS_QUICK_EXIT
 #  elif defined(__BIONIC__)