[Scummvm-cvs-logs] SF.net SVN: scummvm:[53425] scummvm/trunk/engines/sword25/math/vertex.h

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Oct 13 16:33:47 CEST 2010


Revision: 53425
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53425&view=rev
Author:   thebluegr
Date:     2010-10-13 14:33:47 +0000 (Wed, 13 Oct 2010)

Log Message:
-----------
SWORD25: Hopefully fixed compilation under Mac OSX, Solaris and mingw32

Taken from sound/softsynth/mt32/tables.cpp lines 28-41 (thanks LordHoto)

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/math/vertex.h

Modified: scummvm/trunk/engines/sword25/math/vertex.h
===================================================================
--- scummvm/trunk/engines/sword25/math/vertex.h	2010-10-13 14:21:27 UTC (rev 53424)
+++ scummvm/trunk/engines/sword25/math/vertex.h	2010-10-13 14:33:47 UTC (rev 53425)
@@ -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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list