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
This commit is contained in:
Dimitry Andric 2020-01-30 08:00:28 +01:00
parent 007a6a155c
commit 5e416ba943

View File

@ -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