aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gnulib.mk1
-rw-r--r--lib/stdlib.in.h15
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/gnulib.mk b/lib/gnulib.mk
index a691a0b3233..56c210961a7 100644
--- a/lib/gnulib.mk
+++ b/lib/gnulib.mk
@@ -1258,6 +1258,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
1258 -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ 1258 -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
1259 -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ 1259 -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
1260 -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ 1260 -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
1261 -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
1261 -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ 1262 -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
1262 -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ 1263 -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
1263 -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ 1264 -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 70dc88db753..db3253bd970 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -521,6 +521,9 @@ _GL_CXXALIASWARN (putenv);
521#endif 521#endif
522 522
523#if @GNULIB_QSORT_R@ 523#if @GNULIB_QSORT_R@
524/* Sort an array of NMEMB elements, starting at address BASE, each element
525 occupying SIZE bytes, in ascending order according to the comparison
526 function COMPARE. */
524# if @REPLACE_QSORT_R@ 527# if @REPLACE_QSORT_R@
525# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 528# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
526# undef qsort_r 529# undef qsort_r
@@ -535,12 +538,24 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
535 void *), 538 void *),
536 void *arg)); 539 void *arg));
537# else 540# else
541# if !@HAVE_QSORT_R@
542_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
543 int (*compare) (void const *, void const *,
544 void *),
545 void *arg) _GL_ARG_NONNULL ((1, 4)));
546# endif
538_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, 547_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
539 int (*compare) (void const *, void const *, 548 int (*compare) (void const *, void const *,
540 void *), 549 void *),
541 void *arg)); 550 void *arg));
542# endif 551# endif
543_GL_CXXALIASWARN (qsort_r); 552_GL_CXXALIASWARN (qsort_r);
553#elif defined GNULIB_POSIXCHECK
554# undef qsort_r
555# if HAVE_RAW_DECL_QSORT_R
556_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
557 "use gnulib module qsort_r for portability");
558# endif
544#endif 559#endif
545 560
546 561