summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2016-10-16 22:11:32 +0200
committerBruno Haible <bruno@clisp.org>2016-10-27 09:22:29 +0200
commitae23caf43875cd2aba829a4d5ba6f24f261fe7df (patch)
tree73c4fd3148218df441c876947da36afb211f6cc4 /modules
parent174653f46049dab7b2d78b2849a8f518b0f7aeb2 (diff)
downloadgnulib-ae23caf43875cd2aba829a4d5ba6f24f261fe7df.tar.gz
qsort_r: Fix macrology for platforms that lack the function.
* m4/stdlib_h.m4 (gl_STDLIB_H): Check for qsort_r. (gl_STDLIB_H_DEFAULTS): Initialize HAVE_QSORT_R. * modules/stdlib (Makefile.am): Substitute HAVE_QSORT_R. * lib/stdlib.in.h (qsort_r): Provide declaration if the function does not exist. * m4/qsort_r.m4 (gl_FUNC_QSORT_R): Use AC_CHECK_FUNCS to test whether the function exists. * modules/qsort_r: Add comments.
Diffstat (limited to 'modules')
-rw-r--r--modules/qsort_r2
-rw-r--r--modules/stdlib1
2 files changed, 3 insertions, 0 deletions
diff --git a/modules/qsort_r b/modules/qsort_r
index 52b57c0be7..6772edc467 100644
--- a/modules/qsort_r
+++ b/modules/qsort_r
@@ -13,8 +13,10 @@ stdlib
configure.ac:
gl_FUNC_QSORT_R
if test $HAVE_QSORT_R = 0; then
+ # The function is missing from the system or has an unknown signature.
AC_LIBOBJ([qsort])
elif test $REPLACE_QSORT_R = 1; then
+ # The function exists, but it has the BSD signature.
AC_LIBOBJ([qsort_r])
fi
gl_STDLIB_MODULE_INDICATOR([qsort_r])
diff --git a/modules/stdlib b/modules/stdlib
index cbc5b01509..27b1caa3bb 100644
--- a/modules/stdlib
+++ b/modules/stdlib
@@ -79,6 +79,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
-e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
-e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+ -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
-e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
-e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \