I want to replace is_ascii with iswascii in urlmon without hurting performance. I added inline versions of the rest of the isw* functions because they may also be useful to us in the future.
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/msvcrt/ctype.c | 1 + dlls/msvcrt/wcs.c | 1 + dlls/ntdll/wcstring.c | 1 + include/msvcrt/corecrt_wctype.h | 15 +++++++++++++++ 4 files changed, 18 insertions(+)
diff --git a/dlls/msvcrt/ctype.c b/dlls/msvcrt/ctype.c index 5a7d3450eda..b749052cec5 100644 --- a/dlls/msvcrt/ctype.c +++ b/dlls/msvcrt/ctype.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define _CTYPE_DISABLE_MACROS #include <locale.h> #include "msvcrt.h" #include "winnls.h" diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 60a15dfc29c..6a3d90d9cc5 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define _CTYPE_DISABLE_MACROS #define _NO_CRT_STDIO_INLINE #include <limits.h> #include <locale.h> diff --git a/dlls/ntdll/wcstring.c b/dlls/ntdll/wcstring.c index aa43c3de16b..cc6e53699d5 100644 --- a/dlls/ntdll/wcstring.c +++ b/dlls/ntdll/wcstring.c @@ -20,6 +20,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define _CTYPE_DISABLE_MACROS #include <ctype.h> #include <errno.h> #include <limits.h> diff --git a/include/msvcrt/corecrt_wctype.h b/include/msvcrt/corecrt_wctype.h index 9661ab5e596..22a6de287d8 100644 --- a/include/msvcrt/corecrt_wctype.h +++ b/include/msvcrt/corecrt_wctype.h @@ -57,6 +57,21 @@ _ACRTIMP int __cdecl iswxdigit(wint_t); _ACRTIMP wint_t __cdecl towlower(wint_t); _ACRTIMP wint_t __cdecl towupper(wint_t);
+#if !defined(__cplusplus) && !defined(_CTYPE_DISABLE_MACROS) +# define iswalnum(wc) _iswctype_l(wc, _ALPHA | _DIGIT, NULL) +# define iswalpha(wc) _iswctype_l(wc, _ALPHA, NULL) +# define iswascii(wc) ((unsigned)wc < 0x80) +# define iswblank(wc) _iswctype_l(wc, _BLANK, NULL) +# define iswcntrl(wc) _iswctype_l(wc, _CONTROL, NULL) +# define iswgraph(wc) _iswctype_l(wc, _ALPHA | _DIGIT | _PUNCT, NULL) +# define iswlower(wc) _iswctype_l(wc, _LOWER, NULL) +# define iswprint(wc) _iswctype_l(wc, _ALPHA | _BLANK | _DIGIT | _PUNCT, NULL) +# define iswpunct(wc) _iswctype_l(wc, _PUNCT, NULL) +# define iswspace(wc) _iswctype_l(wc, _SPACE, NULL) +# define iswupper(wc) _iswctype_l(wc, _UPPER, NULL) +# define iswxdigit(wc) _iswctype_l(wc, _HEX, NULL) +#endif + #ifdef __cplusplus } #endif
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126739
Your paranoid android.
=== debian11 (32 bit report) ===
ucrtbase: misc.c:567: Test failed: 9 should be blank
=== debian11 (32 bit zh:CN report) ===
ucrtbase: misc.c:567: Test failed: 9 should be blank
=== debian11b (64 bit WoW report) ===
ucrtbase: misc.c:567: Test failed: 9 should be blank