bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: bug-gnulib@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: [PATCH 1/2] regex: port to weird isascii platforms
Date: Wed, 23 Sep 2020 17:05:02 -0700	[thread overview]
Message-ID: <20200924000503.311248-1-eggert@cs.ucla.edu> (raw)

* 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



             reply	other threads:[~2020-09-24  0:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24  0:05 Paul Eggert [this message]
2020-09-24  0:05 ` [PATCH 2/2] regex: fix ignore-case Turkish bug Paul Eggert
2020-09-26 13:57   ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200924000503.311248-1-eggert@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).