mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-11-16 02:08:21 +01:00
compat: pragma visibility
This commit is contained in:
parent
e3ac49efbd
commit
133774cd3d
@ -2,10 +2,11 @@
|
|||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
#if LUA_VERSION_NUM==501
|
#if LUA_VERSION_NUM==501
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Adapted from Lua 5.2
|
** 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");
|
luaL_checkstack(L, nup+1, "too many upvalues");
|
||||||
for (; l->name != NULL; l++) { /* fill the table with given functions */
|
for (; l->name != NULL; l++) { /* fill the table with given functions */
|
||||||
int i;
|
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
|
** 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);
|
void *p = lua_touserdata(L, ud);
|
||||||
if (p != NULL) { /* value is a userdata? */
|
if (p != NULL) { /* value is a userdata? */
|
||||||
if (lua_getmetatable(L, ud)) { /* does it have a metatable? */
|
if (lua_getmetatable(L, ud)) { /* does it have a metatable? */
|
||||||
|
18
src/compat.h
18
src/compat.h
@ -1,14 +1,18 @@
|
|||||||
#ifndef COMPAT_H
|
#ifndef COMPAT_H
|
||||||
#define COMPAT_H
|
#define COMPAT_H
|
||||||
|
|
||||||
#include "lua.h"
|
|
||||||
#include "lauxlib.h"
|
|
||||||
|
|
||||||
#if LUA_VERSION_NUM==501
|
#if LUA_VERSION_NUM==501
|
||||||
#define luaL_setfuncs socket_setfuncs
|
|
||||||
#define luaL_testudata socket_testudata
|
#pragma GCC visibility push(hidden)
|
||||||
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
|
|
||||||
void *luaL_testudata ( lua_State *L, int arg, const char *tname);
|
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
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user