[前][次][番号順一覧][スレッド一覧]

ruby-changes:32815

From: naruse <ko1@a...>
Date: Sun, 9 Feb 2014 05:22:01 +0900 (JST)
Subject: [ruby-changes:32815] naruse:r44894 (trunk): * configure.in (rb_cv_gnu_qsort_r): use compile error "conflicting

naruse	2014-02-09 05:21:57 +0900 (Sun, 09 Feb 2014)

  New Revision: 44894

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44894

  Log:
    * configure.in (rb_cv_gnu_qsort_r): use compile error "conflicting
      types for 'qsort_r'" instead of AC_RUN_IFELSE.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
Index: configure.in
===================================================================
--- configure.in	(revision 44893)
+++ configure.in	(revision 44894)
@@ -1982,30 +1982,13 @@ RUBY_CHECK_BUILTIN_FUNC(__builtin_choose https://github.com/ruby/ruby/blob/trunk/configure.in#L1982
 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])
   ])
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44893)
+++ ChangeLog	(revision 44894)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Feb  9 05:20:24 2014  NARUSE, Yui  <naruse@r...>
+
+	* 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@z...>
 
 	* lib/yaml.rb: [DOC] Add links to syck and psych on github [Bug #9501]

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]