From 5659a79453e601d66719ed4e88861136bae9a49c Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 8 Feb 2014 23:56:11 +0000 Subject: [PATCH] * configure.in (rb_cv_bsd_qsort_r): ensure 'qsort_r' is not BSD version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 9f8b31f60f..678fe18e01 100644 --- a/configure.in +++ b/configure.in @@ -1984,7 +1984,7 @@ RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatibl if test "$ac_cv_func_qsort_r" != no; then AC_CACHE_CHECK(whether qsort_r is GNU version, rb_cv_gnu_qsort_r, [AC_TRY_COMPILE([ -#include +@%:@include void qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *arg); @@ -1992,9 +1992,19 @@ void qsort_r(void *base, size_t nmemb, size_t size, [rb_cv_gnu_qsort_r=yes], [rb_cv_gnu_qsort_r=no]) ]) - if test "$rb_cv_gnu_qsort_r" != no; then + AC_CACHE_CHECK(whether qsort_r is BSD version, rb_cv_bsd_qsort_r, + [AC_TRY_COMPILE([ +@%:@include +void qsort_r(void *base, size_t nmemb, size_t size, + void *arg, int (*compar)(void *, const void *, const void *)); +],[ ], + [rb_cv_bsd_qsort_r=yes], + [rb_cv_bsd_qsort_r=no]) + ]) + AS_CASE("$rb_cv_gnu_qsort_r:$rb_cv_bsd_qsort_r", + [yes:no], [ AC_DEFINE(HAVE_GNU_QSORT_R, 1) - fi + ]) fi # Some platform need -lrt for clock_gettime, but the other don't.