-#elif defined(__MINGW64__)
- // add more compilers with C99 support here: using C99 isfinite() is
- // preferable to using BSD-ish finite()
- #define wxFinite(x) isfinite(x)
+#elif defined(__MINGW64__) || defined(__clang__)
+ /*
+ add more compilers with C99 support here: using C99 isfinite() is
+ preferable to using BSD-ish finite()
+ */
+ #if defined(_GLIBCXX_CMATH) || defined(_LIBCPP_CMATH)
+ // these <cmath> headers #undef isfinite
+ #define wxFinite(x) std::isfinite(x)
+ #else
+ #define wxFinite(x) isfinite(x)
+ #endif