diff --git a/ChangeLog b/ChangeLog index 3ffb8136d..748c5a59d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2024-11-29 G. Branden Robinson + + Rely on gnulib for `strerror()` if necessary. + + * bootstrap.conf: Add "strerror" to `gnulib_modules`. + * configure.ac: Drop "sterror" from `AC_REPLACE_FUNCS`; we don't + need Autoconf's replacement if we've got gnulib's. + * Makefile.am: Drop mention of function/macro in comment. + * src/include/lib.h: Drop C preprocessor conditional logic. + * src/roff/groff/pipeline.c: Drop fallback definition. Let + existing " inclusion do the work, and include + "" unconditionally. + 2024-11-29 G. Branden Robinson [troff]: Align with modern groff conventions. diff --git a/Makefile.am b/Makefile.am index 43d9c20b1..43b9d0630 100644 --- a/Makefile.am +++ b/Makefile.am @@ -307,7 +307,6 @@ man7dir=$(manroot)/man$(man7ext) # HAVE_SETLOCALE if you have setlocale() # HAVE_STRCASECMP if you have strcasecmp() # HAVE_STRNCASECMP if you have strncasecmp() -# HAVE_STRERROR if you have strerror() # HAVE_STRSEP if you have strsep() # HAVE_STRTOL if you have strtol() # HAVE_SYMLINK if you have symlink() diff --git a/bootstrap.conf b/bootstrap.conf index e5cbec15b..b4652f4ff 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -49,6 +49,7 @@ gnulib_modules=" stdbool-c99 stdckdint stdint + strerror sys_wait " diff --git a/configure.ac b/configure.ac index c30dd9a39..5002eeb33 100644 --- a/configure.ac +++ b/configure.ac @@ -130,7 +130,7 @@ AC_FUNC_MMAP saved_libs="$LIBS" LIBS="$LIBS $LIBC $LIBM" AC_REPLACE_FUNCS([fmod getcwd putenv strcasecmp \ - strerror strncasecmp strtol]) + strncasecmp strtol]) LIBS="$saved_libs" AC_CHECK_FUNCS([gettimeofday isatty kill rename setlocale strdup \ strsep]) diff --git a/src/include/lib.h b/src/include/lib.h index c65efe1aa..6a04dbd12 100644 --- a/src/include/lib.h +++ b/src/include/lib.h @@ -25,9 +25,6 @@ along with this program. If not, see . */ #ifdef __cplusplus extern "C" { -#endif -#ifndef HAVE_STRERROR - char *strerror(int); #endif const char *i_to_a(int); const char *ui_to_a(unsigned int); diff --git a/src/roff/groff/pipeline.c b/src/roff/groff/pipeline.c index 281905b9b..502a37e34 100644 --- a/src/roff/groff/pipeline.c +++ b/src/roff/groff/pipeline.c @@ -25,15 +25,11 @@ along with this program. If not, see . */ #include #include #include +#include // strerror(), strsignal() #ifdef HAVE_UNISTD_H #include #endif -#ifdef HAVE_STRERROR -#include -#else -extern char *strerror(); -#endif #ifdef _POSIX_VERSION