[libcxx-commits] [libcxx] d2e2626 - [libc++] Don't rely on a transitively included BYTE_ORDER in ctype_base (#213032)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 3 05:53:16 PDT 2026
Author: Louis Dionne
Date: 2026-08-03T08:53:12-04:00
New Revision: d2e2626045e2380e60f51e75c39acf245572c918
URL: https://github.com/llvm/llvm-project/commit/d2e2626045e2380e60f51e75c39acf245572c918
DIFF: https://github.com/llvm/llvm-project/commit/d2e2626045e2380e60f51e75c39acf245572c918.diff
LOG: [libc++] Don't rely on a transitively included BYTE_ORDER in ctype_base (#213032)
Use libc++'s own _LIBCPP_BIG_ENDIAN macro instead of BYTE_ORDER, which
was relied upon from a transitive <endian.h> include on Glibc.
Added:
Modified:
libcxx/include/__locale
Removed:
################################################################################
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index 15031c36ec435..f48fd85805919 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -12,6 +12,7 @@
#include <__config>
#include <__configuration/availability.h>
+#include <__configuration/platform.h>
#if _LIBCPP_HAS_LOCALIZATION
@@ -345,7 +346,7 @@ public:
static const mask xdigit = _ISxdigit;
static const mask blank = _ISblank;
_LIBCPP_DIAGNOSTIC_POP
-# if defined(__mips__) || (BYTE_ORDER == BIG_ENDIAN)
+# if defined(__mips__) || defined(_LIBCPP_BIG_ENDIAN)
static const mask __regex_word = static_cast<mask>(_ISbit(15));
# else
static const mask __regex_word = 0x80;
More information about the libcxx-commits
mailing list