From 144803a54571a6a514b06f4719ff6215eb325e5c Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 21 Jul 2020 12:21:08 +0200 Subject: [PATCH] msvcrt: Add _wctype table. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- .../api-ms-win-crt-string-l1-1-0.spec | 2 +- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/msvcr70/msvcr70.spec | 2 +- dlls/msvcr71/msvcr71.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/ctype.c | 74 +++++++++++++++++++ dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 2 +- 12 files changed, 85 insertions(+), 11 deletions(-) diff --git a/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec b/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec index 6a68274479b..ec984da1e8c 100644 --- a/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec +++ b/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec @@ -96,7 +96,7 @@ @ cdecl _wcsupr_s(wstr long) ucrtbase._wcsupr_s @ cdecl _wcsupr_s_l(wstr long ptr) ucrtbase._wcsupr_s_l @ cdecl _wcsxfrm_l(ptr wstr long ptr) ucrtbase._wcsxfrm_l -@ stub _wctype +@ extern _wctype ucrtbase._wctype @ cdecl is_wctype(long long) ucrtbase.is_wctype @ cdecl isalnum(long) ucrtbase.isalnum @ cdecl isalpha(long) ucrtbase.isalpha diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 6451fda1520..df3f1784e51 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1531,7 +1531,7 @@ @ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l -# extern _wctype +@ extern _wctype MSVCRT__wctype @ cdecl _wdupenv_s(ptr ptr wstr) @ extern _wenviron MSVCRT__wenviron @ varargs _wexecl(wstr wstr) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index abfbb846b36..e449b14f292 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1889,7 +1889,7 @@ @ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l -# extern _wctype +@ extern _wctype MSVCRT__wctype @ cdecl _wdupenv_s(ptr ptr wstr) @ extern _wenviron MSVCRT__wenviron @ varargs _wexecl(wstr wstr) diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 00a1c3e49e0..5c3bcfe9b90 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1913,7 +1913,7 @@ @ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l -# extern _wctype +@ extern _wctype MSVCRT__wctype @ cdecl _wdupenv_s(ptr ptr wstr) @ extern _wenviron MSVCRT__wenviron @ varargs _wexecl(wstr wstr) diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index e622f95af16..0cfd4bbf5e8 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1606,7 +1606,7 @@ @ cdecl _wctime64_s(ptr long ptr) msvcr120._wctime64_s @ cdecl _wctomb_l(ptr long ptr) msvcr120._wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) msvcr120._wctomb_s_l -# extern _wctype +@ extern _wctype msvcr120._wctype @ extern _wenviron msvcr120._wenviron @ cdecl _wfdopen(long wstr) msvcr120._wfdopen @ cdecl _wfindfirst32(wstr ptr) msvcr120._wfindfirst32 diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec index 2649034abd4..12ca4ac47c7 100644 --- a/dlls/msvcr70/msvcr70.spec +++ b/dlls/msvcr70/msvcr70.spec @@ -610,7 +610,7 @@ @ cdecl _wcsupr(wstr) MSVCRT__wcsupr @ cdecl _wctime(ptr) MSVCRT__wctime @ cdecl _wctime64(ptr) MSVCRT__wctime64 -# extern _wctype +@ extern _wctype MSVCRT__wctype @ extern _wenviron MSVCRT__wenviron @ varargs _wexecl(wstr wstr) @ varargs _wexecle(wstr wstr) diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec index 9d3e2b2ebe5..009b3237c80 100644 --- a/dlls/msvcr71/msvcr71.spec +++ b/dlls/msvcr71/msvcr71.spec @@ -606,7 +606,7 @@ @ cdecl _wcsupr(wstr) MSVCRT__wcsupr @ cdecl _wctime(ptr) MSVCRT__wctime @ cdecl _wctime64(ptr) MSVCRT__wctime64 -# extern _wctype +@ extern _wctype MSVCRT__wctype @ extern _wenviron MSVCRT__wenviron @ varargs _wexecl(wstr wstr) @ varargs _wexecle(wstr wstr) diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index aaa1b499c52..121b1110ee4 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -1210,7 +1210,7 @@ @ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l -# extern _wctype +@ extern _wctype MSVCRT__wctype @ cdecl _wdupenv_s(ptr ptr wstr) @ extern _wenviron MSVCRT__wenviron @ varargs _wexecl(wstr wstr) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 9267c5b1ddc..ca44f289329 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -1186,7 +1186,7 @@ @ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l -# extern _wctype +@ extern _wctype MSVCRT__wctype @ cdecl _wdupenv_s(ptr ptr wstr) @ extern _wenviron MSVCRT__wenviron @ varargs _wexecl(wstr wstr) diff --git a/dlls/msvcrt/ctype.c b/dlls/msvcrt/ctype.c index e051c015211..b8e41a2c4d4 100644 --- a/dlls/msvcrt/ctype.c +++ b/dlls/msvcrt/ctype.c @@ -51,6 +51,80 @@ WORD MSVCRT__ctype [257] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +#if _MSVCR_VER <= 110 +# define B110 MSVCRT__BLANK +#else +# define B110 0 +#endif + +#if _MSVCR_VER == 120 +# define D120 0 +#else +# define D120 4 +#endif + +#if _MSVCR_VER >= 140 +# define S140 MSVCRT__SPACE +# define L140 MSVCRT__LOWER | 0x100 +# define C140 MSVCRT__CONTROL +#else +# define S140 0 +# define L140 0 +# define C140 0 +#endif +WORD MSVCRT__wctype[257] = +{ + 0, + /* 00 */ + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0028 | B110, 0x0028, 0x0028, 0x0028, 0x0028, 0x0020, 0x0020, + /* 10 */ + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + /* 20 */ + 0x0048, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + /* 30 */ + 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, + 0x0084, 0x0084, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + /* 40 */ + 0x0010, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0101, + 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, + /* 50 */ + 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, + 0x0101, 0x0101, 0x0101, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + /* 60 */ + 0x0010, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0102, + 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, + /* 70 */ + 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, + 0x0102, 0x0102, 0x0102, 0x0010, 0x0010, 0x0010, 0x0010, 0x0020, + /* 80 */ + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020 | S140, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + /* 90 */ + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + /* a0 */ + 0x0008 | B110, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + 0x0010, 0x0010, 0x0010 | L140, 0x0010, 0x0010, 0x0010 | C140, 0x0010, 0x0010, + /* b0 */ + 0x0010, 0x0010, 0x0010 | D120, 0x0010 | D120, 0x0010, 0x0010 | L140, 0x0010, 0x0010, + 0x0010, 0x0010 | D120, 0x0010 | L140, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + /* c0 */ + 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, + 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, + /* d0 */ + 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0010, + 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0102, + /* e0 */ + 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, + 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, + /* f0 */ + 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0010, + 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102 +}; + /********************************************************************* * __p__pctype (MSVCRT.@) */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 1d26169cc11..58149de285e 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -1141,7 +1141,7 @@ @ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l -# extern _wctype +@ extern _wctype MSVCRT__wctype @ extern _wenviron MSVCRT__wenviron @ varargs _wexecl(wstr wstr) @ varargs _wexecle(wstr wstr) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 8493ae79ba4..7aebd81e02a 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2062,7 +2062,7 @@ @ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l -@ stub _wctype +@ extern _wctype MSVCRT__wctype @ cdecl _wdupenv_s(ptr ptr wstr) @ varargs _wexecl(wstr wstr) @ varargs _wexecle(wstr wstr)