[Scummvm-cvs-logs] SF.net SVN: scummvm:[53604] scummvm/trunk/engines/sword25/util/lua/lmathlib .cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Tue Oct 19 11:42:49 CEST 2010
Revision: 53604
http://scummvm.svn.sourceforge.net/scummvm/?rev=53604&view=rev
Author: fingolfin
Date: 2010-10-19 09:42:48 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
SWORD25: Work around for bug in Mac OS X 10.2 SDK
Modified Paths:
--------------
scummvm/trunk/engines/sword25/util/lua/lmathlib.cpp
Modified: scummvm/trunk/engines/sword25/util/lua/lmathlib.cpp
===================================================================
--- scummvm/trunk/engines/sword25/util/lua/lmathlib.cpp 2010-10-19 09:23:20 UTC (rev 53603)
+++ scummvm/trunk/engines/sword25/util/lua/lmathlib.cpp 2010-10-19 09:42:48 UTC (rev 53604)
@@ -252,7 +252,17 @@
luaL_register(L, LUA_MATHLIBNAME, mathlib);
lua_pushnumber(L, PI);
lua_setfield(L, -2, "pi");
+#if defined(MACOSX) && defined(__GNUC__) && ! defined( __XLC__ )
+ // WORKAROUND for a bug in the Mac OS X 10.2.8 SDK. It defines
+ // HUGE_VAL simply to 1e500, leading to this compiler error:
+ // error: floating constant exceeds range of 'double'
+ // However, GCC (at least the version we are using for our cross
+ // compiler) has a __builtin_huge_val which returns the correct
+ // value, so we just use that.
+ lua_pushnumber(L, __builtin_huge_val());
+#else
lua_pushnumber(L, HUGE_VAL);
+#endif
lua_setfield(L, -2, "huge");
#if defined(LUA_COMPAT_MOD)
lua_getfield(L, -1, "fmod");
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