Make it build on linux

- Removed weird #ifdefs
- Enabled optional executable building
- Fixed exclude files, they're regexes after all
This commit is contained in:
Bart van Strien
2012-06-29 13:04:32 +02:00
parent 72056caccd
commit f6099402e7
5 changed files with 45 additions and 47 deletions
+4 -16
View File
@@ -36,18 +36,12 @@
#include <fstream>
#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK
#ifdef LOVE_BUILD_EXE
// Libraries.
#include "libraries/luasocket/luasocket.h"
// Scripts
#include "scripts/boot.lua.h"
#endif // LOVE_BUILD_EXE
#ifdef LOVE_BUILD_STANDALONE
// All modules define a c-accessible luaopen
// so let's make use of those, instead
// of addressing implementations directly.
@@ -87,23 +81,21 @@ static const luaL_Reg modules[] = {
{ 0, 0 }
};
#endif // LOVE_BUILD_STANDALONE
#ifdef LOVE_LEGENDARY_CONSOLE_IO_HACK
int w__openConsole(lua_State * L);
#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK
extern "C" LOVE_EXPORT const char *love_version()
const char *love_version()
{
return love::VERSION;
}
extern "C" LOVE_EXPORT const char *love_codename()
const char *love_codename()
{
return love::VERSION_CODENAME;
}
extern "C" LOVE_EXPORT int luaopen_love(lua_State * L)
int luaopen_love(lua_State * L)
{
love::luax_insistglobal(L, "love");
@@ -147,8 +139,6 @@ extern "C" LOVE_EXPORT int luaopen_love(lua_State * L)
#endif
lua_setfield(L, -2, "_os");
#ifdef LOVE_BUILD_STANDALONE
// Preload module loaders.
for (int i = 0; modules[i].name != 0; i++)
{
@@ -157,8 +147,6 @@ extern "C" LOVE_EXPORT int luaopen_love(lua_State * L)
love::luasocket::__open(L);
#endif // LOVE_BUILD_STANDALONE
return 1;
}
@@ -206,7 +194,7 @@ int w__openConsole(lua_State * L)
#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK
extern "C" LOVE_EXPORT int luaopen_love_boot(lua_State *L)
int luaopen_love_boot(lua_State *L)
{
if (luaL_loadbuffer(L, (const char *)love::boot_lua, sizeof(love::boot_lua), "boot.lua") == 0)
lua_call(L, 0, 1);
+7 -4
View File
@@ -24,7 +24,10 @@
// Forward declare lua_State.
struct lua_State;
extern "C" LOVE_EXPORT const char *love_version();
extern "C" LOVE_EXPORT const char *love_codename();
extern "C" LOVE_EXPORT int luaopen_love(lua_State *L);
extern "C" LOVE_EXPORT int luaopen_love_boot(lua_State *L);
extern "C"
{
LOVE_EXPORT const char *love_version();
LOVE_EXPORT const char *love_codename();
LOVE_EXPORT int luaopen_love(lua_State *L);
LOVE_EXPORT int luaopen_love_boot(lua_State *L);
}