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
46
47
48
49
50
51
52
53
54
55
56
57
58
|
$NetBSD: patch-el,v 1.2 2011/07/11 09:57:18 ryoon Exp $
NetBSD 4.0 (actually around 4.99.10) and prior don't have some C99 FP macro.
(PR pkg/42899)
--- fpu/softfloat-native.h.orig 2011-05-06 19:01:43.000000000 +0000
+++ fpu/softfloat-native.h
@@ -19,11 +19,15 @@
* or Solaris 10 systems running GCC 3.x or less.
* Solaris 10 with GCC4 does not need these macros as they
* are defined in <iso/math_c99.h> with a compiler directive
+ *
+ * NetBSD has got these macro around 4.99.10
+ * (i.e. 5.0 release and later)
*/
#if defined(CONFIG_SOLARIS) && \
((CONFIG_SOLARIS_VERSION <= 9 ) || \
((CONFIG_SOLARIS_VERSION == 10) && (__GNUC__ < 4))) \
- || (defined(__OpenBSD__) && (OpenBSD < 200811))
+ || (defined(__OpenBSD__) && (OpenBSD < 200811)) \
+ || (defined(__NetBSD__) && (__NetBSD_Version__ < 499001000))
/*
* C99 7.12.3 classification macros
* and
@@ -32,30 +36,13 @@
* ... do not work on Solaris 10 using GNU CC 3.4.x.
* Try to workaround the missing / broken C99 math macros.
*/
-#if defined(__OpenBSD__)
+#if defined(__OpenBSD__) || defined(__NetBSD__)
#define unordered(x, y) (isnan(x) || isnan(y))
#endif
-#ifdef __NetBSD__
-#ifndef isgreater
-#define isgreater(x, y) __builtin_isgreater(x, y)
-#endif
-#ifndef isgreaterequal
-#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
-#endif
-#ifndef isless
-#define isless(x, y) __builtin_isless(x, y)
-#endif
-#ifndef islessequal
-#define islessequal(x, y) __builtin_islessequal(x, y)
-#endif
-#ifndef isunordered
-#define isunordered(x, y) __builtin_isunordered(x, y)
-#endif
-#endif
-
-
+#if !defined(__NetBSD__) /* NetBSD has had isnormal() since 2.0 */
#define isnormal(x) (fpclass(x) >= FP_NZERO)
+#endif
#define isgreater(x, y) ((!unordered(x, y)) && ((x) > (y)))
#define isgreaterequal(x, y) ((!unordered(x, y)) && ((x) >= (y)))
#define isless(x, y) ((!unordered(x, y)) && ((x) < (y)))
|