diff --git a/reactos/lib/3rdparty/libwine/CMakeLists.txt b/reactos/lib/3rdparty/libwine/CMakeLists.txt index 8f4c440fcd6..d8059eb51b1 100644 --- a/reactos/lib/3rdparty/libwine/CMakeLists.txt +++ b/reactos/lib/3rdparty/libwine/CMakeLists.txt @@ -8,7 +8,7 @@ list(APPEND SOURCE isinf.c isnan.c loader.c - wctype.c + ../../sdk/crt/string/wctype.c register.c # string.c implements _stricmp, already shipped with crt ) diff --git a/reactos/lib/sdk/crt/crt.cmake b/reactos/lib/sdk/crt/crt.cmake index 6abd6fe87d2..f5f4b8e2e2c 100644 --- a/reactos/lib/sdk/crt/crt.cmake +++ b/reactos/lib/sdk/crt/crt.cmake @@ -281,6 +281,7 @@ list(APPEND CRT_SOURCE string/wcs.c string/wcstol.c string/wcstoul.c + string/wctype.c string/wsplitp.c string/wtoi.c string/wtoi64.c diff --git a/reactos/lib/sdk/crt/string/ctype.c b/reactos/lib/sdk/crt/string/ctype.c index 28dcda5ab66..7c5188570f9 100644 --- a/reactos/lib/sdk/crt/string/ctype.c +++ b/reactos/lib/sdk/crt/string/ctype.c @@ -551,6 +551,8 @@ const unsigned short _wctype[] = { const unsigned short *_pctype = _ctype + 1; const unsigned short *_pwctype = _wctype + 1; +extern const unsigned short wine_wctype_table[]; + /* * @implemented */ @@ -587,7 +589,7 @@ int _isctype (int c, int ctypeFlags) */ int iswctype(wint_t wc, wctype_t wctypeFlags) { - return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags); + return (wine_wctype_table[wine_wctype_table[wc >> 8] + (wc & 0xff)] & wctypeFlags); } /* @@ -597,7 +599,7 @@ int iswctype(wint_t wc, wctype_t wctypeFlags) */ int is_wctype(wint_t wc, wctype_t wctypeFlags) { - return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags); + return (wine_wctype_table[wine_wctype_table[wc >> 8] + (wc & 0xff)] & wctypeFlags); } /* diff --git a/reactos/lib/3rdparty/libwine/wctype.c b/reactos/lib/sdk/crt/string/wctype.c similarity index 100% rename from reactos/lib/3rdparty/libwine/wctype.c rename to reactos/lib/sdk/crt/string/wctype.c