Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85db121

Browse files
authored
[libc][wctype] Implement internal UTF8 wctype classification functions (#174607)
Closes [#174604](#174604) This patch implements the internal wide character classification functions with Unicode support. The ASCII paths which were not implemented are taken from [ctype_utils.h](https://github.com/llvm/llvm-project/blob/main/libc/src/__support/ctype_utils.h) The tests mainly cover the dispatch logic between ASCII and UTF8, the UTF8 variants are already comprehensively tested in [wctype_classification_utils_test.cpp](https://github.com/mleleszi/llvm-project/blob/main/libc/test/src/__support/wctype/wctype_classification_utils_test.cpp).
1 parent 0287d78 commit 85db121

4 files changed

Lines changed: 908 additions & 138 deletions

File tree

libc/src/__support/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,22 @@ add_header_library(
156156
ctype_utils.h
157157
)
158158

159+
list(APPEND wctype_utils_deps
160+
libc.hdr.types.wchar_t
161+
)
162+
163+
if ("${LIBC_CONF_WCTYPE_MODE}" STREQUAL "LIBC_WCTYPE_MODE_UTF8")
164+
list(APPEND wctype_utils_deps
165+
libc.src.__support.wctype.wctype_classification_utils
166+
)
167+
endif()
168+
159169
add_header_library(
160170
wctype_utils
161171
HDRS
162172
wctype_utils.h
163173
DEPENDS
164-
libc.hdr.types.wchar_t
174+
${wctype_utils_deps}
165175
)
166176

167177
add_header_library(

0 commit comments

Comments
 (0)