[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 69/80: Rely on gnulib for `strerror()` if necessary.
From: |
G. Branden Robinson |
Subject: |
[groff] 69/80: Rely on gnulib for `strerror()` if necessary. |
Date: |
Sat, 30 Nov 2024 04:02:28 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 949b091c22c8df685607746edbddd580e2e44245
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Nov 29 23:53:01 2024 -0600
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
"<config.h"> inclusion do the work, and include "<string.h>"
unconditionally.
---
ChangeLog | 13 +++++++++++++
Makefile.am | 1 -
bootstrap.conf | 1 +
configure.ac | 2 +-
src/include/lib.h | 3 ---
src/roff/groff/pipeline.c | 6 +-----
6 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3ffb8136d..748c5a59d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2024-11-29 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ 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 "<config.h"> inclusion do the work, and include
+ "<string.h>" unconditionally.
+
2024-11-29 G. Branden Robinson <g.branden.robinson@gmail.com>
[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
<http://www.gnu.org/licenses/>. */
#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
<http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <errno.h>
#include <sys/types.h>
+#include <string.h> // strerror(), strsignal()
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_STRERROR
-#include <string.h>
-#else
-extern char *strerror();
-#endif
#ifdef _POSIX_VERSION
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 69/80: Rely on gnulib for `strerror()` if necessary.,
G. Branden Robinson <=