mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Rename love::luasocket::__open to love::luasocket::preload
This commit is contained in:
@@ -38,15 +38,6 @@ extern "C" {
|
|||||||
#include "libluasocket/tp.lua.h"
|
#include "libluasocket/tp.lua.h"
|
||||||
#include "libluasocket/url.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)
|
static void preload(lua_State* L, const char* name, lua_CFunction func)
|
||||||
{
|
{
|
||||||
lua_getglobal(L, "package");
|
lua_getglobal(L, "package");
|
||||||
@@ -88,7 +79,7 @@ namespace love
|
|||||||
namespace luasocket
|
namespace luasocket
|
||||||
{
|
{
|
||||||
|
|
||||||
int __open(lua_State * L)
|
int preload(lua_State * L)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Preload code from LuaSocket.
|
// Preload code from LuaSocket.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace love
|
|||||||
namespace luasocket
|
namespace luasocket
|
||||||
{
|
{
|
||||||
|
|
||||||
int __open(lua_State * L);
|
int preload(lua_State * L);
|
||||||
|
|
||||||
} // luasocket
|
} // luasocket
|
||||||
} // love
|
} // love
|
||||||
|
|||||||
@@ -652,7 +652,7 @@ int luaopen_love(lua_State *L)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LOVE_ENABLE_LUASOCKET
|
#ifdef LOVE_ENABLE_LUASOCKET
|
||||||
love::luasocket::__open(L);
|
love::luasocket::preload(L);
|
||||||
#endif
|
#endif
|
||||||
#ifdef LOVE_ENABLE_ENET
|
#ifdef LOVE_ENABLE_ENET
|
||||||
love::luax_preload(L, luaopen_enet, "enet");
|
love::luax_preload(L, luaopen_enet, "enet");
|
||||||
|
|||||||
Reference in New Issue
Block a user