wrap visibility pragmas in #ifndef _WIN32

This commit is contained in:
E. Westbrook 2019-02-28 16:32:07 -07:00
parent 3a37ab8890
commit 21514304be
16 changed files with 56 additions and 17 deletions

View File

@ -31,7 +31,9 @@
#include "luasocket.h" #include "luasocket.h"
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int auxiliar_open(lua_State *L); int auxiliar_open(lua_State *L);
void auxiliar_newclass(lua_State *L, const char *classname, luaL_Reg *func); void auxiliar_newclass(lua_State *L, const char *classname, luaL_Reg *func);
@ -45,6 +47,8 @@ void *auxiliar_getgroupudata(lua_State *L, const char *groupname, int objidx);
void *auxiliar_getclassudata(lua_State *L, const char *groupname, int objidx); void *auxiliar_getclassudata(lua_State *L, const char *groupname, int objidx);
int auxiliar_typeerror(lua_State *L, int narg, const char *tname); int auxiliar_typeerror(lua_State *L, int narg, const char *tname);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* AUXILIAR_H */ #endif /* AUXILIAR_H */

View File

@ -33,7 +33,9 @@ typedef struct t_buffer_ {
} t_buffer; } t_buffer;
typedef t_buffer *p_buffer; typedef t_buffer *p_buffer;
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int buffer_open(lua_State *L); int buffer_open(lua_State *L);
void buffer_init(p_buffer buf, p_io io, p_timeout tm); void buffer_init(p_buffer buf, p_io io, p_timeout tm);
@ -43,6 +45,8 @@ int buffer_meth_send(lua_State *L, p_buffer buf);
int buffer_meth_receive(lua_State *L, p_buffer buf); int buffer_meth_receive(lua_State *L, p_buffer buf);
int buffer_isempty(p_buffer buf); int buffer_isempty(p_buffer buf);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* BUF_H */ #endif /* BUF_H */

View File

@ -3,12 +3,16 @@
#if LUA_VERSION_NUM==501 #if LUA_VERSION_NUM==501
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
void luasocket_setfuncs (lua_State *L, const luaL_Reg *l, int nup); void luasocket_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
void *luasocket_testudata ( lua_State *L, int arg, const char *tname); void *luasocket_testudata ( lua_State *L, int arg, const char *tname);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#define luaL_setfuncs luasocket_setfuncs #define luaL_setfuncs luasocket_setfuncs
#define luaL_testudata luasocket_testudata #define luaL_testudata luasocket_testudata

View File

@ -33,10 +33,14 @@
#include "luasocket.h" #include "luasocket.h"
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int except_open(lua_State *L); int except_open(lua_State *L);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif #endif

View File

@ -22,7 +22,9 @@
#define LUASOCKET_INET_ATON #define LUASOCKET_INET_ATON
#endif #endif
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int inet_open(lua_State *L); int inet_open(lua_State *L);
@ -47,6 +49,8 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt);
int inet_pton(int af, const char *src, void *dst); int inet_pton(int af, const char *src, void *dst);
#endif #endif
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* INET_H */ #endif /* INET_H */

View File

@ -56,12 +56,15 @@ typedef struct t_io_ {
} t_io; } t_io;
typedef t_io *p_io; typedef t_io *p_io;
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx); void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx);
const char *io_strerror(int err); const char *io_strerror(int err);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* IO_H */ #endif /* IO_H */

View File

@ -18,7 +18,9 @@ typedef struct t_opt {
} t_opt; } t_opt;
typedef t_opt *p_opt; typedef t_opt *p_opt;
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps); int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps);
int opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps); int opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps);
@ -93,6 +95,8 @@ int opt_get_ip6_v6only(lua_State *L, p_socket ps);
int opt_get_error(lua_State *L, p_socket ps); int opt_get_error(lua_State *L, p_socket ps);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif #endif

View File

@ -10,10 +10,14 @@
* true if there is data ready for reading (required for buffered input). * true if there is data ready for reading (required for buffered input).
\*=========================================================================*/ \*=========================================================================*/
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int select_open(lua_State *L); int select_open(lua_State *L);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* SELECT_H */ #endif /* SELECT_H */

View File

@ -36,7 +36,9 @@ typedef struct sockaddr SA;
* interface to sockets * interface to sockets
\*=========================================================================*/ \*=========================================================================*/
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int socket_waitfd(p_socket ps, int sw, p_timeout tm); int socket_waitfd(p_socket ps, int sw, p_timeout tm);
int socket_open(void); int socket_open(void);
@ -64,6 +66,8 @@ const char *socket_strerror(int err);
const char *socket_ioerror(p_socket ps, int err); const char *socket_ioerror(p_socket ps, int err);
const char *socket_gaistrerror(int err); const char *socket_gaistrerror(int err);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* SOCKET_H */ #endif /* SOCKET_H */

View File

@ -30,10 +30,14 @@ typedef struct t_tcp_ {
typedef t_tcp *p_tcp; typedef t_tcp *p_tcp;
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int tcp_open(lua_State *L); int tcp_open(lua_State *L);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* TCP_H */ #endif /* TCP_H */

View File

@ -26,10 +26,6 @@
#define MAX(x, y) ((x) > (y) ? x : y) #define MAX(x, y) ((x) > (y) ? x : y)
#endif #endif
#ifndef _WIN32
#pragma GCC visibility push(hidden)
#endif
/*=========================================================================*\ /*=========================================================================*\
* Internal function prototypes * Internal function prototypes
\*=========================================================================*/ \*=========================================================================*/
@ -228,7 +224,3 @@ int timeout_lua_sleep(lua_State *L)
return 0; return 0;
} }
#endif #endif
#ifndef _WIN32
#pragma GCC visibility pop
#endif

View File

@ -14,7 +14,9 @@ typedef struct t_timeout_ {
} t_timeout; } t_timeout;
typedef t_timeout *p_timeout; typedef t_timeout *p_timeout;
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
void timeout_init(p_timeout tm, double block, double total); void timeout_init(p_timeout tm, double block, double total);
double timeout_get(p_timeout tm); double timeout_get(p_timeout tm);
@ -29,7 +31,9 @@ int timeout_open(lua_State *L);
int timeout_meth_settimeout(lua_State *L, p_timeout tm); int timeout_meth_settimeout(lua_State *L, p_timeout tm);
int timeout_meth_gettimeout(lua_State *L, p_timeout tm); int timeout_meth_gettimeout(lua_State *L, p_timeout tm);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#define timeout_iszero(tm) ((tm)->block == 0.0) #define timeout_iszero(tm) ((tm)->block == 0.0)

View File

@ -26,10 +26,14 @@ typedef struct t_udp_ {
} t_udp; } t_udp;
typedef t_udp *p_udp; typedef t_udp *p_udp;
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int udp_open(lua_State *L); int udp_open(lua_State *L);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* UDP_H */ #endif /* UDP_H */

View File

@ -15,10 +15,14 @@
#include "unix.h" #include "unix.h"
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int unixdgram_open(lua_State *L); int unixdgram_open(lua_State *L);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* UNIXDGRAM_H */ #endif /* UNIXDGRAM_H */

View File

@ -16,10 +16,14 @@
\*=========================================================================*/ \*=========================================================================*/
#include "unix.h" #include "unix.h"
#ifndef _WIN32
#pragma GCC visibility push(hidden) #pragma GCC visibility push(hidden)
#endif
int unixstream_open(lua_State *L); int unixstream_open(lua_State *L);
#ifndef _WIN32
#pragma GCC visibility pop #pragma GCC visibility pop
#endif
#endif /* UNIXSTREAM_H */ #endif /* UNIXSTREAM_H */

View File

@ -12,10 +12,6 @@
#include "socket.h" #include "socket.h"
#include "pierror.h" #include "pierror.h"
#ifndef _WIN32
#pragma GCC visibility push(hidden)
#endif
/* WinSock doesn't have a strerror... */ /* WinSock doesn't have a strerror... */
static const char *wstrerror(int err); static const char *wstrerror(int err);
@ -436,7 +432,3 @@ const char *socket_gaistrerror(int err) {
default: return gai_strerror(err); default: return gai_strerror(err);
} }
} }
#ifndef _WIN32
#pragma GCC visibility pop
#endif