1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
naruse 2014-02-08 20:21:57 +00:00
parent 7925015f4c
commit 846e046203
2 changed files with 11 additions and 23 deletions

View file

@ -1,3 +1,8 @@
Sun Feb 9 05:20:24 2014 NARUSE, Yui <naruse@ruby-lang.org>
* configure.in (rb_cv_gnu_qsort_r): use compile error "conflicting
types for 'qsort_r'" instead of AC_RUN_IFELSE.
Sun Feb 9 04:07:34 2014 Zachary Scott <e@zzak.io>
* lib/yaml.rb: [DOC] Add links to syck and psych on github [Bug #9501]

View file

@ -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 <stdlib.h>
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])
])