On 1/29/20 12:27 PM, Bruno Haible wrote:
This is assumption is justified by the fact that gnulib's test-isblank.c succeeds on all platforms (as far as I know).
Thanks, the dfa.c usage is for single-byte locales only, so it can make the same assumption. I installed the attached.
>From b58d0cb8fb12dd14e2fb6ba5f48b5ea461b005a1 Mon Sep 17 00:00:00 2001 From: Paul Eggert <egg...@cs.ucla.edu> Date: Wed, 29 Jan 2020 16:47:51 -0800 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/dfa.c | 10 ++++++++++ modules/dfa | 1 - modules/isblank | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2e64116c1..afdccf659 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2020-01-29 Paul Eggert <egg...@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 4e9478394..9939d228a 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 9b112afba..ade4b5a2a 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 dd43acad1..ff4831b16 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: -- 2.24.1