From: Paul Eggert Date: Thu, 30 Jan 2020 00:47:51 +0000 (-0800) Subject: dfa: do not depend on isblank X-Git-Tag: v1.0~4289 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=b58d0cb8fb12dd14e2fb6ba5f48b5ea461b005a1;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 2e64116c17..afdccf659d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2020-01-29 Paul Eggert + 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: