[Kst] kdeextragear-2/kst/kst

Adriaan de Groot adridg at cs.kun.nl
Sun Dec 28 14:18:48 CET 2003


CVS commit by adridg: 

Make it compile on Solaris and FreeBSD


  M +17 -2     kstvector.cpp   1.51


--- kdeextragear-2/kst/kst/kstvector.cpp  #1.50:1.51
@@ -28,4 +29,18 @@
 #include "kstdoc.h"
 
+
+/*
+** Both Solaris and FreeBSD-current do weird things with the
+** isnan() defined in math.h - in particular on FreeBSD it
+** gets #undeffed by the C++ math routines later. Use the
+** std:: version in those cases.
+*/
+#ifdef isnan
+#define KST_ISNAN(a)    isnan(a)
+#else
+#define KST_ISNAN(a)    std::isnan(a)
+#endif
+
+
 // Use 1 for a simple for() loop
 #define ZERO_MEMORY 2
@@ -114,10 +129,10 @@ double KstVector::interpolate(int in_i, 
   // This is optimized to avoid unnecessary isnan calls!
   if (_v[j + 1] != _v[j + 1]) {
-    if (isnan(_v[j + 1])) {
+    if (KST_ISNAN(_v[j + 1])) {
       return KST::NOPOINT;
     }
   }
   if (_v[j] != _v[j]) {
-    if (isnan(_v[j])) {
+    if (KST_ISNAN(_v[j])) {
       return KST::NOPOINT;
     }





More information about the Kst mailing list