aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorE. Westbrook <github@westbrook.io>2019-02-27 20:56:48 -0700
committerE. Westbrook <github@westbrook.io>2019-03-10 00:03:04 -0700
commit133774cd3db0d8ce8ccc1df8538a6d44552fc1f0 (patch)
treed1ae228240546c922bf6bb004581909c698ad507 /src
parente3ac49efbda8b432470b57eae6fade7501c3da03 (diff)
downloadluasocket-133774cd3db0d8ce8ccc1df8538a6d44552fc1f0.tar.gz
luasocket-133774cd3db0d8ce8ccc1df8538a6d44552fc1f0.tar.bz2
luasocket-133774cd3db0d8ce8ccc1df8538a6d44552fc1f0.zip
compat: pragma visibility
Diffstat (limited to 'src')
-rw-r--r--src/compat.c5
-rw-r--r--src/compat.h18
2 files changed, 14 insertions, 9 deletions
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 @@
2#include "compat.h" 2#include "compat.h"
3 3
4#if LUA_VERSION_NUM==501 4#if LUA_VERSION_NUM==501
5
5/* 6/*
6** Adapted from Lua 5.2 7** Adapted from Lua 5.2
7*/ 8*/
8LUASOCKET_PRIVATE void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { 9void luasocket_setfuncs (lua_State *L, const luaL_Reg *l, int nup) {
9 luaL_checkstack(L, nup+1, "too many upvalues"); 10 luaL_checkstack(L, nup+1, "too many upvalues");
10 for (; l->name != NULL; l++) { /* fill the table with given functions */ 11 for (; l->name != NULL; l++) { /* fill the table with given functions */
11 int i; 12 int i;
@@ -21,7 +22,7 @@ LUASOCKET_PRIVATE void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup)
21/* 22/*
22** Duplicated from Lua 5.2 23** Duplicated from Lua 5.2
23*/ 24*/
24LUASOCKET_PRIVATE void *luaL_testudata (lua_State *L, int ud, const char *tname) { 25void *luasocket_testudata (lua_State *L, int ud, const char *tname) {
25 void *p = lua_touserdata(L, ud); 26 void *p = lua_touserdata(L, ud);
26 if (p != NULL) { /* value is a userdata? */ 27 if (p != NULL) { /* value is a userdata? */
27 if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ 28 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 @@
1#ifndef COMPAT_H 1#ifndef COMPAT_H
2#define COMPAT_H 2#define COMPAT_H
3 3
4#include "lua.h"
5#include "lauxlib.h"
6
7#if LUA_VERSION_NUM==501 4#if LUA_VERSION_NUM==501
8#define luaL_setfuncs socket_setfuncs 5
9#define luaL_testudata socket_testudata 6#pragma GCC visibility push(hidden)
10void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup); 7
11void *luaL_testudata ( lua_State *L, int arg, const char *tname); 8void luasocket_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
9void *luasocket_testudata ( lua_State *L, int arg, const char *tname);
10
11#pragma GCC visibility pop
12
13#define luaL_setfuncs luasocket_setfuncs
14#define luaL_testudata luasocket_testudata
15
12#endif 16#endif
13 17
14#endif 18#endif