summaryrefslogtreecommitdiff
blob: c2cf6eebf187f5d6c2b174030b058082facacaee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
diff -urp ruby-2.0.0-p353/missing/isinf.c ruby-2.0.0-p353-uclibc/missing/isinf.c
--- ruby-2.0.0-p353/missing/isinf.c	2011-05-15 07:55:52.000000000 -0400
+++ ruby-2.0.0-p353-uclibc/missing/isinf.c	2014-02-01 09:19:31.000000000 -0500
@@ -52,6 +52,7 @@ static double zero(void) { return 0.0; }
 static double one (void) { return 1.0; }
 static double inf (void) { return one() / zero(); }
 
+#ifndef isinf
 int
 isinf(double n)
 {
@@ -67,3 +68,4 @@ isinf(double n)
 }
 #endif
 #endif
+#endif
diff -urp ruby-2.0.0-p353/missing/isnan.c ruby-2.0.0-p353-uclibc/missing/isnan.c
--- ruby-2.0.0-p353/missing/isnan.c	2010-07-28 04:12:01.000000000 -0400
+++ ruby-2.0.0-p353-uclibc/missing/isnan.c	2014-01-31 22:12:44.000000000 -0500
@@ -2,6 +2,20 @@
 
 #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)
 {
     return n1 != n2;
 }
+#endif