1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-20 06:45:10 +03:00

Compilation error fixed

This commit is contained in:
Bertrand Songis 2016-06-30 23:06:03 +02:00
parent 5f03924b5f
commit c777af2b72
3 changed files with 21 additions and 23 deletions

View file

@ -53,9 +53,24 @@ typedef __int24 int24_t;
#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) ) #define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
#endif #endif
#if defined(WIN32) #if defined(SIMU)
#if !defined(FORCEINLINE)
#define FORCEINLINE inline #define FORCEINLINE inline
#endif
#if !defined(NOINLINE)
#define NOINLINE #define NOINLINE
#endif
#define CONVERT_PTR_UINT(x) ((uint32_t)(uint64_t)(x))
#define CONVERT_UINT_PTR(x) ((uint32_t*)(uint64_t)(x))
#else
#define FORCEINLINE inline __attribute__ ((always_inline))
#define NOINLINE __attribute__ ((noinline))
#define SIMU_SLEEP(x)
#define CONVERT_PTR_UINT(x) ((uint32_t)(x))
#define CONVERT_UINT_PTR(x) ((uint32_t *)(x))
#endif
#if defined(WIN32)
#define round(x) floor(x+0.5) #define round(x) floor(x+0.5)
#define strcasecmp _stricmp #define strcasecmp _stricmp
#define strncasecmp _tcsnicmp #define strncasecmp _tcsnicmp

View file

@ -221,23 +221,6 @@
#define MASTER_VOLUME #define MASTER_VOLUME
#endif #endif
#if defined(SIMU)
#if !defined(FORCEINLINE)
#define FORCEINLINE inline
#endif
#if !defined(NOINLINE)
#define NOINLINE
#endif
#define CONVERT_PTR_UINT(x) ((uint32_t)(uint64_t)(x))
#define CONVERT_UINT_PTR(x) ((uint32_t*)(uint64_t)(x))
#else
#define FORCEINLINE inline __attribute__ ((always_inline))
#define NOINLINE __attribute__ ((noinline))
#define SIMU_SLEEP(x)
#define CONVERT_PTR_UINT(x) ((uint32_t)(x))
#define CONVERT_UINT_PTR(x) ((uint32_t *)(x))
#endif
#if !defined(CPUM64) && !defined(ACCURAT_THROTTLE_TIMER) #if !defined(CPUM64) && !defined(ACCURAT_THROTTLE_TIMER)
// code cost is about 16 bytes for higher throttle accuracy for timer // code cost is about 16 bytes for higher throttle accuracy for timer
// would not be noticable anyway, because all version up to this change had only 16 steps; // would not be noticable anyway, because all version up to this change had only 16 steps;

View file

@ -69,7 +69,7 @@ static lua_Number LoadNumber(LoadState* S)
return x; return x;
} }
static TString* LoadString(LoadState* S) static TString* Load_String(LoadState* S)
{ {
size_t size; size_t size;
LoadVar(S,size); LoadVar(S,size);
@ -116,7 +116,7 @@ static void LoadConstants(LoadState* S, Proto* f)
setnvalue(o,LoadNumber(S)); setnvalue(o,LoadNumber(S));
break; break;
case LUA_TSTRING: case LUA_TSTRING:
setsvalue2n(S->L,o,LoadString(S)); setsvalue2n(S->L,o,Load_String(S));
break; break;
default: lua_assert(0); default: lua_assert(0);
} }
@ -149,7 +149,7 @@ static void LoadUpvalues(LoadState* S, Proto* f)
static void LoadDebug(LoadState* S, Proto* f) static void LoadDebug(LoadState* S, Proto* f)
{ {
int i,n; int i,n;
f->source=LoadString(S); f->source=Load_String(S);
n=LoadInt(S); n=LoadInt(S);
f->lineinfo=luaM_newvector(S->L,n,int); f->lineinfo=luaM_newvector(S->L,n,int);
f->sizelineinfo=n; f->sizelineinfo=n;
@ -160,12 +160,12 @@ static void LoadDebug(LoadState* S, Proto* f)
for (i=0; i<n; i++) f->locvars[i].varname=NULL; for (i=0; i<n; i++) f->locvars[i].varname=NULL;
for (i=0; i<n; i++) for (i=0; i<n; i++)
{ {
f->locvars[i].varname=LoadString(S); f->locvars[i].varname=Load_String(S);
f->locvars[i].startpc=LoadInt(S); f->locvars[i].startpc=LoadInt(S);
f->locvars[i].endpc=LoadInt(S); f->locvars[i].endpc=LoadInt(S);
} }
n=LoadInt(S); n=LoadInt(S);
for (i=0; i<n; i++) f->upvalues[i].name=LoadString(S); for (i=0; i<n; i++) f->upvalues[i].name=Load_String(S);
} }
static void LoadFunction(LoadState* S, Proto* f) static void LoadFunction(LoadState* S, Proto* f)