Skip to content

Commit 15ce79b

Browse files
committed
Tentatively merge llvm/llvm-project#77242
[libcxx] Re-include <osreldate.h> in __config for FreeBSD In 0a97720d0197 some changes were made to `__config` for assuming that `__BYTE_ORDER__` is always present. However, this deleted a `<osreldate.h>` include for FreeBSD, which is required to get the value of `__FreeBSD_version`, and that is used later in the file to determine whether `_LIBCPP_C_HAS_NO_GETS` needs to be enabled. Include `<osreldate.h>` just after the other includes used for feature detection, to fix this. Note that when FreeBSD 13 is EOLed, this can be removed, as then all supported FreeBSD versions will no longer have `gets()`. PR: 276104 MFC after: 1 month (cherry picked from commit 653487b)
1 parent 0c85e27 commit 15ce79b

File tree

1 file changed

+4
-0
lines changed
  • contrib/llvm-project/libcxx/include

1 file changed

+4
-0
lines changed

contrib/llvm-project/libcxx/include/__config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,10 @@ _LIBCPP_HARDENING_MODE_DEBUG
477477
# include <features.h> // for __NATIVE_ASCII_F
478478
# endif
479479

480+
# ifdef __FreeBSD__
481+
# include <osreldate.h> // for __FreeBSD_version
482+
# endif
483+
480484
# ifndef __BYTE_ORDER__
481485
# error \
482486
"Your compiler doesn't seem to define __BYTE_ORDER__, which is required by libc++ to know the endianness of your target platform"

0 commit comments

Comments
 (0)