aboutsummaryrefslogtreecommitdiff
path: root/ports/plplot/use-math-h-nan.patch
blob: 1f398773086da8edf6eff638e68b6b45e2eda53e (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
diff --git "a/lib/csa/nan.h" "b/lib/csa/nan.h"
index 29fd3d2f..7f16e8c8 100644
--- "a/lib/csa/nan.h"
+++ "b/lib/csa/nan.h"
@@ -19,6 +19,16 @@
 #if !defined ( _NAN_H )
 #define _NAN_H

+// Try to use the implementation-provided NAN constant:
+
+#include <math.h>
+
+#if defined(NAN)
+
+#define NaN ((double)NAN)
+
+#else // ^^^ implementation provides NAN // implementation does not provide NAN vvv
+
 #if ( defined ( __GNUC__ ) && !defined ( __ICC ) ) || defined ( __BORLANDC__ )

 static const double NaN = 0.0 / 0.0;
@@ -63,4 +73,6 @@ static const long long lNaN = ( (unsigned long long) 1 << 63 ) - 1;

 #endif

+#endif // defined(NAN)
+
 #endif