From 5e416ba943b7c737deb8eca62756f7b4fa925845 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 30 Jan 2020 08:00:28 +0100 Subject: [PATCH] Define _LIBCPP_HAS_TIMESPEC_GET for FreeBSD when appropriate Summary: 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. Reviewers: emaste, EricWF, ldionne, mclow.lists Reviewed By: ldionne Subscribers: arichardson, krytarowski, christof, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D71522 --- libcxx/include/__config | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcxx/include/__config b/libcxx/include/__config index 2e456439a53..d00f5cc61b1 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -342,6 +342,10 @@ # define _LIBCPP_HAS_ALIGNED_ALLOC # define _LIBCPP_HAS_QUICK_EXIT # define _LIBCPP_HAS_C11_FEATURES +# if __FreeBSD_version >= 1300064 || \ + (__FreeBSD_version >= 1201504 && __FreeBSD_version < 1300000) +# define _LIBCPP_HAS_TIMESPEC_GET +# endif # elif defined(__BIONIC__) # define _LIBCPP_HAS_C11_FEATURES # if __ANDROID_API__ >= 21 -- 2.11.0