From bda232de94d784e4cfaf5e252f76034722f8f58a Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Mon, 3 Apr 2017 11:52:18 -0700 Subject: [PATCH] msvcrt: Add _iswctype_l. Signed-off-by: Daniel Lehman 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/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/wcs.c | 8 ++++++++ dlls/ucrtbase/tests/misc.c | 15 +++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 2 +- 11 files changed, 32 insertions(+), 9 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 4b08bc69e60..fe3ae5425cf 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 @@ -25,7 +25,7 @@ @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l -@ stub _iswctype_l +@ cdecl _iswctype_l(long long ptr) ucrtbase._iswctype_l @ cdecl _iswdigit_l(long ptr) ucrtbase._iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 45eb18148c1..2c0f3c95358 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1021,7 +1021,7 @@ @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l -@ stub _iswctype_l +@ cdecl _iswctype_l(long long ptr) MSVCRT__iswctype_l @ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 25fb21be473..dcaa089c294 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1367,7 +1367,7 @@ @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l -@ stub _iswctype_l +@ cdecl _iswctype_l(long long ptr) MSVCRT__iswctype_l @ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index c7795289a43..1701c4a2f27 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1373,7 +1373,7 @@ @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l -@ stub _iswctype_l +@ cdecl _iswctype_l(long long ptr) MSVCRT__iswctype_l @ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 8ca6c5f5cb2..023aa00903c 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1238,7 +1238,7 @@ @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l -@ stub _iswctype_l +@ cdecl _iswctype_l(long long ptr) msvcr120._iswctype_l @ cdecl _iswdigit_l(long ptr) msvcr120._iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 4b51ae1265c..de945d5d3e4 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -693,7 +693,7 @@ @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l -@ stub _iswctype_l +@ cdecl _iswctype_l(long long ptr) MSVCRT__iswctype_l @ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 9e9f73bfd22..8b4a77c96a8 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -671,7 +671,7 @@ @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l -@ stub _iswctype_l +@ cdecl _iswctype_l(long long ptr) MSVCRT__iswctype_l @ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index ecef9b8848f..1a887d3aa7f 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -636,7 +636,7 @@ # stub _iswalnum_l(long ptr) @ cdecl _iswalpha_l(long ptr) MSVCRT__iswalpha_l # stub _iswcntrl_l(long ptr) -# stub _iswctype_l(long long ptr) +@ cdecl _iswctype_l(long long ptr) MSVCRT__iswctype_l @ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l # stub _iswgraph_l(long ptr) # stub _iswlower_l(long ptr) diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index bd7cc20da22..89c4152d9d1 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1857,6 +1857,14 @@ INT CDECL MSVCRT_iswxdigit( MSVCRT_wchar_t wc ) return isxdigitW( wc ); } +/********************************************************************* + * _iswctype_l (MSVCRT.@) + */ +INT CDECL MSVCRT__iswctype_l( MSVCRT_wchar_t wc, MSVCRT_wctype_t type, MSVCRT__locale_t locale ) +{ + return (get_char_typeW(wc) & 0xffff) & type; +} + /********************************************************************* * wcscpy_s (MSVCRT.@) */ diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 910a0f906bc..5a1f8dcc34c 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -89,6 +89,7 @@ static MSVCRT_lldiv_t (CDECL *p_lldiv)(LONGLONG,LONGLONG); static int (CDECL *p__isctype)(int,int); static int (CDECL *p_isblank)(int); static int (CDECL *p__isblank_l)(int,_locale_t); +static int (CDECL *p__iswctype_l)(int,int,_locale_t); static void test__initialize_onexit_table(void) { @@ -386,6 +387,7 @@ static BOOL init(void) p__isctype = (void*)GetProcAddress(module, "_isctype"); p_isblank = (void*)GetProcAddress(module, "isblank"); p__isblank_l = (void*)GetProcAddress(module, "_isblank_l"); + p__iswctype_l = (void*)GetProcAddress(module, "_iswctype_l"); return TRUE; } @@ -484,6 +486,19 @@ static void test_isblank(void) ok(!p__isblank_l(c, NULL), "%d shouldn't be blank\n", c); } } + + for(c = 0; c <= 0xffff; c++) { + if(c == '\t' || c == ' ' || c == 0x3000 || c == 0xfeff) { + if(c == '\t') + todo_wine ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n"); + else + ok(p__iswctype_l(c, _BLANK, NULL), "%d should be blank\n", c); + } else { + todo_wine_if(c == 0xa0) { + ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c); + } + } + } } START_TEST(misc) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 8f1284c2c5c..9c0b8077245 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -512,7 +512,7 @@ @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l -@ stub _iswctype_l +@ cdecl _iswctype_l(long long ptr) MSVCRT__iswctype_l @ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l