[libcxx-commits] [PATCH] D71522: Define _LIBCPP_HAS_TIMESPEC_GET for FreeBSD when appropriate

Dimitry Andric via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Dec 15 03:29:10 PST 2019

dim created this revision.
dim added reviewers: emaste, EricWF, ldionne, mclow.lists.
Herald added subscribers: dexonsmith, christof, krytarowski.
Herald added a project: libc++.
dim edited the summary of this revision.

FreeBSD got `timespec_get` support somewhere in the 12.x timeframe, but
the C++ version check in its system headers was written incorrectly.
This has now been fixed for both FreeBSD 13 and 12.

Add checks for the corresponding `__FreeBSD_version` values, to define
`_LIBCPP_HAS_TIMESPEC_GET` when the function is supported.

  rG LLVM Github Monorepo



Index: libcxx/include/__config
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -343,6 +343,10 @@
 #    define _LIBCPP_HAS_C11_FEATURES
+#    if __FreeBSD_version >= 1300064 || \
+       (__FreeBSD_version >= 1201504 && __FreeBSD_version < 1300000)
+#    endif
 #  elif defined(__BIONIC__)
 #    define _LIBCPP_HAS_C11_FEATURES
 #    if __ANDROID_API__ >= 21

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71522.233956.patch
Type: text/x-patch
Size: 552 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20191215/e6cd2dd1/attachment.bin>

More information about the libcxx-commits mailing list