mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
fixes to prevent linking of the compiler floating point emulation functions on different targets
This commit is contained in:
parent
b583073b98
commit
fb775c55f5
@ -118,6 +118,9 @@ static void DumpSize(int32_t x, DumpState* D)
|
||||
|
||||
static void DumpNumber(lua_Number x, DumpState* D)
|
||||
{
|
||||
#if defined( LUA_NUMBER_INTEGRAL ) && !defined( LUA_CROSS_COMPILER )
|
||||
DumpIntWithSize(x,D->target.sizeof_lua_Number,D);
|
||||
#else // #if defined( LUA_NUMBER_INTEGRAL ) && !defined( LUA_CROSS_COMPILER )
|
||||
if (D->target.lua_Number_integral)
|
||||
{
|
||||
if (((float)(int)x)!=x) D->status=LUA_ERR_CC_NOTINTEGER;
|
||||
@ -137,7 +140,7 @@ static void DumpNumber(lua_Number x, DumpState* D)
|
||||
double y=x;
|
||||
// ARM FPA mode: keep endianness, but swap high and low parts of the
|
||||
// memory representation. This is the default compilation mode for ARM
|
||||
// targets (at least with GCC)
|
||||
// targets with non-EABI gcc
|
||||
if(D->target.is_arm_fpa)
|
||||
{
|
||||
char *pnum=(char*)&y, temp[4];
|
||||
@ -151,6 +154,7 @@ static void DumpNumber(lua_Number x, DumpState* D)
|
||||
default: lua_assert(0);
|
||||
}
|
||||
}
|
||||
#endif // #if defined( LUA_NUMBER_INTEGRAL ) && !defined( LUA_CROSS_COMPILER )
|
||||
}
|
||||
|
||||
static void DumpCode(const Proto *f, DumpState* D)
|
||||
|
@ -152,8 +152,10 @@ static int l_unpack(lua_State *L) /** unpack(s,f,[init]) */
|
||||
UNPACKSTRING(OP_WSTRING, unsigned short)
|
||||
UNPACKSTRING(OP_SSTRING, size_t)
|
||||
UNPACKNUMBER(OP_NUMBER, lua_Number)
|
||||
#ifndef LUA_NUMBER_INTEGRAL
|
||||
UNPACKNUMBER(OP_DOUBLE, double)
|
||||
UNPACKNUMBER(OP_FLOAT, float)
|
||||
#endif
|
||||
UNPACKNUMBER(OP_CHAR, char)
|
||||
UNPACKNUMBER(OP_BYTE, unsigned char)
|
||||
UNPACKNUMBER(OP_SHORT, short)
|
||||
@ -234,8 +236,10 @@ static int l_pack(lua_State *L) /** pack(f,...) */
|
||||
PACKSTRING(OP_WSTRING, unsigned short)
|
||||
PACKSTRING(OP_SSTRING, size_t)
|
||||
PACKNUMBER(OP_NUMBER, lua_Number)
|
||||
#ifndef LUA_NUMBER_INTEGRAL
|
||||
PACKNUMBER(OP_DOUBLE, double)
|
||||
PACKNUMBER(OP_FLOAT, float)
|
||||
#endif
|
||||
PACKNUMBER(OP_CHAR, char)
|
||||
PACKNUMBER(OP_BYTE, unsigned char)
|
||||
PACKNUMBER(OP_SHORT, short)
|
||||
|
Loading…
x
Reference in New Issue
Block a user