diff --git a/include/wx/math.h b/include/wx/math.h index 23ff2f031a..544b5c7d6e 100644 --- a/include/wx/math.h +++ b/include/wx/math.h @@ -53,11 +53,18 @@ #ifdef __cplusplus -/* Any C++11 compiler should provide isfinite() */ +/* + Things are simple with C++11: we have everything we need in std. + Eventually we will only have this section and not the legacy stuff below. + */ #if __cplusplus >= 201103 #include + #define wxFinite(x) std::isfinite(x) -#elif defined(__VISUALC__) || defined(__BORLANDC__) + #define wxIsNaN(x) std::isnan(x) +#else /* C++98 */ + +#if defined(__VISUALC__) || defined(__BORLANDC__) #include #define wxFinite(x) _finite(x) #elif defined(__MINGW64_TOOLCHAIN__) || defined(__clang__) @@ -97,6 +104,8 @@ #define wxIsNaN(x) ((x) != (x)) #endif +#endif /* C++11/C++98 */ + #ifdef __INTELC__ inline bool wxIsSameDouble(double x, double y)