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

ruby-changes:28370

From: akr <ko1@a...>
Date: Tue, 23 Apr 2013 20:27:21 +0900 (JST)
Subject: [ruby-changes:28370] akr:r40422 (trunk): * missing/isnan.c (isnan): Don't define if isnan() macro is defined.

akr	2013-04-23 20:27:07 +0900 (Tue, 23 Apr 2013)

  New Revision: 40422

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

  Log:
    * missing/isnan.c (isnan): Don't define if isnan() macro is defined.
      This fixes a compilation failure on uClibc based Gentoo system.

  Modified files:
    trunk/ChangeLog
    trunk/missing/isnan.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40421)
+++ ChangeLog	(revision 40422)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Apr 23 20:10:02 2013  Tanaka Akira  <akr@f...>
+
+	* missing/isnan.c (isnan): Don't define if isnan() macro is defined.
+	  This fixes a compilation failure on uClibc based Gentoo system.
+
 Tue Apr 23 17:40:40 2013  Martin Duerst <duerst@i...>
 
 	* lib/rexml/document.rb, lib/rexml/element.rb,
Index: missing/isnan.c
===================================================================
--- missing/isnan.c	(revision 40421)
+++ missing/isnan.c	(revision 40422)
@@ -2,6 +2,20 @@ https://github.com/ruby/ruby/blob/trunk/missing/isnan.c#L2
 
 #include "ruby/missing.h"
 
+/*
+ * isnan() may be a macro, a function or both.
+ * (The C99 standard defines that isnan() is a macro, though.)
+ * http://www.gnu.org/software/automake/manual/autoconf/Function-Portability.html
+ *
+ * macro only: uClibc
+ * both: GNU libc
+ *
+ * This file is compile if no isnan() function is available.
+ * (autoconf AC_REPLACE_FUNCS detects only the function.)
+ * The macro is detected by following #ifndef.
+ */
+
+#ifndef isnan
 static int double_ne(double n1, double n2);
 
 int
@@ -15,3 +29,4 @@ double_ne(double n1, double n2) https://github.com/ruby/ruby/blob/trunk/missing/isnan.c#L29
 {
     return n1 != n2;
 }
+#endif

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

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