]> Savannah Git Hosting - gnulib.git/commitdiff
regex: port to weird isascii platforms
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 23 Sep 2020 23:45:16 +0000 (16:45 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 24 Sep 2020 00:04:42 +0000 (17:04 -0700)
* lib/regex_internal.h (isascii) [!_LIBC]: Supply glibc version.

ChangeLog
lib/regex_internal.h

index 188bb8f2fe670a32c01aac253823f4cf43066588..d15f158abf84ea50d6cadca62127502f159daa38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-09-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       regex: port to weird isascii platforms
+       * lib/regex_internal.h (isascii) [!_LIBC]: Supply glibc version.
+
 2020-09-20  Norihiro Tanaka  <noritnk@kcn.ne.jp>
 
        dfa: make dfasupported a global function
index dbc503cd5564e360e5a19f6236a5ed4ec0a5a018..4a3cf779bf2afe125eaf61f83ddf2d4295c86bc8 100644 (file)
 # 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