mirror of
https://github.com/edo9300/ygopro-core
synced 2026-08-25 16:23:07 -04:00
Use -ffloat-store option when building lmathlib.c with mingw
This fixes the result of math.log with some powers of 2 not generating a whole number
This commit is contained in:
parent
e2f5d6de3f
commit
9174f58a5c
1 changed files with 12 additions and 3 deletions
|
|
@ -19,15 +19,24 @@ project "lua"
|
|||
"src/lutf8lib.c",
|
||||
"src/onelua.c"
|
||||
}
|
||||
|
||||
|
||||
includedirs { "./" }
|
||||
forceincludes { "luaconf-customize.h" }
|
||||
if _OPTIONS["lua-apicheck"] then
|
||||
defines "LUA_EPRO_APICHECK"
|
||||
end
|
||||
|
||||
|
||||
-- Workaround for MinGW i386 targetting crtdll.dll, on that C runtime functions returning double
|
||||
-- don't round the values to 64-bit IEEE floats but instead leaves them in the 80-bit float
|
||||
-- registers since they use x87 float instructions. This causes an erroneous results in Lua's
|
||||
-- math.log as the operation log(x)/log(base) is done on 80-bit doubles instead of 64, specifically,
|
||||
-- it affects the log of power of 2s.
|
||||
-- Force GCC to emit code that rounds double results to 64-bits
|
||||
filter { "action:not vs*", "system:windows", "files:src/lmathlib.c" }
|
||||
buildoptions { "-ffloat-store" }
|
||||
|
||||
filter "configurations:Release"
|
||||
optimize "Speed"
|
||||
optimize "Speed"
|
||||
filter "configurations:Debug"
|
||||
optimize "Off"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue