summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-01-29 16:47:51 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2020-01-29 16:48:30 -0800
commitb58d0cb8fb12dd14e2fb6ba5f48b5ea461b005a1 (patch)
treed2bee14e08cb9961d28f74d8f00cc3fa855daae8
parentbaa7dd2be88e43303842b253c30490b0eb175f1e (diff)
downloadgnulib-b58d0cb8fb12dd14e2fb6ba5f48b5ea461b005a1.tar.gz
dfa: do not depend on isblank
This removes a difference between Gawk dfa.c and Gnulib dfa.c. * lib/dfa.c (isblank): Define if neither system nor Gnulib does. * modules/dfa (Depends-on): Remove isblank. * modules/isblank: Add a module indicator, for lib/dfa.c.
-rw-r--r--ChangeLog6
-rw-r--r--lib/dfa.c10
-rw-r--r--modules/dfa1
-rw-r--r--modules/isblank1
4 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e64116c17..afdccf659d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2020-01-29 Paul Eggert <eggert@cs.ucla.edu>
+ dfa: do not depend on isblank
+ This removes a difference between Gawk dfa.c and Gnulib dfa.c.
+ * lib/dfa.c (isblank): Define if neither system nor Gnulib does.
+ * modules/dfa (Depends-on): Remove isblank.
+ * modules/isblank: Add a module indicator, for lib/dfa.c.
+
dfa: do not assume 64-bit int
Problem reported for VAX/VMS C (!) by Arnold Robbins in:
https://lists.gnu.org/r/bug-gnulib/2020-01/msg00173.html
diff --git a/lib/dfa.c b/lib/dfa.c
index 4e9478394c..9939d228a8 100644
--- a/lib/dfa.c
+++ b/lib/dfa.c
@@ -81,6 +81,16 @@ isasciidigit (char c)
# undef clrbit
#endif
+/* For code that does not use Gnulib’s isblank module. */
+#if !defined isblank && !defined HAVE_ISBLANK && !defined GNULIB_ISBLANK
+# define isblank dfa_isblank
+static int
+isblank (int c)
+{
+ return c == ' ' || c == '\t';
+}
+#endif
+
/* First integer value that is greater than any character code. */
enum { NOTCHAR = 1 << CHAR_BIT };
diff --git a/modules/dfa b/modules/dfa
index 9b112afbae..ade4b5a2a5 100644
--- a/modules/dfa
+++ b/modules/dfa
@@ -13,7 +13,6 @@ c99
ctype
flexmember
intprops
-isblank
locale
regex
stdbool
diff --git a/modules/isblank b/modules/isblank
index dd43acad1f..ff4831b16e 100644
--- a/modules/isblank
+++ b/modules/isblank
@@ -14,6 +14,7 @@ gl_FUNC_ISBLANK
if test $HAVE_ISBLANK = 0; then
AC_LIBOBJ([isblank])
fi
+gl_MODULE_INDICATOR([isblank])
gl_CTYPE_MODULE_INDICATOR([isblank])
Makefile.am: