Improve workaround for MinGW math.h bug in strict ANSI mode.

Declare _hypot() function globally, predefining __NO_INLINE__ in wx/math.h is
not enough as <math.h> is also included from some other standard headers, e.g.
<algorithm>, and including them results in the same bug as in wx/math.h
(i.e. https://sourceforge.net/p/mingw/bugs/2250/).
This commit is contained in:
Vadim Zeitlin
2015-06-15 02:21:58 +02:00
parent 095cf87eb6
commit 6787d2268a
2 changed files with 9 additions and 11 deletions

View File

@@ -151,6 +151,15 @@
*/
#define wxDECL_FOR_STRICT_MINGW32(rettype, func, params) \
extern "C" _CRTIMP rettype __cdecl __MINGW_NOTHROW func params ;
/*
There is a bug resulting in a compilation error in MinGW standard
math.h header, see https://sourceforge.net/p/mingw/bugs/2250/, work
around it here because math.h is also included from several other
standard headers (e.g. <algorithm>) and we don't want to duplicate this
hack everywhere this happens.
*/
wxDECL_FOR_STRICT_MINGW32(double, _hypot, (double, double));
#else
#define wxDECL_FOR_STRICT_MINGW32(rettype, func, params)
#endif