From: Václav Slavík Date: Tue, 9 Jul 2013 15:44:01 +0000 (+0000) Subject: Work around wxFinite() definition conflict with . X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f256de112505e09777bfad8690338a09baa0ef8e?ds=inline Work around wxFinite() definition conflict with . Using the GNU libstdc++ or Clang's libc++ implementations of the standard library, inclusion undefines the isfinite macro, resulting in compilation errors when wxFinite() is used. can be included unintentionally, e.g. wx/hashmap.h may result in its inclusion when using STD containers. Work around this mess by checking if one of these implementations were already included and using std::isfinite() in that case. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/math.h b/include/wx/math.h index 5240f1759e..c1dda9e6d2 100644 --- a/include/wx/math.h +++ b/include/wx/math.h @@ -62,7 +62,12 @@ add more compilers with C99 support here: using C99 isfinite() is preferable to using BSD-ish finite() */ - #define wxFinite(x) isfinite(x) + #if defined(_GLIBCXX_CMATH) || defined(_LIBCPP_CMATH) + // these headers #undef isfinite + #define wxFinite(x) std::isfinite(x) + #else + #define wxFinite(x) isfinite(x) + #endif #elif ( defined(__GNUG__)||defined(__GNUWIN32__)||defined(__DJGPP__)|| \ defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \ defined(__HPUX__) ) && ( !defined(wxOSX_USE_IPHONE) || wxOSX_USE_IPHONE == 0 )