aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-10-13 14:33:47 +0000
committerFilippos Karapetis2010-10-13 14:33:47 +0000
commit090540504db7633bb30fc257a4186b82beb36a0d (patch)
tree4b503c76b35e63d8459c6a7b58637bdef8f3263b
parent62513679c0af9133f7187db6b9de4b59104fa466 (diff)
downloadscummvm-rg350-090540504db7633bb30fc257a4186b82beb36a0d.tar.gz
scummvm-rg350-090540504db7633bb30fc257a4186b82beb36a0d.tar.bz2
scummvm-rg350-090540504db7633bb30fc257a4186b82beb36a0d.zip
SWORD25: Hopefully fixed compilation under Mac OSX, Solaris and mingw32
Taken from sound/softsynth/mt32/tables.cpp lines 28-41 (thanks LordHoto) svn-id: r53425
-rw-r--r--engines/sword25/math/vertex.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/sword25/math/vertex.h b/engines/sword25/math/vertex.h
index 87e4694d48..f9d9a0ff65 100644
--- a/engines/sword25/math/vertex.h
+++ b/engines/sword25/math/vertex.h
@@ -46,6 +46,21 @@
#include <math.h>
#include "sword25/kernel/common.h"
+#if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__)
+// Older versions of Mac OS X didn't supply a powf function, so using it
+// will cause a binary incompatibility when trying to run a binary built
+// on a newer OS X release on an olderr one. And Solaris 8 doesn't provide
+// powf, floorf, fabsf etc. at all.
+// Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in
+// libstdc++. math/stubs.o should be empty, but it comes with a symbol for
+// powf, resulting in a linker error because of multiple definitions.
+// Hence we re-define them here. The only potential drawback is that it
+// might be a little bit slower this way.
+#define powf(x,y) ((float)pow(x,y))
+#define floorf(x) ((float)floor(x))
+#define fabsf(x) ((float)fabs(x))
+#endif
+
namespace Lua {
// Forward declarations