From 802e099e357e8c41508f55df59f34e65daa8a7fd Mon Sep 17 00:00:00 2001 From: janwas Date: Sat, 12 Aug 2006 16:42:50 +0000 Subject: [PATCH] # mac compat tricky issue with isfinite: also stomps on that (C99) macro, instead of only C89 libc. fix: include math.h instead. rationale is documented. This was SVN commit r4224. --- source/lib/precompiled.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/lib/precompiled.h b/source/lib/precompiled.h index 7c8a69e54e..e4db893e33 100644 --- a/source/lib/precompiled.h +++ b/source/lib/precompiled.h @@ -102,7 +102,21 @@ //#include // defines e.g. "and" to "&". unnecessary and causes trouble with asm. #include #include -#include +// Don't use ! libstdc++ on MacOSX is 'clever' and insists on +// 'strict conformance'. That means #undef-ing C99 math macros such as +// isfinite, which is a misguided (who cares if namespace includes isfinite; +// that is a well-known and unlikely to be reimplemented macro) and +// annoying incompatibility with C99. +// simply using math.h avoids the #undefs and is fine because we don't +// use std::cos anywhere. possible alternate fixes: +// - add an e.g. std::isfinite version of our HAVE_C99 emulation macros +// (a good bit of work) +// - #define isfinite to std::isfinite (destroys the utility of +// namespaces) +// - use _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC to prevent libstdc++ from +// #undefing the macros (might work, but hacky and potentially confusing) +//#include +#include // Including setjmp.h here causes incompatibilities with libpng on Debian/Ubuntu //#include #include