summaryrefslogtreecommitdiff
path: root/lib/regex_internal.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-09-23 16:45:16 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-09-23 17:04:42 -0700
commit800f530a9c19d8e0b36f3c128d9abba386d9db92 (patch)
treee8425d498f8f82f328492dc755bce1bbf5b1fcff /lib/regex_internal.h
parent4a3aec702f994f3a16e4bc6c51f2c0ae3dd76a02 (diff)
downloadgnulib-800f530a9c19d8e0b36f3c128d9abba386d9db92.tar.gz
regex: port to weird isascii platforms
* lib/regex_internal.h (isascii) [!_LIBC]: Supply glibc version.
Diffstat (limited to 'lib/regex_internal.h')
-rw-r--r--lib/regex_internal.h8
1 files changed, 8 insertions, 0 deletions
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