Changes in this patch series:
- fix inconsistent behavior of `iswctype` with _BLANK character class constant
- add support for "blank" character class in mingw-w64's `wctype` function,
making it C99 conformant
- fix inconsistent behavior of is[w]print for TAB character
- add tests to verify that [w]ctype.h functions provided by mingw-w64 are
conforming to POSIX
- add test to verify that `iswctype` is consistent with class-specific
functions such as `iswprint`
- provide POSIX-conforming `towctrans` for msvcr120.dll and UCRT
- add test to verify that `towctrans` is consistent with tow{lower,upper}
functions and conforms to POSIX
- move source files for [w]ctype.h functions to their own subdirectory
GitHub CI run: https://github.com/maiddaisuki/mingw-w64/actions/runs/21772396140
All added tests are based on similar tests in my posix32 library, I just
removed references to posix32's internals.
- Kirill Makurin
From fc93cb426e91302c9a634ac17b41cb3ba722599a Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:02:33 +0900
Subject: [PATCH 01/13] crt: replace iswctype function for all CRTs
CRT's `iswctype` mishandles TAB character when passed `wctype_t` argument
contains `_BLANK` bit; see iswctype.c for behavior summary.
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/Makefile.am | 1 +
.../api-ms-win-crt-string-l1-1-0.def | 2 +-
mingw-w64-crt/lib-common/msvcr120_app.def.in | 2 +-
mingw-w64-crt/lib-common/msvcrt.def.in | 2 +-
.../lib-common/ucrtbase-common.def.in | 2 +-
mingw-w64-crt/lib32/crtdll.def.in | 2 +-
mingw-w64-crt/lib32/msvcr100.def.in | 2 +-
mingw-w64-crt/lib32/msvcr100d.def.in | 2 +-
mingw-w64-crt/lib32/msvcr110.def.in | 2 +-
mingw-w64-crt/lib32/msvcr110d.def.in | 2 +-
mingw-w64-crt/lib32/msvcr120.def.in | 2 +-
mingw-w64-crt/lib32/msvcr120d.def.in | 2 +-
mingw-w64-crt/lib32/msvcr40d.def.in | 2 +-
mingw-w64-crt/lib32/msvcr70.def.in | 2 +-
mingw-w64-crt/lib32/msvcr70d.def.in | 2 +-
mingw-w64-crt/lib32/msvcr71.def.in | 2 +-
mingw-w64-crt/lib32/msvcr71d.def.in | 2 +-
mingw-w64-crt/lib32/msvcr80.def.in | 2 +-
mingw-w64-crt/lib32/msvcr80d.def.in | 2 +-
mingw-w64-crt/lib32/msvcr90.def.in | 2 +-
mingw-w64-crt/lib32/msvcr90d.def.in | 2 +-
mingw-w64-crt/lib32/msvcrt10.def.in | 2 +-
mingw-w64-crt/lib32/msvcrt20.def.in | 2 +-
mingw-w64-crt/lib32/msvcrt40.def.in | 2 +-
mingw-w64-crt/lib32/msvcrtd.def.in | 2 +-
mingw-w64-crt/lib64/msvcr100.def.in | 2 +-
mingw-w64-crt/lib64/msvcr100d.def.in | 2 +-
mingw-w64-crt/lib64/msvcr110.def.in | 2 +-
mingw-w64-crt/lib64/msvcr110d.def.in | 2 +-
mingw-w64-crt/lib64/msvcr120.def.in | 2 +-
mingw-w64-crt/lib64/msvcr120d.def.in | 2 +-
mingw-w64-crt/lib64/msvcr80.def.in | 2 +-
mingw-w64-crt/lib64/msvcr80d.def.in | 2 +-
mingw-w64-crt/lib64/msvcr90.def.in | 2 +-
mingw-w64-crt/lib64/msvcr90d.def.in | 2 +-
mingw-w64-crt/libarm32/msvcr110.def.in | 2 +-
mingw-w64-crt/libarm32/msvcr110d.def.in | 2 +-
mingw-w64-crt/libarm32/msvcr120.def.in | 2 +-
mingw-w64-crt/libarm32/msvcr120d.def.in | 2 +-
mingw-w64-crt/misc/iswctype.c | 43 +++++++++++++++++++
40 files changed, 82 insertions(+), 38 deletions(-)
create mode 100644 mingw-w64-crt/misc/iswctype.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index d67dc49a2..a6c593ab8 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -1264,6 +1264,7 @@ src_libmingwex=\
misc/strsafe.c \
misc/tdelete.c misc/tdestroy.c misc/tfind.c \
misc/tsearch.c misc/twalk.c \
+ misc/iswctype.c \
misc/wcstof.c \
misc/wcstold.c \
misc/wdirent.c misc/winbs_uint64.c misc/winbs_ulong.c
misc/winbs_ushort.c \
diff --git a/mingw-w64-crt/lib-common/api-ms-win-crt-string-l1-1-0.def
b/mingw-w64-crt/lib-common/api-ms-win-crt-string-l1-1-0.def
index ebf681501..18292ae5a 100644
--- a/mingw-w64-crt/lib-common/api-ms-win-crt-string-l1-1-0.def
+++ b/mingw-w64-crt/lib-common/api-ms-win-crt-string-l1-1-0.def
@@ -147,7 +147,7 @@ iswalpha
iswascii
iswblank
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype ; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in
b/mingw-w64-crt/lib-common/msvcr120_app.def.in
index 63cea1a7a..4fa8540ee 100644
--- a/mingw-w64-crt/lib-common/msvcr120_app.def.in
+++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in
@@ -2069,7 +2069,7 @@ iswalpha
iswascii
iswblank
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in
b/mingw-w64-crt/lib-common/msvcrt.def.in
index a4343bb76..2cd26c9f8 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -1007,7 +1007,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib-common/ucrtbase-common.def.in
b/mingw-w64-crt/lib-common/ucrtbase-common.def.in
index 4f705bd65..8437cad2e 100644
--- a/mingw-w64-crt/lib-common/ucrtbase-common.def.in
+++ b/mingw-w64-crt/lib-common/ucrtbase-common.def.in
@@ -2424,7 +2424,7 @@ iswalpha
iswascii
iswblank
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype ; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/crtdll.def.in
b/mingw-w64-crt/lib32/crtdll.def.in
index 140bd3428..b76b7c791 100644
--- a/mingw-w64-crt/lib32/crtdll.def.in
+++ b/mingw-w64-crt/lib32/crtdll.def.in
@@ -400,7 +400,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype ; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr100.def.in
b/mingw-w64-crt/lib32/msvcr100.def.in
index 52cfe900f..a5c1d9d8c 100644
--- a/mingw-w64-crt/lib32/msvcr100.def.in
+++ b/mingw-w64-crt/lib32/msvcr100.def.in
@@ -1734,7 +1734,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr100d.def.in
b/mingw-w64-crt/lib32/msvcr100d.def.in
index 357e379c1..5881ef843 100644
--- a/mingw-w64-crt/lib32/msvcr100d.def.in
+++ b/mingw-w64-crt/lib32/msvcr100d.def.in
@@ -1800,7 +1800,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr110.def.in
b/mingw-w64-crt/lib32/msvcr110.def.in
index 210809f32..2dd9e2c21 100644
--- a/mingw-w64-crt/lib32/msvcr110.def.in
+++ b/mingw-w64-crt/lib32/msvcr110.def.in
@@ -1866,7 +1866,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr110d.def.in
b/mingw-w64-crt/lib32/msvcr110d.def.in
index fe19620d6..58aace105 100644
--- a/mingw-w64-crt/lib32/msvcr110d.def.in
+++ b/mingw-w64-crt/lib32/msvcr110d.def.in
@@ -1933,7 +1933,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr120.def.in
b/mingw-w64-crt/lib32/msvcr120.def.in
index 1b179c5e8..10b62291b 100644
--- a/mingw-w64-crt/lib32/msvcr120.def.in
+++ b/mingw-w64-crt/lib32/msvcr120.def.in
@@ -2041,7 +2041,7 @@ iswalpha
iswascii
iswblank
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr120d.def.in
b/mingw-w64-crt/lib32/msvcr120d.def.in
index d03181759..11991c1f7 100644
--- a/mingw-w64-crt/lib32/msvcr120d.def.in
+++ b/mingw-w64-crt/lib32/msvcr120d.def.in
@@ -2108,7 +2108,7 @@ iswalpha
iswascii
iswblank
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr40d.def.in
b/mingw-w64-crt/lib32/msvcr40d.def.in
index 71a7b85fa..88309a727 100644
--- a/mingw-w64-crt/lib32/msvcr40d.def.in
+++ b/mingw-w64-crt/lib32/msvcr40d.def.in
@@ -1529,7 +1529,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr70.def.in
b/mingw-w64-crt/lib32/msvcr70.def.in
index 2026a73c5..af020cbcb 100644
--- a/mingw-w64-crt/lib32/msvcr70.def.in
+++ b/mingw-w64-crt/lib32/msvcr70.def.in
@@ -779,7 +779,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr70d.def.in
b/mingw-w64-crt/lib32/msvcr70d.def.in
index f126df2e0..19610eedd 100644
--- a/mingw-w64-crt/lib32/msvcr70d.def.in
+++ b/mingw-w64-crt/lib32/msvcr70d.def.in
@@ -823,7 +823,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr71.def.in
b/mingw-w64-crt/lib32/msvcr71.def.in
index 605d5efd2..63d059409 100644
--- a/mingw-w64-crt/lib32/msvcr71.def.in
+++ b/mingw-w64-crt/lib32/msvcr71.def.in
@@ -773,7 +773,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr71d.def.in
b/mingw-w64-crt/lib32/msvcr71d.def.in
index 0414cab73..5beec6e9d 100644
--- a/mingw-w64-crt/lib32/msvcr71d.def.in
+++ b/mingw-w64-crt/lib32/msvcr71d.def.in
@@ -817,7 +817,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr80.def.in
b/mingw-w64-crt/lib32/msvcr80.def.in
index da393b6c0..c62247900 100644
--- a/mingw-w64-crt/lib32/msvcr80.def.in
+++ b/mingw-w64-crt/lib32/msvcr80.def.in
@@ -1373,7 +1373,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr80d.def.in
b/mingw-w64-crt/lib32/msvcr80d.def.in
index 2cd64fee9..65959c4b1 100644
--- a/mingw-w64-crt/lib32/msvcr80d.def.in
+++ b/mingw-w64-crt/lib32/msvcr80d.def.in
@@ -1456,7 +1456,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr90.def.in
b/mingw-w64-crt/lib32/msvcr90.def.in
index bc10a2f91..94d877adb 100644
--- a/mingw-w64-crt/lib32/msvcr90.def.in
+++ b/mingw-w64-crt/lib32/msvcr90.def.in
@@ -1368,7 +1368,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcr90d.def.in
b/mingw-w64-crt/lib32/msvcr90d.def.in
index 3f329d54b..1d5354d43 100644
--- a/mingw-w64-crt/lib32/msvcr90d.def.in
+++ b/mingw-w64-crt/lib32/msvcr90d.def.in
@@ -1440,7 +1440,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcrt10.def.in
b/mingw-w64-crt/lib32/msvcrt10.def.in
index f1cdaab87..3129298fa 100644
--- a/mingw-w64-crt/lib32/msvcrt10.def.in
+++ b/mingw-w64-crt/lib32/msvcrt10.def.in
@@ -1175,7 +1175,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcrt20.def.in
b/mingw-w64-crt/lib32/msvcrt20.def.in
index 1d0e33fab..a61c945f3 100644
--- a/mingw-w64-crt/lib32/msvcrt20.def.in
+++ b/mingw-w64-crt/lib32/msvcrt20.def.in
@@ -1397,7 +1397,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcrt40.def.in
b/mingw-w64-crt/lib32/msvcrt40.def.in
index 811f476d9..83798ed98 100644
--- a/mingw-w64-crt/lib32/msvcrt40.def.in
+++ b/mingw-w64-crt/lib32/msvcrt40.def.in
@@ -1497,7 +1497,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib32/msvcrtd.def.in
b/mingw-w64-crt/lib32/msvcrtd.def.in
index d156ddbdd..80189d28c 100644
--- a/mingw-w64-crt/lib32/msvcrtd.def.in
+++ b/mingw-w64-crt/lib32/msvcrtd.def.in
@@ -723,7 +723,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr100.def.in
b/mingw-w64-crt/lib64/msvcr100.def.in
index 623491391..8db1ba9c9 100644
--- a/mingw-w64-crt/lib64/msvcr100.def.in
+++ b/mingw-w64-crt/lib64/msvcr100.def.in
@@ -1689,7 +1689,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr100d.def.in
b/mingw-w64-crt/lib64/msvcr100d.def.in
index a5ec9c79c..fcb7c7c69 100644
--- a/mingw-w64-crt/lib64/msvcr100d.def.in
+++ b/mingw-w64-crt/lib64/msvcr100d.def.in
@@ -1754,7 +1754,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr110.def.in
b/mingw-w64-crt/lib64/msvcr110.def.in
index 7b45f6cf1..f0b338e7a 100644
--- a/mingw-w64-crt/lib64/msvcr110.def.in
+++ b/mingw-w64-crt/lib64/msvcr110.def.in
@@ -1813,7 +1813,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr110d.def.in
b/mingw-w64-crt/lib64/msvcr110d.def.in
index ca4d10f63..4b65455b7 100644
--- a/mingw-w64-crt/lib64/msvcr110d.def.in
+++ b/mingw-w64-crt/lib64/msvcr110d.def.in
@@ -1878,7 +1878,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr120.def.in
b/mingw-w64-crt/lib64/msvcr120.def.in
index 594f7d390..c6ecd419a 100644
--- a/mingw-w64-crt/lib64/msvcr120.def.in
+++ b/mingw-w64-crt/lib64/msvcr120.def.in
@@ -1987,7 +1987,7 @@ iswalpha
iswascii
iswblank
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr120d.def.in
b/mingw-w64-crt/lib64/msvcr120d.def.in
index e49ddcb46..8d5650f39 100644
--- a/mingw-w64-crt/lib64/msvcr120d.def.in
+++ b/mingw-w64-crt/lib64/msvcr120d.def.in
@@ -2052,7 +2052,7 @@ iswalpha
iswascii
iswblank
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr80.def.in
b/mingw-w64-crt/lib64/msvcr80.def.in
index 8606a4675..1c3ef7ed3 100644
--- a/mingw-w64-crt/lib64/msvcr80.def.in
+++ b/mingw-w64-crt/lib64/msvcr80.def.in
@@ -1311,7 +1311,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr80d.def.in
b/mingw-w64-crt/lib64/msvcr80d.def.in
index 7fc3d1647..db27778ba 100644
--- a/mingw-w64-crt/lib64/msvcr80d.def.in
+++ b/mingw-w64-crt/lib64/msvcr80d.def.in
@@ -1388,7 +1388,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr90.def.in
b/mingw-w64-crt/lib64/msvcr90.def.in
index d22c5b68e..ae716891c 100644
--- a/mingw-w64-crt/lib64/msvcr90.def.in
+++ b/mingw-w64-crt/lib64/msvcr90.def.in
@@ -1309,7 +1309,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/lib64/msvcr90d.def.in
b/mingw-w64-crt/lib64/msvcr90d.def.in
index 52119f3e9..098287136 100644
--- a/mingw-w64-crt/lib64/msvcr90d.def.in
+++ b/mingw-w64-crt/lib64/msvcr90d.def.in
@@ -1375,7 +1375,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/libarm32/msvcr110.def.in
b/mingw-w64-crt/libarm32/msvcr110.def.in
index 6b56dd8ef..b2d948685 100644
--- a/mingw-w64-crt/libarm32/msvcr110.def.in
+++ b/mingw-w64-crt/libarm32/msvcr110.def.in
@@ -1800,7 +1800,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/libarm32/msvcr110d.def.in
b/mingw-w64-crt/libarm32/msvcr110d.def.in
index 8bd6eaa82..7c30d8605 100644
--- a/mingw-w64-crt/libarm32/msvcr110d.def.in
+++ b/mingw-w64-crt/libarm32/msvcr110d.def.in
@@ -1865,7 +1865,7 @@ iswalnum
iswalpha
iswascii
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/libarm32/msvcr120.def.in
b/mingw-w64-crt/libarm32/msvcr120.def.in
index 3b3efdfa9..8baf0acbb 100644
--- a/mingw-w64-crt/libarm32/msvcr120.def.in
+++ b/mingw-w64-crt/libarm32/msvcr120.def.in
@@ -1955,7 +1955,7 @@ iswalpha
iswascii
iswblank
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/libarm32/msvcr120d.def.in
b/mingw-w64-crt/libarm32/msvcr120d.def.in
index 9eee8b10b..c71eaa2ca 100644
--- a/mingw-w64-crt/libarm32/msvcr120d.def.in
+++ b/mingw-w64-crt/libarm32/msvcr120d.def.in
@@ -2020,7 +2020,7 @@ iswalpha
iswascii
iswblank
iswcntrl
-iswctype
+__msvcrt_iswctype DATA == iswctype; mingw-w64 provides real iswctype as a
wrapper around renamed __msvcrt_iswctype
iswdigit
iswgraph
iswlower
diff --git a/mingw-w64-crt/misc/iswctype.c b/mingw-w64-crt/misc/iswctype.c
new file mode 100644
index 000000000..c17733496
--- /dev/null
+++ b/mingw-w64-crt/misc/iswctype.c
@@ -0,0 +1,43 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#define _CTYPE_DISABLE_MACROS
+#include <wctype.h>
+
+/**
+ * CRT's `iswctype` has inconsistent behavior for TAB character when used with
+ * `wctype_t` objects returned by `wctype` function which contain `_BLANK` bit.
+ *
+ * In all CRTs up to msvcrt.dll version 6.1, it returns zero in "C" locale
+ * and non-zero otherwise.
+ *
+ * Since msvcr70.dll up to msvcr110.dll it always returns non-zero;
+ * OS-specific versions of msvcrt.dll follow this behavior.
+ *
+ * In msvcr120.dll and UCRT it always returns zero.
+ *
+ * This behavior affects both `iswblank` and `iswprint` functions;
+ * either or both of them have non-conforming behavior.
+ */
+
+/**
+ * This is CRT's `iswctype` renamed to `__msvcrt_iswctype`.
+ */
+extern int (__cdecl *__MINGW_IMP_SYMBOL(__msvcrt_iswctype)) (wint_t, wctype_t);
+
+int iswctype (wint_t _C, wctype_t _Type) {
+ /**
+ * `wctype_t` object returned for "print" character class contains _BLANK;
+ * make sure TAB is handled correctly.
+ */
+ if (_C == L'\t' && (_Type & _BLANK)) {
+ return (_Type == _BLANK ? _BLANK : 0);
+ }
+
+ return __MINGW_IMP_SYMBOL (__msvcrt_iswctype) (_C, _Type);
+}
+
+int (__cdecl *__MINGW_IMP_SYMBOL (iswctype)) (wint_t, wctype_t) = iswctype;
--
2.51.0.windows.1
From 7b792b84a78ca7c1bdd64444ada380d49bda9462 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:03:27 +0900
Subject: [PATCH 02/13] crt: tidy-up wctype.c
Fix inconsistent use of tabs and spaces in the comments.
Remove trailing whitespace.
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/misc/wctype.c | 44 ++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/mingw-w64-crt/misc/wctype.c b/mingw-w64-crt/misc/wctype.c
index 0a325b58a..1b3a3f82d 100644
--- a/mingw-w64-crt/misc/wctype.c
+++ b/mingw-w64-crt/misc/wctype.c
@@ -8,10 +8,10 @@
7.25.2.2.2 The wctype function
Contributed by: Danny Smith <[email protected]>
- 2005-02-24
-
+ 2005-02-24
+
This source code is placed in the PUBLIC DOMAIN. It is modified
- from the Q8 package created by Doug Gwyn <[email protected]>
+ from the Q8 package created by Doug Gwyn <[email protected]>
The wctype function constructs a value with type wctype_t that
describes a class of wide characters identified by the string
@@ -19,7 +19,7 @@
In particular, we map the property strings so that:
- iswctype(wc, wctype("alnum")) == iswalnum(wc)
+ iswctype(wc, wctype("alnum")) == iswalnum(wc)
iswctype(wc, wctype("alpha")) == iswalpha(wc)
iswctype(wc, wctype("cntrl")) == iswcntrl(wc)
iswctype(wc, wctype("digit")) == iswdigit(wc)
@@ -30,35 +30,35 @@
iswctype(wc, wctype("space")) == iswspace(wc)
iswctype(wc, wctype("upper")) == iswupper(wc)
iswctype(wc, wctype("xdigit")) == iswxdigit(wc)
-
*/
-#include <string.h>
-#include <wctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wctype.h>
/* Using the bit-OR'd ctype character classification flags as return
values achieves compatibility with MS iswctype(). */
static const struct {
const char *name;
- wctype_t flags;} cmap[] = {
- {"alnum", _ALPHA|_DIGIT},
- {"alpha", _ALPHA},
- {"cntrl", _CONTROL},
- {"digit", _DIGIT},
- {"graph", _PUNCT|_ALPHA|_DIGIT},
- {"lower", _LOWER},
- {"print", _BLANK|_PUNCT|_ALPHA|_DIGIT},
- {"punct", _PUNCT},
- {"space", _SPACE},
- {"upper", _UPPER},
- {"xdigit", _HEX}
- };
+ wctype_t flags;
+} cmap[] = {
+ {"alnum", _ALPHA|_DIGIT},
+ {"alpha", _ALPHA},
+ {"cntrl", _CONTROL},
+ {"digit", _DIGIT},
+ {"graph", _ALPHA|_DIGIT|_PUNCT},
+ {"lower", _LOWER},
+ {"print", _ALPHA|_BLANK|_DIGIT|_PUNCT},
+ {"punct", _PUNCT},
+ {"space", _SPACE},
+ {"upper", _UPPER},
+ {"xdigit", _HEX}
+};
-#define NCMAP (sizeof cmap / sizeof cmap[0])
wctype_t wctype (const char *property)
{
int i;
- for (i = 0; i < (int) NCMAP; ++i)
+ for (i = 0; i < (int) _countof (cmap); ++i)
if (strcmp (property, cmap[i].name) == 0)
return cmap[i].flags;
return 0;
--
2.51.0.windows.1
From acdcfd8090b2270f7e8f756fc7ea676ff429fbb3 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:04:00 +0900
Subject: [PATCH 03/13] crt: wctype: add support for "blank" character class
Add support for "blank" character class to provide C99 conforming implementaion
of `wctype` function for all CRTs up to msvcr110.dll; msvcr120.dll and UCRT
provide C99 conforming `wctype` function.
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/misc/wctype.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mingw-w64-crt/misc/wctype.c b/mingw-w64-crt/misc/wctype.c
index 1b3a3f82d..f7ad8ed04 100644
--- a/mingw-w64-crt/misc/wctype.c
+++ b/mingw-w64-crt/misc/wctype.c
@@ -21,6 +21,7 @@
iswctype(wc, wctype("alnum")) == iswalnum(wc)
iswctype(wc, wctype("alpha")) == iswalpha(wc)
+ iswctype(wc, wctype("blank")) == iswblank(wc)
iswctype(wc, wctype("cntrl")) == iswcntrl(wc)
iswctype(wc, wctype("digit")) == iswdigit(wc)
iswctype(wc, wctype("graph")) == iswgraph(wc)
@@ -44,6 +45,7 @@ static const struct {
} cmap[] = {
{"alnum", _ALPHA|_DIGIT},
{"alpha", _ALPHA},
+ {"blank", _BLANK},
{"cntrl", _CONTROL},
{"digit", _DIGIT},
{"graph", _ALPHA|_DIGIT|_PUNCT},
--
2.51.0.windows.1
From 29de66b1ccc66eb2db4618b88ed46fd503da03f0 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:04:32 +0900
Subject: [PATCH 04/13] crt: iswblank: remove explicit check for L'\t'
mingw-w64 now provides `iswctype` function which properly handles TAB character;
this allows to remove explicit check for L'\t' in both library and macro
versions of `iswblank` function.
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/misc/iswblank.c | 6 +++++-
mingw-w64-headers/crt/corecrt_wctype.h | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/mingw-w64-crt/misc/iswblank.c b/mingw-w64-crt/misc/iswblank.c
index dc48c297f..7db31de39 100644
--- a/mingw-w64-crt/misc/iswblank.c
+++ b/mingw-w64-crt/misc/iswblank.c
@@ -3,6 +3,10 @@
int __cdecl iswblank (wint_t _C)
{
- return (iswctype(_C, _BLANK) || _C == '\t');
+ /**
+ * mingw-w64's `iswctype` is a wrapper around CRT's `iswctype` which
+ * properly handles TAB character.
+ */
+ return iswctype (_C, _BLANK);
}
int (__cdecl *__MINGW_IMP_SYMBOL(iswblank))(wint_t) = iswblank;
diff --git a/mingw-w64-headers/crt/corecrt_wctype.h
b/mingw-w64-headers/crt/corecrt_wctype.h
index 33798b2ba..bed41be36 100644
--- a/mingw-w64-headers/crt/corecrt_wctype.h
+++ b/mingw-w64-headers/crt/corecrt_wctype.h
@@ -77,7 +77,7 @@ _CRTIMP wint_t __cdecl towupper(wint_t _C);
#if !defined(_CTYPE_DISABLE_MACROS) && !defined(__cplusplus)
#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT))
#define iswalpha(_c) (iswctype(_c,_ALPHA))
-#define iswblank(_c) (((_c) == '\t') || iswctype(_c,_BLANK))
+#define iswblank(_c) (iswctype(_c,_BLANK))
#define iswcntrl(_c) (iswctype(_c,_CONTROL))
#define iswdigit(_c) (iswctype(_c,_DIGIT))
#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
--
2.51.0.windows.1
From 90db7c562906cb7bbd3387177ca4acb522780ee0 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:05:10 +0900
Subject: [PATCH 05/13] crt: isblank.c: document _isctype ('\t', _BLANK)
behavior among CRTs
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/misc/isblank.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mingw-w64-crt/misc/isblank.c b/mingw-w64-crt/misc/isblank.c
index 010805af9..a45ecbaad 100644
--- a/mingw-w64-crt/misc/isblank.c
+++ b/mingw-w64-crt/misc/isblank.c
@@ -1,6 +1,13 @@
#define _CTYPE_DISABLE_MACROS
#include <ctype.h>
+/**
+ * Calls to `_isctype ('\t', _BLANK)` return inconsistent results
+ * depending on CRT and active locale.
+ *
+ * In all CRTs it returns zero in "C" locale and non-zero otherwise.
+ */
+
int __cdecl isblank (int _C)
{
return (_isctype(_C, _BLANK) || _C == '\t');
--
2.51.0.windows.1
From 71f5417b9ffca5e94184b871851f82aaefaf0395 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:08:37 +0900
Subject: [PATCH 06/13] crt: replace is[w]print functions for
crtdll.dll...msvcr110.dll
CRT's iw[w]print functions return inconsistent results for TAB character.
See comments in isprint.c and iswprint.c for behavior summary.
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/Makefile.am | 4 ++++
mingw-w64-crt/lib-common/msvcrt.def.in | 4 ++--
mingw-w64-crt/lib32/crtdll.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr100.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr100d.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr110.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr110d.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr40d.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr70.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr70d.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr71.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr71d.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr80.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr80d.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr90.def.in | 4 ++--
mingw-w64-crt/lib32/msvcr90d.def.in | 4 ++--
mingw-w64-crt/lib32/msvcrt10.def.in | 4 ++--
mingw-w64-crt/lib32/msvcrt20.def.in | 4 ++--
mingw-w64-crt/lib32/msvcrt40.def.in | 4 ++--
mingw-w64-crt/lib32/msvcrtd.def.in | 4 ++--
mingw-w64-crt/lib64/msvcr100.def.in | 4 ++--
mingw-w64-crt/lib64/msvcr100d.def.in | 4 ++--
mingw-w64-crt/lib64/msvcr110.def.in | 4 ++--
mingw-w64-crt/lib64/msvcr110d.def.in | 4 ++--
mingw-w64-crt/lib64/msvcr80.def.in | 4 ++--
mingw-w64-crt/lib64/msvcr80d.def.in | 4 ++--
mingw-w64-crt/lib64/msvcr90.def.in | 4 ++--
mingw-w64-crt/lib64/msvcr90d.def.in | 4 ++--
mingw-w64-crt/libarm32/msvcr110.def.in | 4 ++--
mingw-w64-crt/libarm32/msvcr110d.def.in | 4 ++--
mingw-w64-crt/misc/isprint.c | 28 ++++++++++++++++++++++
mingw-w64-crt/misc/iswprint.c | 31 +++++++++++++++++++++++++
32 files changed, 121 insertions(+), 58 deletions(-)
create mode 100644 mingw-w64-crt/misc/isprint.c
create mode 100644 mingw-w64-crt/misc/iswprint.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index a6c593ab8..978294e7d 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -358,7 +358,9 @@ src_msvcrt=\
misc/imaxdiv.c \
misc/invalid_parameter_handler.c \
misc/isblank.c \
+ misc/isprint.c \
misc/iswblank.c \
+ misc/iswprint.c \
misc/_isblank_l.c \
misc/_iswblank_l.c \
misc/wctrans.c \
@@ -1035,7 +1037,9 @@ src_pre_msvcr120=\
$(src_msvcrt_add_vscanf) \
math/i386__copysignf.c \
misc/isblank.c \
+ misc/isprint.c \
misc/iswblank.c \
+ misc/iswprint.c \
misc/wctrans.c \
misc/wctype.c \
stdio/scanf.S
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in
b/mingw-w64-crt/lib-common/msvcrt.def.in
index 2cd26c9f8..500d076e4 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -999,7 +999,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1011,7 +1011,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/crtdll.def.in
b/mingw-w64-crt/lib32/crtdll.def.in
index b76b7c791..0062013e4 100644
--- a/mingw-w64-crt/lib32/crtdll.def.in
+++ b/mingw-w64-crt/lib32/crtdll.def.in
@@ -392,7 +392,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -404,7 +404,7 @@ __msvcrt_iswctype DATA == iswctype ; mingw-w64 provides
real iswctype as a wrapp
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr100.def.in
b/mingw-w64-crt/lib32/msvcr100.def.in
index a5c1d9d8c..50d31699a 100644
--- a/mingw-w64-crt/lib32/msvcr100.def.in
+++ b/mingw-w64-crt/lib32/msvcr100.def.in
@@ -1726,7 +1726,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1738,7 +1738,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr100d.def.in
b/mingw-w64-crt/lib32/msvcr100d.def.in
index 5881ef843..ee5717d07 100644
--- a/mingw-w64-crt/lib32/msvcr100d.def.in
+++ b/mingw-w64-crt/lib32/msvcr100d.def.in
@@ -1792,7 +1792,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1804,7 +1804,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr110.def.in
b/mingw-w64-crt/lib32/msvcr110.def.in
index 2dd9e2c21..09a7e68bf 100644
--- a/mingw-w64-crt/lib32/msvcr110.def.in
+++ b/mingw-w64-crt/lib32/msvcr110.def.in
@@ -1858,7 +1858,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1870,7 +1870,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr110d.def.in
b/mingw-w64-crt/lib32/msvcr110d.def.in
index 58aace105..3448d40e7 100644
--- a/mingw-w64-crt/lib32/msvcr110d.def.in
+++ b/mingw-w64-crt/lib32/msvcr110d.def.in
@@ -1925,7 +1925,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1937,7 +1937,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr40d.def.in
b/mingw-w64-crt/lib32/msvcr40d.def.in
index 88309a727..73598f89b 100644
--- a/mingw-w64-crt/lib32/msvcr40d.def.in
+++ b/mingw-w64-crt/lib32/msvcr40d.def.in
@@ -1521,7 +1521,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1533,7 +1533,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr70.def.in
b/mingw-w64-crt/lib32/msvcr70.def.in
index af020cbcb..b05ed5a5a 100644
--- a/mingw-w64-crt/lib32/msvcr70.def.in
+++ b/mingw-w64-crt/lib32/msvcr70.def.in
@@ -771,7 +771,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -783,7 +783,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides real
iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr70d.def.in
b/mingw-w64-crt/lib32/msvcr70d.def.in
index 19610eedd..727c05637 100644
--- a/mingw-w64-crt/lib32/msvcr70d.def.in
+++ b/mingw-w64-crt/lib32/msvcr70d.def.in
@@ -815,7 +815,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -827,7 +827,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides real
iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr71.def.in
b/mingw-w64-crt/lib32/msvcr71.def.in
index 63d059409..1175bed84 100644
--- a/mingw-w64-crt/lib32/msvcr71.def.in
+++ b/mingw-w64-crt/lib32/msvcr71.def.in
@@ -765,7 +765,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -777,7 +777,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides real
iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr71d.def.in
b/mingw-w64-crt/lib32/msvcr71d.def.in
index 5beec6e9d..27da9e055 100644
--- a/mingw-w64-crt/lib32/msvcr71d.def.in
+++ b/mingw-w64-crt/lib32/msvcr71d.def.in
@@ -809,7 +809,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -821,7 +821,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides real
iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr80.def.in
b/mingw-w64-crt/lib32/msvcr80.def.in
index c62247900..96db56f4b 100644
--- a/mingw-w64-crt/lib32/msvcr80.def.in
+++ b/mingw-w64-crt/lib32/msvcr80.def.in
@@ -1365,7 +1365,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1377,7 +1377,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr80d.def.in
b/mingw-w64-crt/lib32/msvcr80d.def.in
index 65959c4b1..d39efa4d4 100644
--- a/mingw-w64-crt/lib32/msvcr80d.def.in
+++ b/mingw-w64-crt/lib32/msvcr80d.def.in
@@ -1448,7 +1448,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1460,7 +1460,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr90.def.in
b/mingw-w64-crt/lib32/msvcr90.def.in
index 94d877adb..4e445a6ef 100644
--- a/mingw-w64-crt/lib32/msvcr90.def.in
+++ b/mingw-w64-crt/lib32/msvcr90.def.in
@@ -1360,7 +1360,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1372,7 +1372,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcr90d.def.in
b/mingw-w64-crt/lib32/msvcr90d.def.in
index 1d5354d43..e5f34308e 100644
--- a/mingw-w64-crt/lib32/msvcr90d.def.in
+++ b/mingw-w64-crt/lib32/msvcr90d.def.in
@@ -1432,7 +1432,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1444,7 +1444,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcrt10.def.in
b/mingw-w64-crt/lib32/msvcrt10.def.in
index 3129298fa..768120a9a 100644
--- a/mingw-w64-crt/lib32/msvcrt10.def.in
+++ b/mingw-w64-crt/lib32/msvcrt10.def.in
@@ -1167,7 +1167,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1179,7 +1179,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcrt20.def.in
b/mingw-w64-crt/lib32/msvcrt20.def.in
index a61c945f3..e62d6733b 100644
--- a/mingw-w64-crt/lib32/msvcrt20.def.in
+++ b/mingw-w64-crt/lib32/msvcrt20.def.in
@@ -1389,7 +1389,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1401,7 +1401,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcrt40.def.in
b/mingw-w64-crt/lib32/msvcrt40.def.in
index 83798ed98..5c533e0c2 100644
--- a/mingw-w64-crt/lib32/msvcrt40.def.in
+++ b/mingw-w64-crt/lib32/msvcrt40.def.in
@@ -1489,7 +1489,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1501,7 +1501,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib32/msvcrtd.def.in
b/mingw-w64-crt/lib32/msvcrtd.def.in
index 80189d28c..34b1fcb54 100644
--- a/mingw-w64-crt/lib32/msvcrtd.def.in
+++ b/mingw-w64-crt/lib32/msvcrtd.def.in
@@ -715,7 +715,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -727,7 +727,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides real
iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib64/msvcr100.def.in
b/mingw-w64-crt/lib64/msvcr100.def.in
index 8db1ba9c9..7e70caa86 100644
--- a/mingw-w64-crt/lib64/msvcr100.def.in
+++ b/mingw-w64-crt/lib64/msvcr100.def.in
@@ -1681,7 +1681,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1693,7 +1693,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib64/msvcr100d.def.in
b/mingw-w64-crt/lib64/msvcr100d.def.in
index fcb7c7c69..65ed8c2ca 100644
--- a/mingw-w64-crt/lib64/msvcr100d.def.in
+++ b/mingw-w64-crt/lib64/msvcr100d.def.in
@@ -1746,7 +1746,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1758,7 +1758,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib64/msvcr110.def.in
b/mingw-w64-crt/lib64/msvcr110.def.in
index f0b338e7a..aea6fabe6 100644
--- a/mingw-w64-crt/lib64/msvcr110.def.in
+++ b/mingw-w64-crt/lib64/msvcr110.def.in
@@ -1805,7 +1805,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1817,7 +1817,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib64/msvcr110d.def.in
b/mingw-w64-crt/lib64/msvcr110d.def.in
index 4b65455b7..ee51330b8 100644
--- a/mingw-w64-crt/lib64/msvcr110d.def.in
+++ b/mingw-w64-crt/lib64/msvcr110d.def.in
@@ -1870,7 +1870,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1882,7 +1882,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib64/msvcr80.def.in
b/mingw-w64-crt/lib64/msvcr80.def.in
index 1c3ef7ed3..db1710d34 100644
--- a/mingw-w64-crt/lib64/msvcr80.def.in
+++ b/mingw-w64-crt/lib64/msvcr80.def.in
@@ -1303,7 +1303,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1315,7 +1315,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib64/msvcr80d.def.in
b/mingw-w64-crt/lib64/msvcr80d.def.in
index db27778ba..a28217c94 100644
--- a/mingw-w64-crt/lib64/msvcr80d.def.in
+++ b/mingw-w64-crt/lib64/msvcr80d.def.in
@@ -1380,7 +1380,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1392,7 +1392,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib64/msvcr90.def.in
b/mingw-w64-crt/lib64/msvcr90.def.in
index ae716891c..1bc30455d 100644
--- a/mingw-w64-crt/lib64/msvcr90.def.in
+++ b/mingw-w64-crt/lib64/msvcr90.def.in
@@ -1301,7 +1301,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1313,7 +1313,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/lib64/msvcr90d.def.in
b/mingw-w64-crt/lib64/msvcr90d.def.in
index 098287136..864e0e10d 100644
--- a/mingw-w64-crt/lib64/msvcr90d.def.in
+++ b/mingw-w64-crt/lib64/msvcr90d.def.in
@@ -1367,7 +1367,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1379,7 +1379,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/libarm32/msvcr110.def.in
b/mingw-w64-crt/libarm32/msvcr110.def.in
index b2d948685..d70854050 100644
--- a/mingw-w64-crt/libarm32/msvcr110.def.in
+++ b/mingw-w64-crt/libarm32/msvcr110.def.in
@@ -1792,7 +1792,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1804,7 +1804,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/libarm32/msvcr110d.def.in
b/mingw-w64-crt/libarm32/msvcr110d.def.in
index 7c30d8605..80a3e3029 100644
--- a/mingw-w64-crt/libarm32/msvcr110d.def.in
+++ b/mingw-w64-crt/libarm32/msvcr110d.def.in
@@ -1857,7 +1857,7 @@ isdigit
isgraph
isleadbyte
islower
-isprint
+; isprint ; replaced by emu, CRT version mishandles TAB character
ispunct
isspace
isupper
@@ -1869,7 +1869,7 @@ __msvcrt_iswctype DATA == iswctype; mingw-w64 provides
real iswctype as a wrappe
iswdigit
iswgraph
iswlower
-iswprint
+; iswprint ; replaced by emu, CRT version mishandles TAB character
iswpunct
iswspace
iswupper
diff --git a/mingw-w64-crt/misc/isprint.c b/mingw-w64-crt/misc/isprint.c
new file mode 100644
index 000000000..0b9dfe408
--- /dev/null
+++ b/mingw-w64-crt/misc/isprint.c
@@ -0,0 +1,28 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#define _CTYPE_DISABLE_MACROS
+#include <ctype.h>
+
+/**
+ * Calls to `isprint ('\t')` return inconsistent results depending on CRT
+ * and active locale.
+ *
+ * In all CRTs up to msvcr110.dll, it returns zero in "C" locale
+ * and non-zero otherwise.
+ *
+ * In msvcr120.dll and UCRT, it always returns zero.
+ */
+
+int __cdecl isprint (int _C) {
+ if (_C == '\t') {
+ return 0;
+ }
+
+ return _isctype (_C, _ALPHA | _BLANK | _DIGIT | _PUNCT);
+}
+
+int (__cdecl *__MINGW_IMP_SYMBOL(isprint))(int) = isprint;
diff --git a/mingw-w64-crt/misc/iswprint.c b/mingw-w64-crt/misc/iswprint.c
new file mode 100644
index 000000000..698b766cf
--- /dev/null
+++ b/mingw-w64-crt/misc/iswprint.c
@@ -0,0 +1,31 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#define _CTYPE_DISABLE_MACROS
+#include <wctype.h>
+
+/**
+ * Calls to `iswprint (L'\t')` return inconsistent results depending on CRT
+ * and active locale.
+ *
+ * In all CRTs up to msvcrt.dll version 6.1, it returns zero in "C" locale
+ * and non-zero otherwise.
+ *
+ * Since msvcr70.dll up to msvcr110.dll, it always returns non-zero;
+ * OS-specific versions of msvcrt.dll follow this behavior.
+ *
+ * In msvcr120.dll and UCRT, it always returns zero.
+ */
+
+int __cdecl iswprint (wint_t _C) {
+ /**
+ * mingw-w64's `iswctype` is a wrapper around CRT's `iswctype` which
+ * properly handles TAB character.
+ */
+ return iswctype (_C, _ALPHA | _BLANK | _DIGIT | _PUNCT);
+}
+
+int (__cdecl *__MINGW_IMP_SYMBOL(iswprint))(wint_t) = iswprint;
--
2.51.0.windows.1
From 3cd0365d84ac242f709008d461a830e6dced3f11 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:09:45 +0900
Subject: [PATCH 07/13] crt: add tests for standard C functions declared in
[w]ctype.h
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/testcases/Makefile.am | 2 +
mingw-w64-crt/testcases/ctype-test.h | 294 +++++++++++++++++++++++++++
mingw-w64-crt/testcases/t_ctype.c | 39 ++++
mingw-w64-crt/testcases/t_wctype.c | 39 ++++
4 files changed, 374 insertions(+)
create mode 100644 mingw-w64-crt/testcases/ctype-test.h
create mode 100644 mingw-w64-crt/testcases/t_ctype.c
create mode 100644 mingw-w64-crt/testcases/t_wctype.c
diff --git a/mingw-w64-crt/testcases/Makefile.am
b/mingw-w64-crt/testcases/Makefile.am
index 5fceb0eac..8f02b1d4c 100644
--- a/mingw-w64-crt/testcases/Makefile.am
+++ b/mingw-w64-crt/testcases/Makefile.am
@@ -21,6 +21,7 @@ testcase_progs = \
t_ansi_io \
t_assert \
t_btowc \
+ t_ctype \
t_findfirst \
t_float \
t_fseeki64 \
@@ -77,6 +78,7 @@ testcase_progs = \
t_wcsrtombs \
t_wcstok_s \
t_wctob \
+ t_wctype \
t_wreaddir \
t_fseeko64
diff --git a/mingw-w64-crt/testcases/ctype-test.h
b/mingw-w64-crt/testcases/ctype-test.h
new file mode 100644
index 000000000..b31e1ef5d
--- /dev/null
+++ b/mingw-w64-crt/testcases/ctype-test.h
@@ -0,0 +1,294 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#define CHARTYPE_BIT_ALNUM (1)
+#define CHARTYPE_BIT_ALPHA (1 << 1)
+#define CHARTYPE_BIT_BLANK (1 << 2)
+#define CHARTYPE_BIT_CONTROL (1 << 3)
+#define CHARTYPE_BIT_DIGIT (1 << 4)
+#define CHARTYPE_BIT_GRAPH (1 << 5)
+#define CHARTYPE_BIT_LOWER (1 << 6)
+#define CHARTYPE_BIT_PRINT (1 << 7)
+#define CHARTYPE_BIT_PUNCT (1 << 8)
+#define CHARTYPE_BIT_SPACE (1 << 9)
+#define CHARTYPE_BIT_UPPER (1 << 10)
+#define CHARTYPE_BIT_XDIGIT (1 << 11)
+
+#define CHARTYPE_ALNUM (CHARTYPE_BIT_ALNUM)
+#define CHARTYPE_ALPHA (CHARTYPE_BIT_ALPHA | CHARTYPE_ALNUM)
+#define CHARTYPE_BLANK (CHARTYPE_BIT_BLANK)
+#define CHARTYPE_CONTROL (CHARTYPE_BIT_CONTROL)
+#define CHARTYPE_DIGIT (CHARTYPE_BIT_DIGIT | CHARTYPE_ALNUM)
+#define CHARTYPE_GRAPH (CHARTYPE_BIT_GRAPH | CHARTYPE_PRINT)
+#define CHARTYPE_LOWER (CHARTYPE_BIT_LOWER | CHARTYPE_ALPHA)
+#define CHARTYPE_PRINT (CHARTYPE_BIT_PRINT)
+#define CHARTYPE_PUNCT (CHARTYPE_BIT_PUNCT)
+#define CHARTYPE_SPACE (CHARTYPE_BIT_SPACE)
+#define CHARTYPE_UPPER (CHARTYPE_BIT_UPPER | CHARTYPE_ALPHA)
+#define CHARTYPE_XDIGIT (CHARTYPE_BIT_XDIGIT)
+
+struct {
+ wctype_t CharType;
+ int Lower;
+ int Upper;
+} CharTypeTable[] = {
+ // NUL
+ {(CHARTYPE_CONTROL), 0x00, 0x00},
+ // SOH
+ {(CHARTYPE_CONTROL), 0x01, 0x01},
+ // STX
+ {(CHARTYPE_CONTROL), 0x02, 0x02},
+ // ETX
+ {(CHARTYPE_CONTROL), 0x03, 0x03},
+ // EOT
+ {(CHARTYPE_CONTROL), 0x04, 0x04},
+ // ENQ
+ {(CHARTYPE_CONTROL), 0x05, 0x05},
+ // ACK
+ {(CHARTYPE_CONTROL), 0x06, 0x06},
+ // bell
+ {(CHARTYPE_CONTROL), 0x07, 0x07},
+ // backspace
+ {(CHARTYPE_CONTROL), 0x08, 0x08},
+ // TAB
+ {(CHARTYPE_BLANK | CHARTYPE_CONTROL | CHARTYPE_SPACE), 0x09, 0x09},
+ // LF
+ {(CHARTYPE_CONTROL | CHARTYPE_SPACE), 0x0A, 0x0A},
+ // vertical tab
+ {(CHARTYPE_CONTROL | CHARTYPE_SPACE), 0x0B, 0x0B},
+ // form feed
+ {(CHARTYPE_CONTROL | CHARTYPE_SPACE), 0x0C, 0x0C},
+ // CR
+ {(CHARTYPE_CONTROL | CHARTYPE_SPACE), 0x0D, 0x0D},
+ // SO
+ {(CHARTYPE_CONTROL), 0x0E, 0x0E},
+ // SI
+ {(CHARTYPE_CONTROL), 0x0F, 0x0F},
+ // DLE
+ {(CHARTYPE_CONTROL), 0x10, 0x10},
+ // DC1
+ {(CHARTYPE_CONTROL), 0x11, 0x11},
+ // DC2
+ {(CHARTYPE_CONTROL), 0x12, 0x12},
+ // DC3
+ {(CHARTYPE_CONTROL), 0x13, 0x13},
+ // DC4
+ {(CHARTYPE_CONTROL), 0x14, 0x14},
+ // NAK
+ {(CHARTYPE_CONTROL), 0x15, 0x15},
+ // SYN
+ {(CHARTYPE_CONTROL), 0x16, 0x16},
+ // ETB
+ {(CHARTYPE_CONTROL), 0x17, 0x17},
+ // CAN
+ {(CHARTYPE_CONTROL), 0x18, 0x18},
+ // EM
+ {(CHARTYPE_CONTROL), 0x19, 0x19},
+ // SUB
+ {(CHARTYPE_CONTROL), 0x1A, 0x1A},
+ // ESC
+ {(CHARTYPE_CONTROL), 0x1B, 0x1B},
+ // IS4
+ {(CHARTYPE_CONTROL), 0x1C, 0x1C},
+ // IS3
+ {(CHARTYPE_CONTROL), 0x1D, 0x1D},
+ // IS2
+ {(CHARTYPE_CONTROL), 0x1E, 0x1E},
+ // IS1
+ {(CHARTYPE_CONTROL), 0x1F, 0x1F},
+ // space
+ {(CHARTYPE_BLANK | CHARTYPE_PRINT | CHARTYPE_SPACE), 0x20, 0x20},
+ // !
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x21, 0x21},
+ // "
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x22, 0x22},
+ // #
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x23, 0x23},
+ // $
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x24, 0x24},
+ // %
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x25, 0x25},
+ // &
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x26, 0x26},
+ // '
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x27, 0x27},
+ // (
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x28, 0x28},
+ // )
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x29, 0x29},
+ // *
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x2A, 0x2A},
+ // +
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x2B, 0x2B},
+ // ,
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x2C, 0x2C},
+ // -
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x2D, 0x2D},
+ // .
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x2E, 0x2E},
+ // /
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x2F, 0x2F},
+ // 0
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x30, 0x30},
+ // 1
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x31, 0x31},
+ // 2
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x32, 0x32},
+ // 3
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x33, 0x33},
+ // 4
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x34, 0x34},
+ // 5
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x35, 0x35},
+ // 6
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x36, 0x36},
+ // 7
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x37, 0x37},
+ // 8
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x38, 0x38},
+ // 9
+ {(CHARTYPE_DIGIT | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x39, 0x39},
+ // :
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x3A, 0x3A},
+ // ;
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x3B, 0x3B},
+ // <
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x3C, 0x3C},
+ // =
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x3D, 0x3D},
+ // >
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x3E, 0x3E},
+ // ?
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x3F, 0x3F},
+ // @
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x40, 0x40},
+ // A
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x61, 0x41},
+ // B
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x62, 0x42},
+ // C
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x63, 0x43},
+ // D
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x64, 0x44},
+ // E
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x65, 0x45},
+ // F
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x66, 0x46},
+ // G
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x67, 0x47},
+ // H
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x68, 0x48},
+ // I
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x69, 0x49},
+ // J
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x6A, 0x4A},
+ // K
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x6B, 0x4B},
+ // L
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x6C, 0x4C},
+ // M
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x6D, 0x4D},
+ // N
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x6E, 0x4E},
+ // O
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x6F, 0x4F},
+ // P
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x70, 0x50},
+ // Q
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x71, 0x51},
+ // R
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x72, 0x52},
+ // S
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x73, 0x53},
+ // T
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x74, 0x54},
+ // U
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x75, 0x55},
+ // V
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x76, 0x56},
+ // W
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x77, 0x57},
+ // X
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x78, 0x58},
+ // Y
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x79, 0x59},
+ // Z
+ {(CHARTYPE_UPPER | CHARTYPE_GRAPH), 0x7A, 0x5A},
+ // [
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x5B, 0x5B},
+ // '\'
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x5C, 0x5C},
+ // ]
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x5D, 0x5D},
+ // ^
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x5E, 0x5E},
+ // _
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x5F, 0x5F},
+ // `
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x60, 0x60},
+ // a
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x61, 0x41},
+ // b
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x62, 0x42},
+ // c
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x63, 0x43},
+ // d
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x64, 0x44},
+ // e
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x65, 0x45},
+ // f
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH | CHARTYPE_XDIGIT), 0x66, 0x46},
+ // g
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x67, 0x47},
+ // h
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x68, 0x48},
+ // i
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x69, 0x49},
+ // j
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x6A, 0x4A},
+ // k
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x6B, 0x4B},
+ // l
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x6C, 0x4C},
+ // m
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x6D, 0x4D},
+ // n
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x6E, 0x4E},
+ // o
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x6F, 0x4F},
+ // p
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x70, 0x50},
+ // q
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x71, 0x51},
+ // r
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x72, 0x52},
+ // s
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x73, 0x53},
+ // t
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x74, 0x54},
+ // u
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x75, 0x55},
+ // v
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x76, 0x56},
+ // w
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x77, 0x57},
+ // x
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x78, 0x58},
+ // y
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x79, 0x59},
+ // z
+ {(CHARTYPE_LOWER | CHARTYPE_GRAPH), 0x7A, 0x5A},
+ // {
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x7B, 0x7B},
+ // |
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x7C, 0x7C},
+ // }
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x7D, 0x7D},
+ // ~
+ {(CHARTYPE_GRAPH | CHARTYPE_PUNCT), 0x7E, 0x7E},
+ // DEL
+ {(CHARTYPE_CONTROL), 0x7F, 0x7F},
+};
diff --git a/mingw-w64-crt/testcases/t_ctype.c
b/mingw-w64-crt/testcases/t_ctype.c
new file mode 100644
index 000000000..29048c8fb
--- /dev/null
+++ b/mingw-w64-crt/testcases/t_ctype.c
@@ -0,0 +1,39 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#define _CTYPE_DISABLE_MACROS
+#include <assert.h>
+#include <ctype.h>
+#include <locale.h>
+#include <stdlib.h>
+
+#include "ctype-test.h"
+
+/**
+ * Test conformance of ctype.h functions to POSIX specification.
+ *
+ * Reference:
<https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/basedefs/V1_chap07.html#tag_07_03_01>
+ */
+
+int main (void) {
+ assert (setlocale (LC_ALL, "C") != NULL);
+
+ for (int i = 0; i < (int) _countof (CharTypeTable); ++i) {
+ assert (!!isalnum (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_ALNUM));
+ assert (!!isalpha (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_ALPHA));
+ assert (!!isblank (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_BLANK));
+ assert (!!iscntrl (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_CONTROL));
+ assert (!!isdigit (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_DIGIT));
+ assert (!!isgraph (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_GRAPH));
+ assert (!!islower (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_LOWER));
+ assert (!!isprint (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_PRINT));
+ assert (!!isspace (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_SPACE));
+ assert (!!isupper (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_UPPER));
+ assert (!!isxdigit (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_XDIGIT));
+ }
+
+ return 0;
+}
diff --git a/mingw-w64-crt/testcases/t_wctype.c
b/mingw-w64-crt/testcases/t_wctype.c
new file mode 100644
index 000000000..25579cf58
--- /dev/null
+++ b/mingw-w64-crt/testcases/t_wctype.c
@@ -0,0 +1,39 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#define _CTYPE_DISABLE_MACROS
+#include <assert.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <wctype.h>
+
+#include "ctype-test.h"
+
+/**
+ * Test conformance of wctype.h functions to POSIX specification.
+ *
+ * Reference:
<https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/basedefs/V1_chap07.html#tag_07_03_01>
+ */
+
+int main (void) {
+ assert (setlocale (LC_ALL, "C") != NULL);
+
+ for (int i = 0; i < (int) _countof (CharTypeTable); ++i) {
+ assert (!!iswalnum (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_ALNUM));
+ assert (!!iswalpha (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_ALPHA));
+ assert (!!iswblank (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_BLANK));
+ assert (!!iswcntrl (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_CONTROL));
+ assert (!!iswdigit (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_DIGIT));
+ assert (!!iswgraph (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_GRAPH));
+ assert (!!iswlower (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_LOWER));
+ assert (!!iswprint (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_PRINT));
+ assert (!!iswspace (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_SPACE));
+ assert (!!iswupper (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_UPPER));
+ assert (!!iswxdigit (i) == !!(CharTypeTable[i].CharType &
CHARTYPE_BIT_XDIGIT));
+ }
+
+ return 0;
+}
--
2.51.0.windows.1
From a964320d4cf7d961029b89b88aadf13ca80c76bd Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:09:48 +0900
Subject: [PATCH 08/13] crt: add test for iswctype function
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/testcases/Makefile.am | 1 +
mingw-w64-crt/testcases/t_iswctype.c | 73 ++++++++++++++++++++++++++++
2 files changed, 74 insertions(+)
create mode 100644 mingw-w64-crt/testcases/t_iswctype.c
diff --git a/mingw-w64-crt/testcases/Makefile.am
b/mingw-w64-crt/testcases/Makefile.am
index 8f02b1d4c..540660fce 100644
--- a/mingw-w64-crt/testcases/Makefile.am
+++ b/mingw-w64-crt/testcases/Makefile.am
@@ -32,6 +32,7 @@ testcase_progs = \
t_fstat_t64_f64 \
t_intrinc \
t_imagebase \
+ t_iswctype \
t_lfs \
t_lseeki64 \
t_matherr \
diff --git a/mingw-w64-crt/testcases/t_iswctype.c
b/mingw-w64-crt/testcases/t_iswctype.c
new file mode 100644
index 000000000..a25aeccdb
--- /dev/null
+++ b/mingw-w64-crt/testcases/t_iswctype.c
@@ -0,0 +1,73 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#define _CTYPE_DISABLE_MACROS
+#include <assert.h>
+#include <locale.h>
+#include <wctype.h>
+
+/**
+ * Verify that `iswctype` is consistent with class-specific wctype.h functions.
+ *
+ * Example:
+ *
+ * `iswctype (wc, wctype ("print"))` must be equivalent to `iswprint (wc)`.
+ *
+ * This requirement applies to all character classes defined by POSIX.
+ */
+
+int main (void) {
+ if (setlocale (LC_ALL, "English_United States") == NULL) {
+ return 77;
+ }
+
+ wctype_t alnum = (wctype_t) 0;
+ wctype_t alpha = (wctype_t) 0;
+ wctype_t blank = (wctype_t) 0;
+ wctype_t cntrl = (wctype_t) 0;
+ wctype_t digit = (wctype_t) 0;
+ wctype_t graph = (wctype_t) 0;
+ wctype_t lower = (wctype_t) 0;
+ wctype_t print = (wctype_t) 0;
+ wctype_t punct = (wctype_t) 0;
+ wctype_t space = (wctype_t) 0;
+ wctype_t upper = (wctype_t) 0;
+ wctype_t xdigit = (wctype_t) 0;
+
+ assert ((alnum = wctype ("alnum")) != (wctype_t) 0);
+ assert ((alpha = wctype ("alpha")) != (wctype_t) 0);
+ assert ((blank = wctype ("blank")) != (wctype_t) 0);
+ assert ((cntrl = wctype ("cntrl")) != (wctype_t) 0);
+ assert ((digit = wctype ("digit")) != (wctype_t) 0);
+ assert ((graph = wctype ("graph")) != (wctype_t) 0);
+ assert ((lower = wctype ("lower")) != (wctype_t) 0);
+ assert ((print = wctype ("print")) != (wctype_t) 0);
+ assert ((punct = wctype ("punct")) != (wctype_t) 0);
+ assert ((space = wctype ("space")) != (wctype_t) 0);
+ assert ((upper = wctype ("upper")) != (wctype_t) 0);
+ assert ((xdigit = wctype ("xdigit")) != (wctype_t) 0);
+
+ for (wchar_t wc = 0;; ++wc) {
+ assert (iswalnum (wc) == iswctype (wc, alnum));
+ assert (iswalpha (wc) == iswctype (wc, alpha));
+ assert (iswblank (wc) == iswctype (wc, blank));
+ assert (iswcntrl (wc) == iswctype (wc, cntrl));
+ assert (iswdigit (wc) == iswctype (wc, digit));
+ assert (iswgraph (wc) == iswctype (wc, graph));
+ assert (iswlower (wc) == iswctype (wc, lower));
+ assert (iswprint (wc) == iswctype (wc, print));
+ assert (iswpunct (wc) == iswctype (wc, punct));
+ assert (iswspace (wc) == iswctype (wc, space));
+ assert (iswupper (wc) == iswctype (wc, upper));
+ assert (iswxdigit (wc) == iswctype (wc, xdigit));
+
+ if (wc == WEOF) {
+ break;
+ }
+ }
+
+ return 0;
+}
--
2.51.0.windows.1
From 85b3368be3c0c6b2a110199619db14e389cef4fd Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:09:51 +0900
Subject: [PATCH 09/13] crt: tidy-up wctrans.c
Fix inconsistent use of tabs and spaces in the comments.
Remove trailing whitespace.
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/misc/wctrans.c | 51 ++++++++++++++++++------------------
1 file changed, 25 insertions(+), 26 deletions(-)
diff --git a/mingw-w64-crt/misc/wctrans.c b/mingw-w64-crt/misc/wctrans.c
index a45bbf18e..1888d84f2 100644
--- a/mingw-w64-crt/misc/wctrans.c
+++ b/mingw-w64-crt/misc/wctrans.c
@@ -4,51 +4,50 @@
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
/*
- wctrans.c
- 7.25.3.2 Extensible wide-character case mapping functions
+ wctrans.c
+ 7.25.3.2 Extensible wide-character case mapping functions
- Contributed by: Danny Smith <[email protected]>
- 2005-02-24
-
- This source code is placed in the PUBLIC DOMAIN. It is modified
- from the Q8 package created by Doug Gwyn <[email protected]>
+ Contributed by: Danny Smith <[email protected]>
+ 2005-02-24
+ This source code is placed in the PUBLIC DOMAIN. It is modified
+ from the Q8 package created by Doug Gwyn <[email protected]>
*/
+#include <stdlib.h>
#include <string.h>
#include <wctype.h>
/*
- This differs from the MS implementation of wctrans which
- returns 0 for tolower and 1 for toupper. According to
- C99, a 0 return value indicates invalid input.
+ These two function go in the same translation unit so that we
+ can ensure that
+
+ towctrans(wc, wctrans("tolower")) == towlower(wc)
+ towctrans(wc, wctrans("toupper")) == towupper(wc)
- These two function go in the same translation unit so that we
- can ensure that
- towctrans(wc, wctrans("tolower")) == towlower(wc)
- towctrans(wc, wctrans("toupper")) == towupper(wc)
- It also ensures that
- towctrans(wc, wctrans("")) == wc
- which is not required by standard.
+ It also ensures that
+
+ towctrans(wc, wctrans("")) == wc
+
+ which is not required by standard.
*/
static const struct {
const char *name;
- wctrans_t val; } tmap[] = {
- {"tolower", _LOWER},
- {"toupper", _UPPER}
- };
-
-#define NTMAP (sizeof tmap / sizeof tmap[0])
+ wctrans_t val;
+} tmap[] = {
+ {"tolower", _LOWER},
+ {"toupper", _UPPER}
+};
wctrans_t
wctrans (const char* property)
{
int i;
- for ( i = 0; i < (int) NTMAP; ++i )
+ for (i = 0; i < (int) _countof (tmap); ++i)
if (strcmp (property, tmap[i].name) == 0)
return tmap[i].val;
- return 0;
+ return 0;
}
wint_t towctrans (wint_t wc, wctrans_t desc)
@@ -61,7 +60,7 @@ wint_t towctrans (wint_t wc, wctrans_t desc)
return towupper (wc);
default:
return wc;
- }
+ }
}
wctrans_t (__cdecl *__MINGW_IMP_SYMBOL (wctrans)) (const char *) = wctrans;
--
2.51.0.windows.1
From 514b5c1c597e0501e00bde5dd496bdc977273df2 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:09:54 +0900
Subject: [PATCH 10/13] crt: replace towctype function for msvcr120.dll and
UCRT
POSIX requires that `towctrans` returns its first argument unchanged when
its second argument is `(wctrans_t)0`; CRT's `towctrans` does not conform
to POSIX while mingw-w64's `towctrans` does.
This change makes POSIX-conforming `towctrans` available with all CRTs.
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/Makefile.am | 8 ++++-
.../api-ms-win-crt-string-l1-1-0.def | 2 +-
mingw-w64-crt/lib-common/msvcr120_app.def.in | 2 +-
.../lib-common/ucrtbase-common.def.in | 2 +-
mingw-w64-crt/lib32/msvcr120.def.in | 2 +-
mingw-w64-crt/lib32/msvcr120d.def.in | 2 +-
mingw-w64-crt/lib64/msvcr120.def.in | 2 +-
mingw-w64-crt/lib64/msvcr120d.def.in | 2 +-
mingw-w64-crt/libarm32/msvcr120.def.in | 2 +-
mingw-w64-crt/libarm32/msvcr120d.def.in | 2 +-
mingw-w64-crt/misc/towctrans.c | 33 +++++++++++++++++++
11 files changed, 49 insertions(+), 10 deletions(-)
create mode 100644 mingw-w64-crt/misc/towctrans.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 978294e7d..893bd5c52 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -442,6 +442,7 @@ src_ucrtbase=\
misc/_iscsymf_l.c \
misc/_onexit.c \
misc/output_format.c \
+ misc/towctrans.c \
misc/ucrt-access.c \
stdio/msvcr80plus_ftruncate64.c \
stdio/ucrt___local_stdio_printf_options.c \
@@ -1064,6 +1065,9 @@ src_post_msvcr100=\
stdio/msvcr110plus_wstat32.c \
stdio/msvcr110plus_wstat64i32.c
+src_post_msvcr110=\
+ misc/towctrans.c
+
src_crtdll=\
$(src_pre_msvcrt20) \
$(src_pre_msvcrt40) \
@@ -1182,12 +1186,14 @@ src_msvcr110=\
src_msvcr120=\
$(src_post_msvcr71) \
$(src_post_msvcr80) \
- $(src_post_msvcr100)
+ $(src_post_msvcr100) \
+ $(src_post_msvcr110)
src_msvcr120_app=\
$(src_post_msvcr71) \
$(src_post_msvcr80) \
$(src_post_msvcr100) \
+ $(src_post_msvcr110) \
misc/__p___initenv.c \
misc/__p___winitenv.c \
misc/__p__environ.c \
diff --git a/mingw-w64-crt/lib-common/api-ms-win-crt-string-l1-1-0.def
b/mingw-w64-crt/lib-common/api-ms-win-crt-string-l1-1-0.def
index 18292ae5a..eab139bfd 100644
--- a/mingw-w64-crt/lib-common/api-ms-win-crt-string-l1-1-0.def
+++ b/mingw-w64-crt/lib-common/api-ms-win-crt-string-l1-1-0.def
@@ -183,7 +183,7 @@ strtok_s
strxfrm
tolower
toupper
-towctrans
+__msvcrt_towctrans DATA == towctrans ; mingw-w64 provides real towctrans as a
wrapper around renamed __msvcrt_towctrans
towlower
towupper
wcscat
diff --git a/mingw-w64-crt/lib-common/msvcr120_app.def.in
b/mingw-w64-crt/lib-common/msvcr120_app.def.in
index 4fa8540ee..0963eea67 100644
--- a/mingw-w64-crt/lib-common/msvcr120_app.def.in
+++ b/mingw-w64-crt/lib-common/msvcr120_app.def.in
@@ -2252,7 +2252,7 @@ tmpnam
tmpnam_s
tolower
toupper
-towctrans
+__msvcrt_towctrans DATA == towctrans ; mingw-w64 provides real towctrans as a
wrapper around renamed __msvcrt_towctrans
towlower
towupper
trunc
diff --git a/mingw-w64-crt/lib-common/ucrtbase-common.def.in
b/mingw-w64-crt/lib-common/ucrtbase-common.def.in
index 8437cad2e..377ceef2f 100644
--- a/mingw-w64-crt/lib-common/ucrtbase-common.def.in
+++ b/mingw-w64-crt/lib-common/ucrtbase-common.def.in
@@ -2609,7 +2609,7 @@ tmpnam
tmpnam_s
tolower
toupper
-towctrans
+__msvcrt_towctrans DATA == towctrans ; mingw-w64 provides real towctrans as a
wrapper around renamed __msvcrt_towctrans
towlower
towupper
trunc
diff --git a/mingw-w64-crt/lib32/msvcr120.def.in
b/mingw-w64-crt/lib32/msvcr120.def.in
index 10b62291b..25933f156 100644
--- a/mingw-w64-crt/lib32/msvcr120.def.in
+++ b/mingw-w64-crt/lib32/msvcr120.def.in
@@ -2215,7 +2215,7 @@ tmpnam
tmpnam_s
tolower
toupper
-towctrans
+__msvcrt_towctrans DATA == towctrans ; mingw-w64 provides real towctrans as a
wrapper around renamed __msvcrt_towctrans
towlower
towupper
trunc
diff --git a/mingw-w64-crt/lib32/msvcr120d.def.in
b/mingw-w64-crt/lib32/msvcr120d.def.in
index 11991c1f7..e362dcd87 100644
--- a/mingw-w64-crt/lib32/msvcr120d.def.in
+++ b/mingw-w64-crt/lib32/msvcr120d.def.in
@@ -2282,7 +2282,7 @@ tmpnam
tmpnam_s
tolower
toupper
-towctrans
+__msvcrt_towctrans DATA == towctrans ; mingw-w64 provides real towctrans as a
wrapper around renamed __msvcrt_towctrans
towlower
towupper
trunc
diff --git a/mingw-w64-crt/lib64/msvcr120.def.in
b/mingw-w64-crt/lib64/msvcr120.def.in
index c6ecd419a..6442bb755 100644
--- a/mingw-w64-crt/lib64/msvcr120.def.in
+++ b/mingw-w64-crt/lib64/msvcr120.def.in
@@ -2171,7 +2171,7 @@ tmpnam
tmpnam_s
tolower
toupper
-towctrans
+__msvcrt_towctrans DATA == towctrans ; mingw-w64 provides real towctrans as a
wrapper around renamed __msvcrt_towctrans
towlower
towupper
trunc
diff --git a/mingw-w64-crt/lib64/msvcr120d.def.in
b/mingw-w64-crt/lib64/msvcr120d.def.in
index 8d5650f39..51156e5d7 100644
--- a/mingw-w64-crt/lib64/msvcr120d.def.in
+++ b/mingw-w64-crt/lib64/msvcr120d.def.in
@@ -2236,7 +2236,7 @@ tmpnam
tmpnam_s
tolower
toupper
-towctrans
+__msvcrt_towctrans DATA == towctrans ; mingw-w64 provides real towctrans as a
wrapper around renamed __msvcrt_towctrans
towlower
towupper
trunc
diff --git a/mingw-w64-crt/libarm32/msvcr120.def.in
b/mingw-w64-crt/libarm32/msvcr120.def.in
index 8baf0acbb..3a2f9267e 100644
--- a/mingw-w64-crt/libarm32/msvcr120.def.in
+++ b/mingw-w64-crt/libarm32/msvcr120.def.in
@@ -2139,7 +2139,7 @@ tmpnam
tmpnam_s
tolower
toupper
-towctrans
+__msvcrt_towctrans DATA == towctrans ; mingw-w64 provides real towctrans as a
wrapper around renamed __msvcrt_towctrans
towlower
towupper
trunc
diff --git a/mingw-w64-crt/libarm32/msvcr120d.def.in
b/mingw-w64-crt/libarm32/msvcr120d.def.in
index c71eaa2ca..4380106fa 100644
--- a/mingw-w64-crt/libarm32/msvcr120d.def.in
+++ b/mingw-w64-crt/libarm32/msvcr120d.def.in
@@ -2204,7 +2204,7 @@ tmpnam
tmpnam_s
tolower
toupper
-towctrans
+__msvcrt_towctrans DATA == towctrans ; mingw-w64 provides real towctrans as a
wrapper around renamed __msvcrt_towctrans
towlower
towupper
trunc
diff --git a/mingw-w64-crt/misc/towctrans.c b/mingw-w64-crt/misc/towctrans.c
new file mode 100644
index 000000000..bc4bf6019
--- /dev/null
+++ b/mingw-w64-crt/misc/towctrans.c
@@ -0,0 +1,33 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#define _CTYPE_DISABLE_MACROS
+#include <wctype.h>
+
+/**
+ * Both `wctrans` and `towctrans` functions were added in msvcr120.dll.
+ *
+ * CRT's `towctrans` does not properly handle case when second argument is
+ * `(wctrans_t)0`.
+ */
+
+/**
+ * This is CRT's `towctrans` renamed to `__msvcrt_towctrans`.
+ */
+extern wint_t (__cdecl *__MINGW_IMP_SYMBOL (__msvcrt_towctrans)) (wint_t,
wctrans_t);
+
+wint_t __cdecl towctrans (wint_t _C, wctrans_t _Type) {
+ /**
+ * POSIX requires that if `_Type` is zero, `_C` is returned unchanged.
+ */
+ if (_Type == (wctrans_t) 0) {
+ return _C;
+ }
+
+ return __MINGW_IMP_SYMBOL (__msvcrt_towctrans) (_C, _Type);
+}
+
+wint_t (__cdecl *__MINGW_IMP_SYMBOL (towctrans)) (wint_t, wctrans_t) =
towctrans;
--
2.51.0.windows.1
From c7357c30450c628f94b146fa2bf7309370e8194c Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:09:56 +0900
Subject: [PATCH 11/13] crt: add test for towctrans function
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/testcases/Makefile.am | 1 +
mingw-w64-crt/testcases/t_towctrans.c | 46 +++++++++++++++++++++++++++
2 files changed, 47 insertions(+)
create mode 100644 mingw-w64-crt/testcases/t_towctrans.c
diff --git a/mingw-w64-crt/testcases/Makefile.am
b/mingw-w64-crt/testcases/Makefile.am
index 540660fce..eb7044076 100644
--- a/mingw-w64-crt/testcases/Makefile.am
+++ b/mingw-w64-crt/testcases/Makefile.am
@@ -73,6 +73,7 @@ testcase_progs = \
t_tmpfile \
t_trycatch \
t_stat_slash \
+ t_towctrans \
t_utime \
t_vsscanf \
t_wcrtomb \
diff --git a/mingw-w64-crt/testcases/t_towctrans.c
b/mingw-w64-crt/testcases/t_towctrans.c
new file mode 100644
index 000000000..978a105e7
--- /dev/null
+++ b/mingw-w64-crt/testcases/t_towctrans.c
@@ -0,0 +1,46 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#include <assert.h>
+#include <locale.h>
+#include <wctype.h>
+
+/**
+ * Test Summary:
+ *
+ * Verify that `towctrans` is consistent with mapping-specific wctype.h
+ * functions.
+ *
+ * `towctrans (wc, wctrans ("tolower"))` must be equivalent to `towlower (wc)`.
+ * `towctrans (wc, wctrans ("toupper"))` must be equivalent to `towupper (wc)`.
+ *
+ * POSIX requires that if second argument to `towctrans` is `(wctrans_t)0`,
+ * then `wc` is returned unchanged.
+ */
+
+int main (void) {
+ if (setlocale (LC_ALL, "English_United States") == NULL) {
+ return 77;
+ }
+
+ wctrans_t lower = 0;
+ wctrans_t upper = 0;
+
+ assert ((lower = wctrans ("tolower")) != (wctrans_t) 0);
+ assert ((upper = wctrans ("toupper")) != (wctrans_t) 0);
+
+ for (wint_t wc = 0;; ++wc) {
+ assert (towctrans (wc, (wctrans_t) 0) == wc);
+ assert (towlower (wc) == towctrans (wc, lower));
+ assert (towupper (wc) == towctrans (wc, upper));
+
+ if (wc == WEOF) {
+ break;
+ }
+ }
+
+ return 0;
+}
--
2.51.0.windows.1
From 34f09cd4941a06e7208793e4ffcb70bbcf8983b4 Mon Sep 17 00:00:00 2001
From: Kirill Makurin <[email protected]>
Date: Sat, 7 Feb 2026 11:09:59 +0900
Subject: [PATCH 12/13] Move source files for [w]ctype.h functions to ctype
subdirectory
Signed-off-by: Kirill Makurin <[email protected]>
---
mingw-w64-crt/Makefile.am | 79 ++++++++++---------
mingw-w64-crt/{misc => ctype}/__iswcsym.c | 0
mingw-w64-crt/{misc => ctype}/__iswcsymf.c | 0
mingw-w64-crt/{misc => ctype}/__p__pctype.c | 0
mingw-w64-crt/{misc => ctype}/__p__pwctype.c | 0
mingw-w64-crt/{misc => ctype}/__pctype_func.c | 0
.../{misc => ctype}/__pwctype_func.c | 0
mingw-w64-crt/{misc => ctype}/_isblank_l.c | 0
mingw-w64-crt/{misc => ctype}/_iscsym_l.c | 0
mingw-w64-crt/{misc => ctype}/_iscsymf_l.c | 0
mingw-w64-crt/{misc => ctype}/_iswblank_l.c | 0
mingw-w64-crt/{misc => ctype}/isblank.c | 0
mingw-w64-crt/{misc => ctype}/isprint.c | 0
mingw-w64-crt/{misc => ctype}/iswblank.c | 0
mingw-w64-crt/{misc => ctype}/iswctype.c | 0
mingw-w64-crt/{misc => ctype}/iswprint.c | 0
mingw-w64-crt/{misc => ctype}/towctrans.c | 0
mingw-w64-crt/{misc => ctype}/wctrans.c | 0
mingw-w64-crt/{misc => ctype}/wctype.c | 0
19 files changed, 40 insertions(+), 39 deletions(-)
rename mingw-w64-crt/{misc => ctype}/__iswcsym.c (100%)
rename mingw-w64-crt/{misc => ctype}/__iswcsymf.c (100%)
rename mingw-w64-crt/{misc => ctype}/__p__pctype.c (100%)
rename mingw-w64-crt/{misc => ctype}/__p__pwctype.c (100%)
rename mingw-w64-crt/{misc => ctype}/__pctype_func.c (100%)
rename mingw-w64-crt/{misc => ctype}/__pwctype_func.c (100%)
rename mingw-w64-crt/{misc => ctype}/_isblank_l.c (100%)
rename mingw-w64-crt/{misc => ctype}/_iscsym_l.c (100%)
rename mingw-w64-crt/{misc => ctype}/_iscsymf_l.c (100%)
rename mingw-w64-crt/{misc => ctype}/_iswblank_l.c (100%)
rename mingw-w64-crt/{misc => ctype}/isblank.c (100%)
rename mingw-w64-crt/{misc => ctype}/isprint.c (100%)
rename mingw-w64-crt/{misc => ctype}/iswblank.c (100%)
rename mingw-w64-crt/{misc => ctype}/iswctype.c (100%)
rename mingw-w64-crt/{misc => ctype}/iswprint.c (100%)
rename mingw-w64-crt/{misc => ctype}/towctrans.c (100%)
rename mingw-w64-crt/{misc => ctype}/wctrans.c (100%)
rename mingw-w64-crt/{misc => ctype}/wctype.c (100%)
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 893bd5c52..e10cfe12e 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -335,8 +335,16 @@ src_msvcrt_add_vscanf=\
# Files included in libmsvcrt-os.a (for msvcrt.dll) on all archs
src_msvcrt=\
$(src_msvcrt_add_vscanf) \
- misc/__iswcsym.c \
- misc/__iswcsymf.c \
+ ctype/__iswcsym.c \
+ ctype/__iswcsymf.c \
+ ctype/_isblank_l.c \
+ ctype/_iswblank_l.c \
+ ctype/isblank.c \
+ ctype/isprint.c \
+ ctype/iswblank.c \
+ ctype/iswprint.c \
+ ctype/wctrans.c \
+ ctype/wctype.c \
misc/__sys_errlist.c \
misc/__sys_nerr.c \
misc/_aligned_msize.c \
@@ -357,14 +365,6 @@ src_msvcrt=\
misc/_set_purecall_handler.c \
misc/imaxdiv.c \
misc/invalid_parameter_handler.c \
- misc/isblank.c \
- misc/isprint.c \
- misc/iswblank.c \
- misc/iswprint.c \
- misc/_isblank_l.c \
- misc/_iswblank_l.c \
- misc/wctrans.c \
- misc/wctype.c \
secapi/_vscprintf_p.c \
secapi/_vscwprintf_p.c \
secapi/_vswprintf_p.c \
@@ -424,6 +424,9 @@ src_msvcrt_add_x86=\
# Files included in libucrt*.a
src_ucrtbase=\
+ ctype/_iscsym_l.c \
+ ctype/_iscsymf_l.c \
+ ctype/towctrans.c \
misc/ucrt__getmainargs.c \
misc/ucrt__wgetmainargs.c \
misc/ucrt_amsg_exit.c \
@@ -438,11 +441,8 @@ src_ucrtbase=\
misc/__p__osver_emul.c \
misc/__initenv.c \
misc/__winitenv.c \
- misc/_iscsym_l.c \
- misc/_iscsymf_l.c \
misc/_onexit.c \
misc/output_format.c \
- misc/towctrans.c \
misc/ucrt-access.c \
stdio/msvcr80plus_ftruncate64.c \
stdio/ucrt___local_stdio_printf_options.c \
@@ -566,6 +566,8 @@ endif
src_msvcrt32=\
$(src_msvcrt) \
$(src_msvcrt_add_x86) \
+ ctype/__pctype_func.c \
+ ctype/__pwctype_func.c \
misc/msvcrt__getmainargs.c \
misc/msvcrt__wgetmainargs.c \
math/i386__copysignf.c \
@@ -573,8 +575,6 @@ src_msvcrt32=\
misc/___lc_handle_func.c \
misc/___mb_cur_max_func.c \
misc/__p__osplatform.c \
- misc/__pctype_func.c \
- misc/__pwctype_func.c \
misc/_aligned_free.c \
misc/_aligned_malloc.c \
misc/_aligned_offset_malloc.c \
@@ -638,6 +638,8 @@ src_msvcrt32=\
src_msvcrt64=\
$(src_msvcrt) \
$(src_msvcrt_add_x86) \
+ ctype/__p__pctype.c \
+ ctype/__p__pwctype.c \
misc/__daylight.c \
misc/__dstbias.c \
misc/__p___argc.c \
@@ -654,9 +656,7 @@ src_msvcrt64=\
misc/__p__mbctype.c \
misc/__p__osplatform.c \
misc/__p__osver.c \
- misc/__p__pctype.c \
misc/__p__pgmptr.c \
- misc/__p__pwctype.c \
misc/__p__wcmdln.c \
misc/__p__wenviron.c \
misc/__p__winmajor.c \
@@ -701,6 +701,8 @@ src_msvcrt64=\
# Files included in libmsvcrt-os.a (for msvcrt.dll) on arm32
src_msvcrtarm32=\
$(src_msvcrt) \
+ ctype/__p__pctype.c \
+ ctype/__p__pwctype.c \
misc/__p___argc.c \
misc/__p___argv.c \
misc/__p___wargv.c \
@@ -714,9 +716,7 @@ src_msvcrtarm32=\
misc/__p__mbctype.c \
misc/__p__osplatform_emul.c \
misc/__p__osver.c \
- misc/__p__pctype.c \
misc/__p__pgmptr.c \
- misc/__p__pwctype.c \
misc/__p__wcmdln.c \
misc/__p__winmajor.c \
misc/__p__winminor.c \
@@ -786,6 +786,8 @@ src_msvcrtarm32+=\
# Files included in libmsvcrt-os.a (for msvcrt.dll) on arm64
src_msvcrtarm64=\
$(src_msvcrt) \
+ ctype/__p__pctype.c \
+ ctype/__p__pwctype.c \
math/arm-common/acosh.c \
math/arm-common/acoshf.c \
math/arm-common/acoshl.c \
@@ -840,9 +842,7 @@ src_msvcrtarm64=\
misc/__p__mbctype.c \
misc/__p__osplatform_emul.c \
misc/__p__osver.c \
- misc/__p__pctype.c \
misc/__p__pgmptr.c \
- misc/__p__pwctype.c \
misc/__p__wcmdln.c \
misc/__p__winmajor.c \
misc/__p__winminor.c \
@@ -880,6 +880,8 @@ src_msvcrtarm64+=stdio/scanf.S
endif
src_pre_msvcrt20=\
+ ctype/__p__pctype.c \
+ ctype/__p__pwctype.c \
misc/__daylight.c \
misc/__initenv.c \
misc/__p___argc.c \
@@ -891,9 +893,7 @@ src_pre_msvcrt20=\
misc/__p__environ.c \
misc/__p__fmode.c \
misc/__p__osver.c \
- misc/__p__pctype.c \
misc/__p__pgmptr.c \
- misc/__p__pwctype.c \
misc/__p__winmajor.c \
misc/__p__winminor.c \
misc/__p__winver.c \
@@ -932,9 +932,9 @@ src_pre_msvcrt60=\
stdio/mingw_dummy__lock.c
src_pre_msvcr70=\
+ ctype/__pctype_func.c \
+ ctype/__pwctype_func.c \
misc/___mb_cur_max_func.c \
- misc/__pctype_func.c \
- misc/__pwctype_func.c \
misc/_aligned_free.c \
misc/_aligned_malloc.c \
misc/_aligned_offset_malloc.c \
@@ -970,8 +970,8 @@ src_pre_msvcr71=\
misc/_set_purecall_handler.c
src_pre_msvcr80=\
- misc/__iswcsym.c \
- misc/__iswcsymf.c \
+ ctype/__iswcsym.c \
+ ctype/__iswcsymf.c \
misc/__sys_errlist.c \
misc/__sys_nerr.c \
misc/_aligned_msize.c \
@@ -1036,22 +1036,22 @@ src_pre_msvcr110=\
src_pre_msvcr120=\
$(src_msvcrt_add_vscanf) \
+ ctype/isblank.c \
+ ctype/isprint.c \
+ ctype/iswblank.c \
+ ctype/iswprint.c \
+ ctype/wctrans.c \
+ ctype/wctype.c \
math/i386__copysignf.c \
- misc/isblank.c \
- misc/isprint.c \
- misc/iswblank.c \
- misc/iswprint.c \
- misc/wctrans.c \
- misc/wctype.c \
stdio/scanf.S
src_pre_msvcr120_post_msvcr71=\
- misc/_isblank_l.c \
- misc/_iswblank_l.c
+ ctype/_isblank_l.c \
+ ctype/_iswblank_l.c
src_post_msvcr71=\
- misc/_iscsym_l.c \
- misc/_iscsymf_l.c \
+ ctype/_iscsym_l.c \
+ ctype/_iscsymf_l.c \
stdio/msvcr80plus_ftruncate64.c \
string/msvcr80plus_wcstok.c
@@ -1066,7 +1066,7 @@ src_post_msvcr100=\
stdio/msvcr110plus_wstat64i32.c
src_post_msvcr110=\
- misc/towctrans.c
+ ctype/towctrans.c
src_crtdll=\
$(src_pre_msvcrt20) \
@@ -1223,6 +1223,8 @@ src_libmingwex=\
complex/conj.def.h complex/cpow.def.h complex/cproj.def.h
complex/creal.def.h complex/csin.def.h \
complex/csinh.def.h complex/csqrt.def.h complex/ctan.def.h
complex/ctanh.def.h \
\
+ ctype/iswctype.c \
+ \
gdtoa/gd_arith.h gdtoa/gd_qnan.h gdtoa/gdtoa.h gdtoa/gdtoaimp.h \
gdtoa/arithchk.c gdtoa/dmisc.c gdtoa/dtoa.c gdtoa/g_dfmt.c
gdtoa/gdtoa.c gdtoa/gethex.c \
gdtoa/g_ffmt.c gdtoa/g__fmt.c gdtoa/gmisc.c gdtoa/g_xfmt.c
gdtoa/hd_init.c gdtoa/hexnan.c \
@@ -1274,7 +1276,6 @@ src_libmingwex=\
misc/strsafe.c \
misc/tdelete.c misc/tdestroy.c misc/tfind.c \
misc/tsearch.c misc/twalk.c \
- misc/iswctype.c \
misc/wcstof.c \
misc/wcstold.c \
misc/wdirent.c misc/winbs_uint64.c misc/winbs_ulong.c
misc/winbs_ushort.c \
diff --git a/mingw-w64-crt/misc/__iswcsym.c b/mingw-w64-crt/ctype/__iswcsym.c
similarity index 100%
rename from mingw-w64-crt/misc/__iswcsym.c
rename to mingw-w64-crt/ctype/__iswcsym.c
diff --git a/mingw-w64-crt/misc/__iswcsymf.c b/mingw-w64-crt/ctype/__iswcsymf.c
similarity index 100%
rename from mingw-w64-crt/misc/__iswcsymf.c
rename to mingw-w64-crt/ctype/__iswcsymf.c
diff --git a/mingw-w64-crt/misc/__p__pctype.c
b/mingw-w64-crt/ctype/__p__pctype.c
similarity index 100%
rename from mingw-w64-crt/misc/__p__pctype.c
rename to mingw-w64-crt/ctype/__p__pctype.c
diff --git a/mingw-w64-crt/misc/__p__pwctype.c
b/mingw-w64-crt/ctype/__p__pwctype.c
similarity index 100%
rename from mingw-w64-crt/misc/__p__pwctype.c
rename to mingw-w64-crt/ctype/__p__pwctype.c
diff --git a/mingw-w64-crt/misc/__pctype_func.c
b/mingw-w64-crt/ctype/__pctype_func.c
similarity index 100%
rename from mingw-w64-crt/misc/__pctype_func.c
rename to mingw-w64-crt/ctype/__pctype_func.c
diff --git a/mingw-w64-crt/misc/__pwctype_func.c
b/mingw-w64-crt/ctype/__pwctype_func.c
similarity index 100%
rename from mingw-w64-crt/misc/__pwctype_func.c
rename to mingw-w64-crt/ctype/__pwctype_func.c
diff --git a/mingw-w64-crt/misc/_isblank_l.c b/mingw-w64-crt/ctype/_isblank_l.c
similarity index 100%
rename from mingw-w64-crt/misc/_isblank_l.c
rename to mingw-w64-crt/ctype/_isblank_l.c
diff --git a/mingw-w64-crt/misc/_iscsym_l.c b/mingw-w64-crt/ctype/_iscsym_l.c
similarity index 100%
rename from mingw-w64-crt/misc/_iscsym_l.c
rename to mingw-w64-crt/ctype/_iscsym_l.c
diff --git a/mingw-w64-crt/misc/_iscsymf_l.c b/mingw-w64-crt/ctype/_iscsymf_l.c
similarity index 100%
rename from mingw-w64-crt/misc/_iscsymf_l.c
rename to mingw-w64-crt/ctype/_iscsymf_l.c
diff --git a/mingw-w64-crt/misc/_iswblank_l.c
b/mingw-w64-crt/ctype/_iswblank_l.c
similarity index 100%
rename from mingw-w64-crt/misc/_iswblank_l.c
rename to mingw-w64-crt/ctype/_iswblank_l.c
diff --git a/mingw-w64-crt/misc/isblank.c b/mingw-w64-crt/ctype/isblank.c
similarity index 100%
rename from mingw-w64-crt/misc/isblank.c
rename to mingw-w64-crt/ctype/isblank.c
diff --git a/mingw-w64-crt/misc/isprint.c b/mingw-w64-crt/ctype/isprint.c
similarity index 100%
rename from mingw-w64-crt/misc/isprint.c
rename to mingw-w64-crt/ctype/isprint.c
diff --git a/mingw-w64-crt/misc/iswblank.c b/mingw-w64-crt/ctype/iswblank.c
similarity index 100%
rename from mingw-w64-crt/misc/iswblank.c
rename to mingw-w64-crt/ctype/iswblank.c
diff --git a/mingw-w64-crt/misc/iswctype.c b/mingw-w64-crt/ctype/iswctype.c
similarity index 100%
rename from mingw-w64-crt/misc/iswctype.c
rename to mingw-w64-crt/ctype/iswctype.c
diff --git a/mingw-w64-crt/misc/iswprint.c b/mingw-w64-crt/ctype/iswprint.c
similarity index 100%
rename from mingw-w64-crt/misc/iswprint.c
rename to mingw-w64-crt/ctype/iswprint.c
diff --git a/mingw-w64-crt/misc/towctrans.c b/mingw-w64-crt/ctype/towctrans.c
similarity index 100%
rename from mingw-w64-crt/misc/towctrans.c
rename to mingw-w64-crt/ctype/towctrans.c
diff --git a/mingw-w64-crt/misc/wctrans.c b/mingw-w64-crt/ctype/wctrans.c
similarity index 100%
rename from mingw-w64-crt/misc/wctrans.c
rename to mingw-w64-crt/ctype/wctrans.c
diff --git a/mingw-w64-crt/misc/wctype.c b/mingw-w64-crt/ctype/wctype.c
similarity index 100%
rename from mingw-w64-crt/misc/wctype.c
rename to mingw-w64-crt/ctype/wctype.c
--
2.51.0.windows.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public