* lib/regex_internal.h (isascii) [!_LIBC]: Supply glibc version. --- ChangeLog | 5 +++++ lib/regex_internal.h | 8 ++++++++ 2 files changed, 13 insertions(+)
diff --git a/ChangeLog b/ChangeLog index 188bb8f2f..d15f158ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-09-23 Paul Eggert <egg...@cs.ucla.edu> + + regex: port to weird isascii platforms + * lib/regex_internal.h (isascii) [!_LIBC]: Supply glibc version. + 2020-09-20 Norihiro Tanaka <nori...@kcn.ne.jp> dfa: make dfasupported a global function diff --git a/lib/regex_internal.h b/lib/regex_internal.h index dbc503cd5..4a3cf779b 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 -- 2.25.4