[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] regex: port to weird isascii platforms
From: |
Paul Eggert |
Subject: |
[PATCH 1/2] regex: port to weird isascii platforms |
Date: |
Wed, 23 Sep 2020 17:05:02 -0700 |
* 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 <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
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
- [PATCH 1/2] regex: port to weird isascii platforms,
Paul Eggert <=