diff --git a/src/compat.c b/src/compat.c index 1290f70..34ffdaf 100644 --- a/src/compat.c +++ b/src/compat.c @@ -2,10 +2,11 @@ #include "compat.h" #if LUA_VERSION_NUM==501 + /* ** Adapted from Lua 5.2 */ -LUASOCKET_PRIVATE void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { +void luasocket_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { luaL_checkstack(L, nup+1, "too many upvalues"); for (; l->name != NULL; l++) { /* fill the table with given functions */ int i; @@ -21,7 +22,7 @@ LUASOCKET_PRIVATE void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) /* ** Duplicated from Lua 5.2 */ -LUASOCKET_PRIVATE void *luaL_testudata (lua_State *L, int ud, const char *tname) { +void *luasocket_testudata (lua_State *L, int ud, const char *tname) { void *p = lua_touserdata(L, ud); if (p != NULL) { /* value is a userdata? */ if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ diff --git a/src/compat.h b/src/compat.h index 49e83f9..8c32b07 100644 --- a/src/compat.h +++ b/src/compat.h @@ -1,14 +1,18 @@ #ifndef COMPAT_H #define COMPAT_H -#include "lua.h" -#include "lauxlib.h" - #if LUA_VERSION_NUM==501 -#define luaL_setfuncs socket_setfuncs -#define luaL_testudata socket_testudata -void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup); -void *luaL_testudata ( lua_State *L, int arg, const char *tname); + +#pragma GCC visibility push(hidden) + +void luasocket_setfuncs (lua_State *L, const luaL_Reg *l, int nup); +void *luasocket_testudata ( lua_State *L, int arg, const char *tname); + +#pragma GCC visibility pop + +#define luaL_setfuncs luasocket_setfuncs +#define luaL_testudata luasocket_testudata + #endif #endif