[2608] | 1 | --- CEGUILua.cpp Thu Jan 29 20:08:43 2009 |
---|
| 2 | +++ CEGUILua.cpp Thu Jan 29 10:23:36 2009 |
---|
| 3 | @@ -40,7 +40,7 @@ |
---|
[2705] | 4 | #include "lauxlib.h" |
---|
| 5 | } |
---|
| 6 | |
---|
| 7 | -#include "tolua++.h" |
---|
| 8 | +#include "tolua/tolua++.h" |
---|
| 9 | |
---|
| 10 | // prototype for bindings initialisation function |
---|
| 11 | int tolua_CEGUI_open(lua_State* tolua_S); |
---|
[2608] | 12 | @@ -55,19 +55,45 @@ |
---|
[2705] | 13 | *************************************************************************/ |
---|
| 14 | LuaScriptModule::LuaScriptModule() |
---|
| 15 | { |
---|
| 16 | + #if LUA_VERSION_NUM >= 501 |
---|
| 17 | + static const luaL_Reg lualibs[] = { |
---|
| 18 | + {"", luaopen_base}, |
---|
| 19 | + {LUA_LOADLIBNAME, luaopen_package}, |
---|
| 20 | + {LUA_TABLIBNAME, luaopen_table}, |
---|
| 21 | + {LUA_IOLIBNAME, luaopen_io}, |
---|
| 22 | + {LUA_OSLIBNAME, luaopen_os}, |
---|
| 23 | + {LUA_STRLIBNAME, luaopen_string}, |
---|
| 24 | + {LUA_MATHLIBNAME, luaopen_math}, |
---|
| 25 | + #if defined(DEBUG) || defined (_DEBUG) |
---|
| 26 | + {LUA_DBLIBNAME, luaopen_debug}, |
---|
| 27 | + #endif |
---|
| 28 | + {0, 0} |
---|
| 29 | + }; |
---|
| 30 | + #endif /* LUA_VERSION_NUM >= 501 */ |
---|
| 31 | + |
---|
| 32 | // create a lua state |
---|
| 33 | d_ownsState = true; |
---|
| 34 | d_state = lua_open(); |
---|
| 35 | |
---|
| 36 | // init all standard libraries |
---|
| 37 | - luaopen_base(d_state); |
---|
| 38 | - luaopen_io(d_state); |
---|
| 39 | - luaopen_string(d_state); |
---|
| 40 | - luaopen_table(d_state); |
---|
| 41 | - luaopen_math(d_state); |
---|
| 42 | -#if defined(DEBUG) || defined (_DEBUG) |
---|
| 43 | - luaopen_debug(d_state); |
---|
| 44 | -#endif |
---|
| 45 | + #if LUA_VERSION_NUM >= 501 |
---|
| 46 | + const luaL_Reg *lib = lualibs; |
---|
| 47 | + for (; lib->func; lib++) |
---|
| 48 | + { |
---|
| 49 | + lua_pushcfunction(d_state, lib->func); |
---|
| 50 | + lua_pushstring(d_state, lib->name); |
---|
| 51 | + lua_call(d_state, 1, 0); |
---|
| 52 | + } |
---|
| 53 | + #else /* LUA_VERSION_NUM >= 501 */ |
---|
| 54 | + luaopen_base(d_state); |
---|
| 55 | + luaopen_io(d_state); |
---|
| 56 | + luaopen_string(d_state); |
---|
| 57 | + luaopen_table(d_state); |
---|
| 58 | + luaopen_math(d_state); |
---|
| 59 | + #if defined(DEBUG) || defined (_DEBUG) |
---|
| 60 | + luaopen_debug(d_state); |
---|
| 61 | + #endif |
---|
| 62 | + #endif /* LUA_VERSION_NUM >= 501 */ |
---|
| 63 | |
---|
| 64 | setModuleIdentifierString(); |
---|
| 65 | } |
---|
[2608] | 66 | --- CEGUILua.h Thu Jan 29 20:08:23 2009 |
---|
| 67 | +++ CEGUILua.h Thu Jan 29 10:18:39 2009 |
---|
| 68 | @@ -38,7 +38,11 @@ |
---|
[2705] | 69 | # ifdef CEGUILUA_EXPORTS |
---|
| 70 | # define CEGUILUA_API __declspec(dllexport) |
---|
| 71 | # else |
---|
| 72 | -# define CEGUILUA_API __declspec(dllimport) |
---|
| 73 | +# if defined( __MINGW32__ ) |
---|
| 74 | +# define CEGUILUA_API |
---|
| 75 | +# else |
---|
| 76 | +# define CEGUILUA_API __declspec(dllimport) |
---|
| 77 | +# endif |
---|
| 78 | # endif |
---|
| 79 | #else |
---|
| 80 | # define CEGUILUA_API |
---|
[2608] | 81 | --- CEGUILuaFunctor.cpp Thu Jan 29 20:08:38 2009 |
---|
| 82 | +++ CEGUILuaFunctor.cpp Thu Jan 29 10:21:45 2009 |
---|
| 83 | @@ -39,7 +39,7 @@ |
---|
[2705] | 84 | #include "lauxlib.h" |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | -#include "tolua++.h" |
---|
| 88 | +#include "tolua/tolua++.h" |
---|
| 89 | |
---|
| 90 | // Start of CEGUI namespace section |
---|
| 91 | namespace CEGUI |
---|
[2608] | 92 | --- required.h Thu Jan 29 20:08:32 2009 |
---|
| 93 | +++ required.h Thu Jan 29 15:01:58 2009 |
---|
| 94 | @@ -36,6 +36,9 @@ |
---|
[2705] | 95 | #define __operator_decrement operator-- |
---|
| 96 | #define __operator_dereference operator* |
---|
| 97 | |
---|
| 98 | +//This is used to keep compilers happy |
---|
| 99 | +#define CEGUIDeadException(e) & |
---|
| 100 | + |
---|
| 101 | #define LuaFunctorSubscribeEvent CEGUI::LuaFunctor::SubscribeEvent |
---|
| 102 | |
---|
| 103 | #if defined(_MSC_VER) && !defined(snprintf) |
---|