From 846e046203f59c3852f3a3545f67c532f5678a91 Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 8 Feb 2014 20:21:57 +0000 Subject: * configure.in (rb_cv_gnu_qsort_r): use compile error "conflicting types for 'qsort_r'" instead of AC_RUN_IFELSE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 609d797d76..9f8b31f60f 100644 --- a/configure.in +++ b/configure.in @@ -1982,30 +1982,13 @@ RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr, [__builtin_choose_expr(0, 0, 0)]) RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatible_p(int, int)]) if test "$ac_cv_func_qsort_r" != no; then - AC_CACHE_CHECK(that qsort_r is GNU version, rb_cv_gnu_qsort_r, - [AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ + AC_CACHE_CHECK(whether qsort_r is GNU version, rb_cv_gnu_qsort_r, + [AC_TRY_COMPILE([ #include - -int unsorted[] = { 4, 3, 2, 1 }; -int sorted[] = { 1, 2, 3, 4 }; - -int -compar(const void *a, const void *b, void *arg) -{ - if (*(int *)arg != 42) exit(1); - return *(int *)a - *(int *)b; -} - -int -main(void) -{ - int arg = 42; - qsort_r(unsorted, 4, sizeof(int), compar, &arg); - if (memcmp(sorted, unsorted, 4) != 0) return 1; - return 0; -} - ]])], +void qsort_r(void *base, size_t nmemb, size_t size, + int (*compar)(const void *, const void *, void *), + void *arg); +],[ ], [rb_cv_gnu_qsort_r=yes], [rb_cv_gnu_qsort_r=no]) ]) -- cgit v1.2.3