Skip to content

Commit 57616f8

Browse files
mleleszikcloudy0717
authored andcommitted
[libc][wctype] Add cmake flag for configuring wctype implementation used (llvm#170531)
llvm#170525 Based on our [RFC](https://discourse.llvm.org/t/rfc-libc-wctype-header-implementation/88941/10), we are starting the implementation of the wctype header with C.UTF8 support. This implementation will increase the binary size by approximately ~70KB, so this PR introduces a flag so that this is configurable, allowing the user to choose between a simple ASCII implementation or the full Unicode one.
1 parent 7a8a829 commit 57616f8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libc/config/config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,11 @@
130130
"value": true,
131131
"doc": "Add nullptr checks in the library's implementations to some functions for which passing nullptr is undefined behavior."
132132
}
133+
},
134+
"wctype": {
135+
"LIBC_CONF_WCTYPE_MODE": {
136+
"value": "LIBC_WCTYPE_MODE_ASCII",
137+
"doc": "The implementation used for wctype, acceptable values are LIBC_WCTYPE_MODE_ASCII and LIBC_WCTYPE_MODE_UTF8."
138+
}
133139
}
134140
}

libc/docs/configure.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ to learn about the defaults for your platform and target.
6464
- ``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.
6565
* **"time" options**
6666
- ``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.
67+
* **"wctype" options**
68+
- ``LIBC_CONF_WCTYPE_MODE``: The implementation used for wctype, acceptable values are LIBC_WCTYPE_MODE_ASCII and LIBC_WCTYPE_MODE_UTF8.

0 commit comments

Comments
 (0)