git: 983d17bc1d75 - stable/14 - libcxx cstdlib, cwchar: avoid using long long functions if not supported, even for older compilers that do not support the using_if_exists attribute.

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sun, 01 Dec 2024 11:18:35 UTC
The branch stable/14 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=983d17bc1d753b0653415da20147080d4d03971b

commit 983d17bc1d753b0653415da20147080d4d03971b
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-08-05 20:08:49 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-12-01 11:17:08 +0000

    libcxx cstdlib, cwchar: avoid using long long functions if not
    supported, even for older compilers that do not support the
    using_if_exists attribute.
    
    PR:             280562
    MFC after:      1 month
    
    (cherry picked from commit 6b4981df6008fb59a5b4c1f0b79f0a0b21ac232e)
---
 contrib/llvm-project/libcxx/include/cstdlib | 12 ++++++++++++
 contrib/llvm-project/libcxx/include/cwchar  |  4 ++++
 2 files changed, 16 insertions(+)

diff --git a/contrib/llvm-project/libcxx/include/cstdlib b/contrib/llvm-project/libcxx/include/cstdlib
index c817fd8f4acc..d9e17ee65c56 100644
--- a/contrib/llvm-project/libcxx/include/cstdlib
+++ b/contrib/llvm-project/libcxx/include/cstdlib
@@ -102,18 +102,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 using ::size_t _LIBCPP_USING_IF_EXISTS;
 using ::div_t _LIBCPP_USING_IF_EXISTS;
 using ::ldiv_t _LIBCPP_USING_IF_EXISTS;
+#if defined(__FreeBSD__) && defined(__LONG_LONG_SUPPORTED)
 using ::lldiv_t _LIBCPP_USING_IF_EXISTS;
+#endif
 using ::atof _LIBCPP_USING_IF_EXISTS;
 using ::atoi _LIBCPP_USING_IF_EXISTS;
 using ::atol _LIBCPP_USING_IF_EXISTS;
+#if defined(__FreeBSD__) && defined(__LONG_LONG_SUPPORTED)
 using ::atoll _LIBCPP_USING_IF_EXISTS;
+#endif
 using ::strtod _LIBCPP_USING_IF_EXISTS;
 using ::strtof _LIBCPP_USING_IF_EXISTS;
 using ::strtold _LIBCPP_USING_IF_EXISTS;
 using ::strtol _LIBCPP_USING_IF_EXISTS;
+#if defined(__FreeBSD__) && defined(__LONG_LONG_SUPPORTED)
 using ::strtoll _LIBCPP_USING_IF_EXISTS;
+#endif
 using ::strtoul _LIBCPP_USING_IF_EXISTS;
+#if defined(__FreeBSD__) && defined(__LONG_LONG_SUPPORTED)
 using ::strtoull _LIBCPP_USING_IF_EXISTS;
+#endif
 using ::rand _LIBCPP_USING_IF_EXISTS;
 using ::srand _LIBCPP_USING_IF_EXISTS;
 using ::calloc _LIBCPP_USING_IF_EXISTS;
@@ -130,10 +138,14 @@ using ::bsearch _LIBCPP_USING_IF_EXISTS;
 using ::qsort _LIBCPP_USING_IF_EXISTS;
 using ::abs _LIBCPP_USING_IF_EXISTS;
 using ::labs _LIBCPP_USING_IF_EXISTS;
+#if defined(__FreeBSD__) && defined(__LONG_LONG_SUPPORTED)
 using ::llabs _LIBCPP_USING_IF_EXISTS;
+#endif
 using ::div _LIBCPP_USING_IF_EXISTS;
 using ::ldiv _LIBCPP_USING_IF_EXISTS;
+#if defined(__FreeBSD__) && defined(__LONG_LONG_SUPPORTED)
 using ::lldiv _LIBCPP_USING_IF_EXISTS;
+#endif
 using ::mblen _LIBCPP_USING_IF_EXISTS;
 #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 using ::mbtowc _LIBCPP_USING_IF_EXISTS;
diff --git a/contrib/llvm-project/libcxx/include/cwchar b/contrib/llvm-project/libcxx/include/cwchar
index 08cfac58c846..dd16eaeaa07f 100644
--- a/contrib/llvm-project/libcxx/include/cwchar
+++ b/contrib/llvm-project/libcxx/include/cwchar
@@ -151,9 +151,13 @@ using ::wcstod _LIBCPP_USING_IF_EXISTS;
 using ::wcstof _LIBCPP_USING_IF_EXISTS;
 using ::wcstold _LIBCPP_USING_IF_EXISTS;
 using ::wcstol _LIBCPP_USING_IF_EXISTS;
+#if defined(__FreeBSD__) && defined(__LONG_LONG_SUPPORTED)
 using ::wcstoll _LIBCPP_USING_IF_EXISTS;
+#endif
 using ::wcstoul _LIBCPP_USING_IF_EXISTS;
+#if defined(__FreeBSD__) && defined(__LONG_LONG_SUPPORTED)
 using ::wcstoull _LIBCPP_USING_IF_EXISTS;
+#endif
 using ::wcscpy _LIBCPP_USING_IF_EXISTS;
 using ::wcsncpy _LIBCPP_USING_IF_EXISTS;
 using ::wcscat _LIBCPP_USING_IF_EXISTS;