[libc-commits] [libc] [libc] add wctype.h header (PR #149202)
Prabhu Rajasekaran via libc-commits
libc-commits at lists.llvm.org
Thu Jul 17 10:26:58 PDT 2025
https://github.com/Prabhuk updated https://github.com/llvm/llvm-project/pull/149202
>From 77f1c394b068c8545cf9a043738dbd049b123a3d Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Wed, 16 Jul 2025 15:06:58 -0700
Subject: [PATCH 1/8] [libc] add wctype.h header
Add basic configurations to generate wctype.h header file. To begin with
this header file just exposes one function iswalpha.
---
libc/config/baremetal/arm/entrypoints.txt | 3 +++
libc/include/CMakeLists.txt | 9 +++++++++
libc/include/wctype.h.def | 16 ++++++++++++++++
libc/include/wctype.yaml | 14 ++++++++++++++
libc/src/CMakeLists.txt | 1 +
libc/src/wctype/CMakeLists.txt | 9 +++++++++
libc/src/wctype/iswalpha.cpp | 21 +++++++++++++++++++++
libc/src/wctype/iswalpha.h | 21 +++++++++++++++++++++
8 files changed, 94 insertions(+)
create mode 100644 libc/include/wctype.h.def
create mode 100644 libc/include/wctype.yaml
create mode 100644 libc/src/wctype/CMakeLists.txt
create mode 100644 libc/src/wctype/iswalpha.cpp
create mode 100644 libc/src/wctype/iswalpha.h
diff --git a/libc/config/baremetal/arm/entrypoints.txt b/libc/config/baremetal/arm/entrypoints.txt
index de7549c57ff44..80cd15eebc91f 100644
--- a/libc/config/baremetal/arm/entrypoints.txt
+++ b/libc/config/baremetal/arm/entrypoints.txt
@@ -278,6 +278,9 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.wchar.wcslen
libc.src.wchar.wctob
+ # wctype.h entrypoints
+ libc.src.wctype.iswalpha
+
# internal entrypoints
libc.startup.baremetal.init
libc.startup.baremetal.fini
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 55268d19529c7..984b960acb2d7 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -720,6 +720,15 @@ add_header_macro(
.llvm-libc-types.wchar_t
)
+add_header_macro(
+ wctype
+ ../libc/include/wctype.yaml
+ wctype.h
+ DEPENDS
+ .llvm_libc_common_h
+ .llvm-libc-types.wint_t
+)
+
add_header_macro(
locale
../libc/include/locale.yaml
diff --git a/libc/include/wctype.h.def b/libc/include/wctype.h.def
new file mode 100644
index 0000000000000..8d9ff521e66be
--- /dev/null
+++ b/libc/include/wctype.h.def
@@ -0,0 +1,16 @@
+//===-- C standard library header network.h -------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_WCTYPE_H
+#define LLVM_LIBC_WCTYPE_H
+
+#include "__llvm-libc-common.h"
+
+%%public_api()
+
+#endif // LLVM_LIBC_WCTYPE_H
diff --git a/libc/include/wctype.yaml b/libc/include/wctype.yaml
new file mode 100644
index 0000000000000..bb7f0cab551c1
--- /dev/null
+++ b/libc/include/wctype.yaml
@@ -0,0 +1,14 @@
+header: wctype.h
+header_template: wctype.h.def
+macros: []
+types:
+ - type_name: wint_t
+enums: []
+objects: []
+functions:
+ - name: iswalpha
+ standards:
+ - stdc
+ return_type: int
+ arguments:
+ - type: wint_t
diff --git a/libc/src/CMakeLists.txt b/libc/src/CMakeLists.txt
index a665253c4cc03..d7a1e1f49e6ff 100644
--- a/libc/src/CMakeLists.txt
+++ b/libc/src/CMakeLists.txt
@@ -17,6 +17,7 @@ add_subdirectory(strings)
add_subdirectory(time)
add_subdirectory(unistd)
add_subdirectory(wchar)
+add_subdirectory(wctype)
if(${LIBC_TARGET_OS} STREQUAL "linux")
add_subdirectory(dirent)
diff --git a/libc/src/wctype/CMakeLists.txt b/libc/src/wctype/CMakeLists.txt
new file mode 100644
index 0000000000000..3ac5eaef8ed8b
--- /dev/null
+++ b/libc/src/wctype/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_entrypoint_object(
+ iswalpha
+ SRCS
+ iswalpha.cpp
+ HDRS
+ iswalpha.h
+ DEPENDS
+ libc.src.__support.wctype_utils
+)
diff --git a/libc/src/wctype/iswalpha.cpp b/libc/src/wctype/iswalpha.cpp
new file mode 100644
index 0000000000000..920ce70e23eff
--- /dev/null
+++ b/libc/src/wctype/iswalpha.cpp
@@ -0,0 +1,21 @@
+//===-- Implementation of wctob -------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/wctype/iswalpha.h"
+#include "src/__support/common.h"
+#include "src/__support/wctype_utils.h"
+
+#include "hdr/types/wint_t.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(bool, iswalpha, (wint_t c)) {
+ return internal::iswalpha(c);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/wctype/iswalpha.h b/libc/src/wctype/iswalpha.h
new file mode 100644
index 0000000000000..6a6d5eaa791e5
--- /dev/null
+++ b/libc/src/wctype/iswalpha.h
@@ -0,0 +1,21 @@
+//===-- Implementation header for iswalpha ----------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_WCHAR_WCTOB_H
+#define LLVM_LIBC_SRC_WCHAR_WCTOB_H
+
+#include "hdr/types/wint_t.h"
+#include "src/__support/common.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+bool iswalpha(wint_t c);
+
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC_WCHAR_WCTOB_H
>From f2596a65483819e2787aab54dedec3a999da8cf6 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Wed, 16 Jul 2025 15:13:33 -0700
Subject: [PATCH 2/8] Format changes
---
libc/src/wctype/iswalpha.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/libc/src/wctype/iswalpha.cpp b/libc/src/wctype/iswalpha.cpp
index 920ce70e23eff..c8e7464169693 100644
--- a/libc/src/wctype/iswalpha.cpp
+++ b/libc/src/wctype/iswalpha.cpp
@@ -14,8 +14,6 @@
namespace LIBC_NAMESPACE_DECL {
-LLVM_LIBC_FUNCTION(bool, iswalpha, (wint_t c)) {
- return internal::iswalpha(c);
-}
+LLVM_LIBC_FUNCTION(bool, iswalpha, (wint_t c)) { return internal::iswalpha(c); }
} // namespace LIBC_NAMESPACE_DECL
>From f61809d910d16c967f0ce16776a786b22f684464 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Wed, 16 Jul 2025 16:22:12 -0700
Subject: [PATCH 3/8] Add public header wctype
---
libc/config/baremetal/arm/headers.txt | 1 +
libc/include/wctype.h.def | 16 ----------------
libc/include/wctype.yaml | 4 ----
libc/src/wctype/iswalpha.cpp | 2 +-
4 files changed, 2 insertions(+), 21 deletions(-)
delete mode 100644 libc/include/wctype.h.def
diff --git a/libc/config/baremetal/arm/headers.txt b/libc/config/baremetal/arm/headers.txt
index 5666ef7e0012d..1f64afebdaaa7 100644
--- a/libc/config/baremetal/arm/headers.txt
+++ b/libc/config/baremetal/arm/headers.txt
@@ -23,4 +23,5 @@ set(TARGET_PUBLIC_HEADERS
libc.include.time
libc.include.uchar
libc.include.wchar
+ libc.include.wctype
)
diff --git a/libc/include/wctype.h.def b/libc/include/wctype.h.def
deleted file mode 100644
index 8d9ff521e66be..0000000000000
--- a/libc/include/wctype.h.def
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- C standard library header network.h -------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_WCTYPE_H
-#define LLVM_LIBC_WCTYPE_H
-
-#include "__llvm-libc-common.h"
-
-%%public_api()
-
-#endif // LLVM_LIBC_WCTYPE_H
diff --git a/libc/include/wctype.yaml b/libc/include/wctype.yaml
index bb7f0cab551c1..fb4f96f7d17e4 100644
--- a/libc/include/wctype.yaml
+++ b/libc/include/wctype.yaml
@@ -1,10 +1,6 @@
header: wctype.h
-header_template: wctype.h.def
-macros: []
types:
- type_name: wint_t
-enums: []
-objects: []
functions:
- name: iswalpha
standards:
diff --git a/libc/src/wctype/iswalpha.cpp b/libc/src/wctype/iswalpha.cpp
index c8e7464169693..7bd9e894234d6 100644
--- a/libc/src/wctype/iswalpha.cpp
+++ b/libc/src/wctype/iswalpha.cpp
@@ -1,4 +1,4 @@
-//===-- Implementation of wctob -------------------------------------------===//
+//===-- Implementation of iswcalpha ---------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
>From e310c0b5adb684c3eb1caf87c19144602543b0cc Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Wed, 16 Jul 2025 16:25:05 -0700
Subject: [PATCH 4/8] Fix copy paste naming bugs.
---
libc/src/wctype/iswalpha.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libc/src/wctype/iswalpha.h b/libc/src/wctype/iswalpha.h
index 6a6d5eaa791e5..681fc6ba79a54 100644
--- a/libc/src/wctype/iswalpha.h
+++ b/libc/src/wctype/iswalpha.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_WCHAR_WCTOB_H
-#define LLVM_LIBC_SRC_WCHAR_WCTOB_H
+#ifndef LLVM_LIBC_SRC_WCTYPE_ISWALPHA_H
+#define LLVM_LIBC_SRC_WCTYPE_ISWALPHA_H
#include "hdr/types/wint_t.h"
#include "src/__support/common.h"
@@ -18,4 +18,4 @@ bool iswalpha(wint_t c);
} // namespace LIBC_NAMESPACE_DECL
-#endif // LLVM_LIBC_SRC_WCHAR_WCTOB_H
+#endif // LLVM_LIBC_SRC_WCTYPE_ISWALPHA_H
>From 87f8bcffdd7a6fbf8935c106b01ee37e50969686 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Wed, 16 Jul 2025 16:37:50 -0700
Subject: [PATCH 5/8] Add iswalpha tests
---
libc/config/baremetal/riscv/entrypoints.txt | 3 ++
libc/test/src/CMakeLists.txt | 1 +
libc/test/src/wctype/CMakeLists.txt | 11 +++++
libc/test/src/wctype/iswalpha_test.cpp | 54 +++++++++++++++++++++
4 files changed, 69 insertions(+)
create mode 100644 libc/test/src/wctype/CMakeLists.txt
create mode 100644 libc/test/src/wctype/iswalpha_test.cpp
diff --git a/libc/config/baremetal/riscv/entrypoints.txt b/libc/config/baremetal/riscv/entrypoints.txt
index 7e8c186d52469..c9f8118f6e800 100644
--- a/libc/config/baremetal/riscv/entrypoints.txt
+++ b/libc/config/baremetal/riscv/entrypoints.txt
@@ -278,6 +278,9 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.wchar.wcslen
libc.src.wchar.wctob
+ # wctype.h entrypoints
+ libc.src.wctype.iswalpha
+
# internal entrypoints
libc.startup.baremetal.init
libc.startup.baremetal.fini
diff --git a/libc/test/src/CMakeLists.txt b/libc/test/src/CMakeLists.txt
index 6dca47b5343e6..b3eba43582074 100644
--- a/libc/test/src/CMakeLists.txt
+++ b/libc/test/src/CMakeLists.txt
@@ -70,6 +70,7 @@ add_subdirectory(stdlib)
add_subdirectory(string)
add_subdirectory(strings)
add_subdirectory(wchar)
+add_subdirectory(wctype)
add_subdirectory(time)
add_subdirectory(unistd)
diff --git a/libc/test/src/wctype/CMakeLists.txt b/libc/test/src/wctype/CMakeLists.txt
new file mode 100644
index 0000000000000..5ed5691933902
--- /dev/null
+++ b/libc/test/src/wctype/CMakeLists.txt
@@ -0,0 +1,11 @@
+add_custom_target(libc_wctype_unittests)
+
+add_libc_test(
+ iswalpha_test
+ SUITE
+ libc_wctype_unittests
+ SRCS
+ iswalpha_test.cpp
+ DEPENDS
+ libc.src.wctype.iswalpha
+)
\ No newline at end of file
diff --git a/libc/test/src/wctype/iswalpha_test.cpp b/libc/test/src/wctype/iswalpha_test.cpp
new file mode 100644
index 0000000000000..184f3cfaf7397
--- /dev/null
+++ b/libc/test/src/wctype/iswalpha_test.cpp
@@ -0,0 +1,54 @@
+//===-- Unittests for iswalpha----------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/__support/CPP/span.h"
+#include "src/wctype/iswalpha.h"
+
+#include "test/UnitTest/LibcTest.h"
+#include "test/UnitTest/Test.h"
+
+namespace {
+
+// TODO: Merge the wctype tests using this framework.
+constexpr char WALPHA_ARRAY[] = {
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+};
+
+bool in_span(int ch, LIBC_NAMESPACE::cpp::span<const char> arr) {
+ for (size_t i = 0; i < arr.size(); ++i)
+ if (static_cast<int>(arr[i]) == ch)
+ return true;
+ return false;
+}
+
+} // namespace
+
+TEST(LlvmLibciswalpha, SimpleTest) {
+ EXPECT_TRUE(LIBC_NAMESPACE::iswalpha('a'));
+ EXPECT_TRUE(LIBC_NAMESPACE::iswalpha('B'));
+
+ EXPECT_FALSE(LIBC_NAMESPACE::iswalpha('3'));
+ EXPECT_FALSE(LIBC_NAMESPACE::iswalpha(' '));
+ EXPECT_FALSE(LIBC_NAMESPACE::iswalpha('?'));
+ EXPECT_FALSE(LIBC_NAMESPACE::iswalpha('\0'));
+ EXPECT_FALSE(LIBC_NAMESPACE::iswalpha(-1));
+}
+
+TEST(LlvmLibciswalpha, DefaultLocale) {
+ // Loops through all characters, verifying that letters return
+ // true and everything else returns false.
+ for (int ch = -255; ch < 255; ++ch) {
+ if (in_span(ch, WALPHA_ARRAY))
+ EXPECT_TRUE(LIBC_NAMESPACE::iswalpha(ch));
+ else
+ EXPECT_FALSE(LIBC_NAMESPACE::iswalpha(ch));
+ }
+}
>From c8ea0951864fdc172cf7186caaa07dd890e069b5 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Wed, 16 Jul 2025 16:47:44 -0700
Subject: [PATCH 6/8] format
---
libc/test/src/wctype/iswalpha_test.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/test/src/wctype/iswalpha_test.cpp b/libc/test/src/wctype/iswalpha_test.cpp
index 184f3cfaf7397..f3f75f4dc7aa5 100644
--- a/libc/test/src/wctype/iswalpha_test.cpp
+++ b/libc/test/src/wctype/iswalpha_test.cpp
@@ -1,4 +1,4 @@
-//===-- Unittests for iswalpha----------------------------------------------===//
+//===-- Unittests for iswalpha --------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
>From 948068b3c71d19c3cb1c344da834530765df74e8 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Wed, 16 Jul 2025 16:49:15 -0700
Subject: [PATCH 7/8] format 2
---
libc/src/wctype/iswalpha.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/src/wctype/iswalpha.cpp b/libc/src/wctype/iswalpha.cpp
index 7bd9e894234d6..e18f29370fbd0 100644
--- a/libc/src/wctype/iswalpha.cpp
+++ b/libc/src/wctype/iswalpha.cpp
@@ -1,4 +1,4 @@
-//===-- Implementation of iswcalpha ---------------------------------------===//
+//===-- Implementation of iswalpha ----------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
>From 4ef993b9eca6d734220faac393428f3d03ea12c4 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Thu, 17 Jul 2025 10:26:33 -0700
Subject: [PATCH 8/8] Add entrypoints for other platforms requested in review.
---
libc/config/baremetal/riscv/headers.txt | 1 +
libc/config/darwin/aarch64/entrypoints.txt | 3 +++
libc/config/darwin/aarch64/headers.txt | 1 +
libc/config/linux/aarch64/entrypoints.txt | 3 +++
libc/config/linux/aarch64/headers.txt | 1 +
libc/config/linux/arm/entrypoints.txt | 3 +++
libc/config/linux/arm/headers.txt | 1 +
libc/config/linux/riscv/entrypoints.txt | 3 +++
libc/config/linux/riscv/headers.txt | 1 +
libc/config/linux/x86_64/entrypoints.txt | 2 ++
libc/config/linux/x86_64/headers.txt | 1 +
libc/config/windows/entrypoints.txt | 3 +++
libc/config/windows/headers.txt | 1 +
13 files changed, 24 insertions(+)
diff --git a/libc/config/baremetal/riscv/headers.txt b/libc/config/baremetal/riscv/headers.txt
index 5666ef7e0012d..1f64afebdaaa7 100644
--- a/libc/config/baremetal/riscv/headers.txt
+++ b/libc/config/baremetal/riscv/headers.txt
@@ -23,4 +23,5 @@ set(TARGET_PUBLIC_HEADERS
libc.include.time
libc.include.uchar
libc.include.wchar
+ libc.include.wctype
)
diff --git a/libc/config/darwin/aarch64/entrypoints.txt b/libc/config/darwin/aarch64/entrypoints.txt
index 4674a9309115b..3bfdcdbee555e 100644
--- a/libc/config/darwin/aarch64/entrypoints.txt
+++ b/libc/config/darwin/aarch64/entrypoints.txt
@@ -99,6 +99,9 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.stdlib.calloc
libc.src.stdlib.realloc
libc.src.stdlib.free
+
+ # wctype.h entrypoints
+ libc.src.wctype.iswalpha
)
if(LLVM_LIBC_FULL_BUILD)
diff --git a/libc/config/darwin/aarch64/headers.txt b/libc/config/darwin/aarch64/headers.txt
index 8f3d6029c9b6a..55a112c0c3ad3 100644
--- a/libc/config/darwin/aarch64/headers.txt
+++ b/libc/config/darwin/aarch64/headers.txt
@@ -11,4 +11,5 @@ set(TARGET_PUBLIC_HEADERS
libc.include.stdlib
libc.include.string
libc.include.strings
+ libc.include.wctype
)
diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index cff5b7f8312d6..b2abebee017d8 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -363,6 +363,9 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.wchar.wcslen
libc.src.wchar.wctob
+ # wctype.h entrypoints
+ libc.src.wctype.iswalpha
+
# sys/uio.h entrypoints
libc.src.sys.uio.writev
libc.src.sys.uio.readv
diff --git a/libc/config/linux/aarch64/headers.txt b/libc/config/linux/aarch64/headers.txt
index 01b0bf36498ce..6d3bc9188583b 100644
--- a/libc/config/linux/aarch64/headers.txt
+++ b/libc/config/linux/aarch64/headers.txt
@@ -57,4 +57,5 @@ set(TARGET_PUBLIC_HEADERS
libc.include.uchar
libc.include.unistd
libc.include.wchar
+ libc.include.wctype
)
diff --git a/libc/config/linux/arm/entrypoints.txt b/libc/config/linux/arm/entrypoints.txt
index a1203cc4991af..5865dc93a9aef 100644
--- a/libc/config/linux/arm/entrypoints.txt
+++ b/libc/config/linux/arm/entrypoints.txt
@@ -191,6 +191,9 @@ set(TARGET_LIBC_ENTRYPOINTS
# sys/time.h entrypoints
libc.src.sys.time.setitimer
libc.src.sys.time.getitimer
+
+ # wctype.h entrypoints
+ libc.src.wctype.iswalpha
)
if(LLVM_LIBC_FULL_BUILD)
diff --git a/libc/config/linux/arm/headers.txt b/libc/config/linux/arm/headers.txt
index 9aabac5dea33c..14c730e2b77b1 100644
--- a/libc/config/linux/arm/headers.txt
+++ b/libc/config/linux/arm/headers.txt
@@ -17,6 +17,7 @@ set(TARGET_PUBLIC_HEADERS
libc.include.strings
libc.include.uchar
libc.include.wchar
+ libc.include.wctype
# Disabled due to epoll_wait syscalls not being available on this platform.
# libc.include.sys_epoll
diff --git a/libc/config/linux/riscv/entrypoints.txt b/libc/config/linux/riscv/entrypoints.txt
index 14361f5b6beff..79077a5e66ef5 100644
--- a/libc/config/linux/riscv/entrypoints.txt
+++ b/libc/config/linux/riscv/entrypoints.txt
@@ -368,6 +368,9 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.wchar.wcslen
libc.src.wchar.wctob
+ # wctype.h entrypoints
+ libc.src.wctype.iswalpha
+
# sys/uio.h entrypoints
libc.src.sys.uio.writev
libc.src.sys.uio.readv
diff --git a/libc/config/linux/riscv/headers.txt b/libc/config/linux/riscv/headers.txt
index 01b0bf36498ce..6d3bc9188583b 100644
--- a/libc/config/linux/riscv/headers.txt
+++ b/libc/config/linux/riscv/headers.txt
@@ -57,4 +57,5 @@ set(TARGET_PUBLIC_HEADERS
libc.include.uchar
libc.include.unistd
libc.include.wchar
+ libc.include.wctype
)
diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index 9223911f04a93..381359cec6f1d 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -396,6 +396,8 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.wchar.wcstoul
libc.src.wchar.wcstoull
+ # wctype.h entrypoints
+ libc.src.wctype.iswalpha
# sys/uio.h entrypoints
libc.src.sys.uio.writev
diff --git a/libc/config/linux/x86_64/headers.txt b/libc/config/linux/x86_64/headers.txt
index 01b0bf36498ce..6d3bc9188583b 100644
--- a/libc/config/linux/x86_64/headers.txt
+++ b/libc/config/linux/x86_64/headers.txt
@@ -57,4 +57,5 @@ set(TARGET_PUBLIC_HEADERS
libc.include.uchar
libc.include.unistd
libc.include.wchar
+ libc.include.wctype
)
diff --git a/libc/config/windows/entrypoints.txt b/libc/config/windows/entrypoints.txt
index 8898fd74c302f..18027298acc18 100644
--- a/libc/config/windows/entrypoints.txt
+++ b/libc/config/windows/entrypoints.txt
@@ -105,6 +105,9 @@ set(TARGET_LIBC_ENTRYPOINTS
# unistd.h entrypoints
libc.src.unistd.getentropy
+
+ # wctype.h entrypoints
+ libc.src.wctype.iswalpha
)
set(TARGET_LIBM_ENTRYPOINTS
diff --git a/libc/config/windows/headers.txt b/libc/config/windows/headers.txt
index 6d9aae9276924..d4a0947d867bb 100644
--- a/libc/config/windows/headers.txt
+++ b/libc/config/windows/headers.txt
@@ -7,4 +7,5 @@ set(TARGET_PUBLIC_HEADERS
libc.include.fenv
libc.include.math
libc.include.unistd
+ libc.include.wctype
)
More information about the libc-commits
mailing list