[libc-commits] [libc] [libc][wctype] Add cmake flag for configuring wctype implementation used (PR #170531)

Marcell Leleszi via libc-commits libc-commits at lists.llvm.org
Wed Dec 3 22:16:29 PST 2025


https://github.com/mleleszi updated https://github.com/llvm/llvm-project/pull/170531

>From 2554204b615001d14af9125d9953e02fe7a0a262 Mon Sep 17 00:00:00 2001
From: Marcell Leleszi <mleleszi at google.com>
Date: Wed, 3 Dec 2025 18:24:45 +0000
Subject: [PATCH 1/2] Add cmake flag for configuring wctype implementation used

---
 libc/config/config.json | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libc/config/config.json b/libc/config/config.json
index cfbe9a43948ea..a7844e4fe2dd1 100644
--- a/libc/config/config.json
+++ b/libc/config/config.json
@@ -130,5 +130,11 @@
       "value": true,
       "doc": "Add nullptr checks in the library's implementations to some functions for which passing nullptr is undefined behavior."
     }
+  },
+  "wctype": {
+    "LIBC_CONF_WCTYPE_MODE": {
+      "value": "LIBC_WCTYPE_MODE_ASCII",
+      "doc": "The implementation used for wctype, acceptable values are LIBC_WCTYPE_MODE_ASCII and LIBC_WCTYPE_MODE_UTF8."
+    }
   }
 }

>From e01265420e2df90eb3abf4b031e6fb2ae7243fa3 Mon Sep 17 00:00:00 2001
From: Marcell Leleszi <mleleszi at google.com>
Date: Thu, 4 Dec 2025 06:16:11 +0000
Subject: [PATCH 2/2] Generate docs

---
 libc/docs/configure.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libc/docs/configure.rst b/libc/docs/configure.rst
index e23fc824ce7c8..362e293a4b714 100644
--- a/libc/docs/configure.rst
+++ b/libc/docs/configure.rst
@@ -64,3 +64,5 @@ to learn about the defaults for your platform and target.
     - ``LIBC_CONF_THREAD_MODE``: The implementation used for Mutex, acceptable values are LIBC_THREAD_MODE_PLATFORM, LIBC_THREAD_MODE_SINGLE, and LIBC_THREAD_MODE_EXTERNAL.
 * **"time" options**
     - ``LIBC_CONF_TIME_64BIT``: Force the size of time_t to 64 bits, even on platforms where compatibility considerations would otherwise make it 32-bit.
+* **"wctype" options**
+    - ``LIBC_CONF_WCTYPE_MODE``: The implementation used for wctype, acceptable values are LIBC_WCTYPE_MODE_ASCII and LIBC_WCTYPE_MODE_UTF8.



More information about the libc-commits mailing list