summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-08-22 02:22:05 +0200
committerBruno Haible <bruno@clisp.org>2020-08-22 02:22:05 +0200
commite5f37108fdc3e364e85ff1c92d3dcd075b679bf7 (patch)
treefdd3904671efed1c935cd03f6bdfa1ad761da248 /m4
parent00bd2a9222207390542b5163ff2f04b5acdce9df (diff)
downloadgnulib-e5f37108fdc3e364e85ff1c92d3dcd075b679bf7.tar.gz
sigdescr_np: New module.
* lib/string.in.h (sigdescr_np): New declaration. * lib/sigdescr_np.c: New file. * m4/sigdescr_np.m4: New file. * m4/string_h.m4 (gl_HEADER_STRING_H_BODY): Test whether sigdescr_np is declared. (gl_HEADER_STRING_H_DEFAULTS): Initialize GNULIB_SIGDESCR_NP, HAVE_SIGDESCR_NP. * modules/string (Makefile.am): Substitute GNULIB_SIGDESCR_NP, HAVE_SIGDESCR_NP. * modules/sigdescr_np: New file. * tests/test-string-c++.cc: Verify the signature of sigdescr_np. * doc/glibc-functions/sigdescr_np.texi: Mention the new module.
Diffstat (limited to 'm4')
-rw-r--r--m4/sigdescr_np.m417
-rw-r--r--m4/string_h.m46
2 files changed, 21 insertions, 2 deletions
diff --git a/m4/sigdescr_np.m4 b/m4/sigdescr_np.m4
new file mode 100644
index 0000000000..f0f3f979e8
--- /dev/null
+++ b/m4/sigdescr_np.m4
@@ -0,0 +1,17 @@
+# sigdescr_np.m4 serial 1
+dnl Copyright (C) 2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SIGDESCR_NP],
+[
+ dnl Persuade glibc <string.h> to declare sigdescr_np().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([sigdescr_np])
+ if test $ac_cv_func_sigdescr_np = no; then
+ HAVE_SIGDESCR_NP=0
+ fi
+])
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index d519beaa59..d7c12aaae8 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -5,7 +5,7 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 25
+# serial 26
# Written by Paul Eggert.
@@ -28,7 +28,7 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
]],
[ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
- strerror_r sigabbrev_np strsignal strverscmp])
+ strerror_r sigabbrev_np sigdescr_np strsignal strverscmp])
AC_REQUIRE([AC_C_RESTRICT])
])
@@ -81,6 +81,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR])
GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R])
GNULIB_SIGABBREV_NP=0;AC_SUBST([GNULIB_SIGABBREV_NP])
+ GNULIB_SIGDESCR_NP=0; AC_SUBST([GNULIB_SIGDESCR_NP])
GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
@@ -104,6 +105,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R])
HAVE_SIGABBREV_NP=1; AC_SUBST([HAVE_SIGABBREV_NP])
+ HAVE_SIGDESCR_NP=1; AC_SUBST([HAVE_SIGDESCR_NP])
HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])