From 125af9f8b8a12413ce1dc83f8a56cebea74c0a02 Mon Sep 17 00:00:00 2001 From: James Snyder Date: Tue, 26 Jan 2010 00:23:57 +0000 Subject: [PATCH] Desktop Builds Get platform_conf.h luarpc & cross compiler builds now have a platform_conf.h which should help in keeping ifdefs down in common source files. --- cross-lua.py | 2 +- inc/luarpc_rpc.h | 6 ------ src/lua/linit.c | 9 --------- src/lua/lstate.c | 2 -- src/modules/luarpc.c | 4 +++- 5 files changed, 4 insertions(+), 19 deletions(-) diff --git a/cross-lua.py b/cross-lua.py index ab3bfbbc..2d6f3411 100644 --- a/cross-lua.py +++ b/cross-lua.py @@ -8,7 +8,7 @@ lua_files = """lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c lmem.c lparser.c lstate.c lstring.c ltable.c ltm.c lundump.c lvm.c lzio.c lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c loslib.c ltablib.c lstrlib.c loadlib.c linit.c luac.c print.c lrotable.c""" lua_full_files = " " + " ".join( [ "src/lua/%s" % name for name in lua_files.split() ] ) -local_include = "-Isrc/lua" +local_include = "-Isrc/lua -Iinc/desktop" # Compiler/linker options cccom = "gcc -O2 %s -Wall %s -c $SOURCE -o $TARGET" % ( local_include, cdefs ) diff --git a/inc/luarpc_rpc.h b/inc/luarpc_rpc.h index 78edd244..d8aa77ff 100644 --- a/inc/luarpc_rpc.h +++ b/inc/luarpc_rpc.h @@ -1,11 +1,5 @@ #include "cexcept.h" #include "type.h" - -#ifdef LUA_RPC -#define LUARPC_ENABLE_SERIAL -#define BUILD_RPC -#endif - #include "serial.h" /****************************************************************************/ diff --git a/src/lua/linit.c b/src/lua/linit.c index 5dd8b086..1c12511b 100644 --- a/src/lua/linit.c +++ b/src/lua/linit.c @@ -14,19 +14,10 @@ #include "lauxlib.h" #include "lrotable.h" #include "luaconf.h" - -#ifndef LUA_CROSS_COMPILER #include "platform_conf.h" -#endif extern int luaopen_platform( lua_State *L ); -#ifdef LUA_RPC -#include "auxmods.h" -#define LUA_PLATFORM_LIBS_ROM \ - _ROM( AUXLIB_RPC, luaopen_rpc, rpc_map ) -#endif - static const luaL_Reg lualibs[] = { {"", luaopen_base}, {LUA_LOADLIBNAME, luaopen_package}, diff --git a/src/lua/lstate.c b/src/lua/lstate.c index d372ff45..66eb8614 100644 --- a/src/lua/lstate.c +++ b/src/lua/lstate.c @@ -22,9 +22,7 @@ #include "lstring.h" #include "ltable.h" #include "ltm.h" -#if !defined(LUA_CROSS_COMPILER) #include "platform_conf.h" -#endif #define state_size(x) (sizeof(x) + LUAI_EXTRASPACE) #define fromstate(l) (cast(lu_byte *, (l)) - LUAI_EXTRASPACE) diff --git a/src/modules/luarpc.c b/src/modules/luarpc.c index a05b2d62..d6ece27b 100644 --- a/src/modules/luarpc.c +++ b/src/modules/luarpc.c @@ -16,6 +16,7 @@ #include #include #include +#include #ifdef __MINGW32__ void *alloca(size_t); #else @@ -28,9 +29,10 @@ void *alloca(size_t); #ifndef LUA_CROSS_COMPILER #include "platform.h" -#include "platform_conf.h" #endif +#include "platform_conf.h" + #ifdef LUA_OPTIMIZE_MEMORY #include "lrotable.h" #endif