patch for kdiagram

Jack Ostroff ostroffjh at users.sourceforge.net
Fri Sep 2 22:29:40 UTC 2016


extragear/kdiagram fails to compile with mingw due to not finding _isnan 
and _finite.  I wouldn't propose applying this patch as is, since I 
don't know what else it might break, but it does let me complete the 
emerge of kdiagram.

If the attachment doesn't get through, it is just a replacement of
_isnan with std::isnan and of _finite with std::isfinite in the file 
src/KChart/KChartMath_p.h.  As I understand it, the _xxx macros are not 
defined on Windows, but the c++ standard does include isnan and isfinite.

Jack
-------------- next part --------------
diff --git a/src/KChart/KChartMath_p.h b/src/KChart/KChartMath_p.h
index abbc2e5..0fe6d40 100644
--- a/src/KChart/KChartMath_p.h
+++ b/src/KChart/KChartMath_p.h
@@ -49,8 +49,12 @@
 // reason: Windows does not have isnan() / isinf()
 #if defined (Q_OS_WIN)
 #include <float.h>
-#define ISNAN(x ) _isnan(x )
-#define ISINF(x ) (!(_finite(x ) + _isnan(x ) ) )
+///following modified from git.reviewboard.kde.org/r/116866
+//#define ISNAN(x ) _isnan(x )
+#define ISNAN(x) std::isnan(x)
+/// guessing this change based on above
+//#define ISINF(x ) (!(_finite(x ) + _isnan(x ) ) )
+#define ISINF(x) (!(std::isfinite(x) + std::isnan(x) ) )
 #elif defined (Q_OS_DARWIN)
 // OS X does have isnan() & isinf() in math.h, but it appears to be
 // required to cast the argument to a double explicitly.


More information about the Kde-windows mailing list