Define wxIsNaN() as std::isnan() in C++11 mode

std::isnan() is always available when using C++11, so just use it.

Also pout the test for C++11 implementations of both wxIsNaN() and wxFinite()
first, eventually the rest of the checks will become obsolete and will be
removed.

See https://github.com/wxWidgets/wxWidgets/pull/283

(cherry picked from commit bc41cbeb25)
This commit is contained in:
Benjamin Drung
2016-05-13 23:18:41 +02:00
committed by Vadim Zeitlin
parent 990ebe2dc2
commit 3cacee9d52

View File

@@ -64,11 +64,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 <cmath>
#define wxFinite(x) std::isfinite(x)
#elif defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
#define wxIsNaN(x) std::isnan(x)
#else /* C++98 */
#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
#include <float.h>
#define wxFinite(x) _finite(x)
#elif defined(__MINGW64_TOOLCHAIN__) || defined(__clang__)
@@ -108,6 +115,8 @@
#define wxIsNaN(x) ((x) != (x))
#endif
#endif /* C++11/C++98 */
#ifdef __INTELC__
inline bool wxIsSameDouble(double x, double y)