[libc-commits] [libc] [libc] Add internal locale structures and config options (PR #211470)

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Tue Nov 17 06:50:21 PST 2026


================
@@ -0,0 +1,129 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Internal structures for locale category data.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_LOCALE_LOCALE_DATA_H
+#define LLVM_LIBC_SRC_LOCALE_LOCALE_DATA_H
+
+#include "src/__support/CPP/string_view.h"
+#include "src/__support/macros/attributes.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+#ifdef LIBC_CONF_DEFAULT_LOCALE
+LIBC_INLINE_VAR constexpr cpp::string_view DEFAULT_LOCALE_NAME =
+    LIBC_CONF_DEFAULT_LOCALE;
+#else
+LIBC_INLINE_VAR constexpr cpp::string_view DEFAULT_LOCALE_NAME = "C.UTF-8";
----------------
labath wrote:

WDYT about defining the default at the cmake level? (I see most options don't do that, but LIBC_COPT_STRING_LENGTH_IMPL could be a precedent of sorts)

https://github.com/llvm/llvm-project/pull/211470


More information about the libc-commits mailing list