diff --git a/radio/src/definitions.h b/radio/src/definitions.h index 47862da04..7a9deddaf 100644 --- a/radio/src/definitions.h +++ b/radio/src/definitions.h @@ -53,9 +53,24 @@ typedef __int24 int24_t; #define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) ) #endif -#if defined(WIN32) +#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(WIN32) #define round(x) floor(x+0.5) #define strcasecmp _stricmp #define strncasecmp _tcsnicmp diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 07e784e03..176e04aaa 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -221,23 +221,6 @@ #define MASTER_VOLUME #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) // 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; diff --git a/radio/src/thirdparty/Lua/src/lundump.c b/radio/src/thirdparty/Lua/src/lundump.c index d732d6f60..a1dd1213f 100644 --- a/radio/src/thirdparty/Lua/src/lundump.c +++ b/radio/src/thirdparty/Lua/src/lundump.c @@ -69,7 +69,7 @@ static lua_Number LoadNumber(LoadState* S) return x; } -static TString* LoadString(LoadState* S) +static TString* Load_String(LoadState* S) { size_t size; LoadVar(S,size); @@ -116,7 +116,7 @@ static void LoadConstants(LoadState* S, Proto* f) setnvalue(o,LoadNumber(S)); break; case LUA_TSTRING: - setsvalue2n(S->L,o,LoadString(S)); + setsvalue2n(S->L,o,Load_String(S)); break; default: lua_assert(0); } @@ -149,7 +149,7 @@ static void LoadUpvalues(LoadState* S, Proto* f) static void LoadDebug(LoadState* S, Proto* f) { int i,n; - f->source=LoadString(S); + f->source=Load_String(S); n=LoadInt(S); f->lineinfo=luaM_newvector(S->L,n,int); f->sizelineinfo=n; @@ -160,12 +160,12 @@ static void LoadDebug(LoadState* S, Proto* f) for (i=0; ilocvars[i].varname=NULL; for (i=0; ilocvars[i].varname=LoadString(S); + f->locvars[i].varname=Load_String(S); f->locvars[i].startpc=LoadInt(S); f->locvars[i].endpc=LoadInt(S); } n=LoadInt(S); - for (i=0; iupvalues[i].name=LoadString(S); + for (i=0; iupvalues[i].name=Load_String(S); } static void LoadFunction(LoadState* S, Proto* f)