From: Paul Eggert Date: Wed, 23 Sep 2020 23:45:16 +0000 (-0700) Subject: regex: port to weird isascii platforms X-Git-Tag: v1.0~3608 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=800f530a9c19d8e0b36f3c128d9abba386d9db92;p=gnulib.git regex: port to weird isascii platforms * lib/regex_internal.h (isascii) [!_LIBC]: Supply glibc version. --- diff --git a/ChangeLog b/ChangeLog index 188bb8f2fe..d15f158abf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-09-23 Paul Eggert + + regex: port to weird isascii platforms + * lib/regex_internal.h (isascii) [!_LIBC]: Supply glibc version. + 2020-09-20 Norihiro Tanaka dfa: make dfasupported a global function diff --git a/lib/regex_internal.h b/lib/regex_internal.h index dbc503cd55..4a3cf779bf 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -77,6 +77,14 @@ # define isblank(ch) ((ch) == ' ' || (ch) == '\t') #endif +/* regex code assumes isascii has its usual numeric meaning, + even if the portable character set uses EBCDIC encoding, + and even if wint_t is wider than int. */ +#ifndef _LIBC +# undef isascii +# define isascii(c) (((c) & ~0x7f) == 0) +#endif + #ifdef _LIBC # ifndef _RE_DEFINE_LOCALE_FUNCTIONS # define _RE_DEFINE_LOCALE_FUNCTIONS 1