diff options
author | Pixel <pixel@nobis-crew.org> | 2008-09-26 15:41:08 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2008-09-26 15:41:08 -0700 |
commit | 48f6062b651dc83608d27984eeccd69206e34ed0 (patch) | |
tree | 1ffe3537761ba4d5ae42b953bc9d168b71049b6b /src | |
parent | 9f44749ed1361b2c4ee5b8bcb5f53177faff9d0c (diff) |
Adding MSVC support.
Diffstat (limited to 'src')
-rw-r--r-- | src/lua-interface.cpp | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/src/lua-interface.cpp b/src/lua-interface.cpp index af93ec4..9474040 100644 --- a/src/lua-interface.cpp +++ b/src/lua-interface.cpp @@ -48,25 +48,33 @@ #include "lua-interface-hc.h" +#ifndef _MSVC +#define WEAK __attribute__ ((weak)) +#else +#define WEAK +#endif + extern "C" { -extern void luaconfigfiles_init(Lua * L) __attribute__ ((weak)); -extern void luaftgl_init(Lua * L) __attribute__ ((weak)); -extern void luagl_init(Lua * L) __attribute__ ((weak)); -extern void luahandle_init(Lua * L) __attribute__ ((weak)); -extern void luahttp_init(Lua * L) __attribute__ ((weak)); -extern void lualibs_init(Lua * L) __attribute__ ((weak)); -extern void luaocci_init(Lua * L) __attribute__ ((weak)); -extern void luaregex_init(Lua * L) __attribute__ ((weak)); -extern void luasql_init(Lua * L) __attribute__ ((weak)); -extern void luatask_init(Lua * L) __attribute__ ((weak)); -extern void luaxml_init(Lua * L) __attribute__ ((weak)); -extern void luaosmesa_init(Lua * L) __attribute__ ((weak)); +extern void luaconfigfiles_init(Lua * L) WEAK; +extern void luaftgl_init(Lua * L) WEAK; +extern void luagl_init(Lua * L) WEAK; +extern void luahandle_init(Lua * L) WEAK; +extern void luahttp_init(Lua * L) WEAK; +extern void lualibs_init(Lua * L) WEAK; +extern void luaocci_init(Lua * L) WEAK; +extern void luaregex_init(Lua * L) WEAK; +extern void luasql_init(Lua * L) WEAK; +extern void luatask_init(Lua * L) WEAK; +extern void luaxml_init(Lua * L) WEAK; +extern void luaosmesa_init(Lua * L) WEAK; } #ifdef _WIN32 +#ifndef NO_DLL #define main win32_dll_main +#endif #include <windows.h> #include <ctype.h> @@ -298,20 +306,24 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in break; case BASELUA_INTERFACE_LOADMODULE: filename = L->tostring(); - if ((filename == "luaconfigfiles") && (luaconfigfiles_init != NULL)) { + if ((filename == "luaconfigfiles") && (luaconfigfiles_init != NULL)) { luaconfigfiles_init(L); +#ifndef _MSVC } else if ((filename == "luaftgl") && (luaftgl_init != NULL)) { luaftgl_init(L); } else if ((filename == "luagl") && (luagl_init != NULL)) { luagl_init(L); +#endif } else if ((filename == "luahandle") && (luahandle_init != NULL)) { luahandle_init(L); } else if ((filename == "luahttp") && (luahttp_init != NULL)) { luahttp_init(L); } else if ((filename == "lualibs") && (lualibs_init != NULL)) { lualibs_init(L); +#ifndef _MSVC } else if ((filename == "luaocci") && (luaocci_init != NULL)) { luaocci_init(L); +#endif } else if ((filename == "luaregex") && (luaregex_init != NULL)) { luaregex_init(L); } else if ((filename == "luasql") && (luasql_init != NULL)) { @@ -320,8 +332,10 @@ int sLua_baselua_interface::baselua_interface_proceed_statics(Lua * L, int n, in luatask_init(L); } else if ((filename == "luaxml") && (luaxml_init != NULL)) { luaxml_init(L); +#ifndef _MSVC } else if ((filename == "luaosmesa") && (luaosmesa_init != NULL)) { luaosmesa_init(L); +#endif } else { LuaLoadPlugin(filename, L); } @@ -662,17 +676,23 @@ static void * interactive_prompt(void * __L) { void check_exports(void) { printm(M_INFO, "luaconfigfiles = %p\n", luaconfigfiles_init); +#ifndef _MSVC printm(M_INFO, "luaftgl = %p\n", luaftgl_init); printm(M_INFO, "luagl = %p\n", luagl_init); +#endif printm(M_INFO, "luahandle = %p\n", luahandle_init); printm(M_INFO, "luahttp = %p\n", luahttp_init); printm(M_INFO, "lualibs = %p\n", lualibs_init); +#ifndef _MSVC printm(M_INFO, "luaocci = %p\n", luaocci_init); +#endif printm(M_INFO, "luaregex = %p\n", luaregex_init); printm(M_INFO, "luasql = %p\n", luasql_init); printm(M_INFO, "luatask = %p\n", luatask_init); printm(M_INFO, "luaxml = %p\n", luaxml_init); +#ifndef _MSVC printm(M_INFO, "luaosmesa = %p\n", luaosmesa_init); +#endif } virtual int startup() throw (GeneralException) { |