diff --git a/src/libraries/luasocket/luasocket.cpp b/src/libraries/luasocket/luasocket.cpp index 7967c2aed..bcdb582ff 100644 --- a/src/libraries/luasocket/luasocket.cpp +++ b/src/libraries/luasocket/luasocket.cpp @@ -38,15 +38,6 @@ extern "C" { #include "libluasocket/tp.lua.h" #include "libluasocket/url.lua.h" -// Quick macro for adding functions to -// the preloder. -#define PRELOAD(name, function) \ - lua_getglobal(L, "package"); \ - lua_getfield(L, -1, "preload"); \ - lua_pushcfunction(L, function); \ - lua_setfield(L, -2, name); \ - lua_pop(L, 2); - static void preload(lua_State* L, const char* name, lua_CFunction func) { lua_getglobal(L, "package"); @@ -88,7 +79,7 @@ namespace love namespace luasocket { -int __open(lua_State * L) +int preload(lua_State * L) { // Preload code from LuaSocket. diff --git a/src/libraries/luasocket/luasocket.h b/src/libraries/luasocket/luasocket.h index 2ce9c5a83..c8e50c0db 100644 --- a/src/libraries/luasocket/luasocket.h +++ b/src/libraries/luasocket/luasocket.h @@ -29,7 +29,7 @@ namespace love namespace luasocket { -int __open(lua_State * L); +int preload(lua_State * L); } // luasocket } // love diff --git a/src/modules/love/love.cpp b/src/modules/love/love.cpp index 6df24c6d6..ab511a05e 100644 --- a/src/modules/love/love.cpp +++ b/src/modules/love/love.cpp @@ -652,7 +652,7 @@ int luaopen_love(lua_State *L) #endif #ifdef LOVE_ENABLE_LUASOCKET - love::luasocket::__open(L); + love::luasocket::preload(L); #endif #ifdef LOVE_ENABLE_ENET love::luax_preload(L, luaopen_enet, "enet");