git: 15ce79bc8b1f - stable/13 - Tentatively merge https://github.com/llvm/llvm-project/pull/77242

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 20 Apr 2024 10:34:21 UTC
The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=15ce79bc8b1f02ad1dbab2f2d7f6806b4801c09b

commit 15ce79bc8b1f02ad1dbab2f2d7f6806b4801c09b
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-01-07 16:03:13 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-19 21:24:41 +0000

    Tentatively merge https://github.com/llvm/llvm-project/pull/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 653487bbc8006839d0895811942bb8a2fcdd5aa8)
---
 contrib/llvm-project/libcxx/include/__config | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/llvm-project/libcxx/include/__config b/contrib/llvm-project/libcxx/include/__config
index 40e6da8bc03a..f52fb0441293 100644
--- a/contrib/llvm-project/libcxx/include/__config
+++ b/contrib/llvm-project/libcxx/include/__config
@@ -477,6 +477,10 @@ _LIBCPP_HARDENING_MODE_DEBUG
 #    include <features.h> // for __NATIVE_ASCII_F
 #  endif
 
+#  ifdef __FreeBSD__
+#    include <osreldate.h> // for __FreeBSD_version
+#  endif
+
 #  ifndef __BYTE_ORDER__
 #    error                                                                                                             \
         "Your compiler doesn't seem to define __BYTE_ORDER__, which is required by libc++ to know the endianness of your target platform"