diff options
author | E. Westbrook <github@westbrook.io> | 2019-02-28 16:32:07 -0700 |
---|---|---|
committer | E. Westbrook <github@westbrook.io> | 2019-03-10 00:04:20 -0700 |
commit | 21514304be9e98a4386cb18542582068a59c5586 (patch) | |
tree | 1fc604d7cbd6a42c801b92b145651d91c458dfa2 /src | |
parent | 3a37ab88906bcdbad17051decc0e4c4c141a17c9 (diff) | |
download | luasocket-21514304be9e98a4386cb18542582068a59c5586.tar.gz luasocket-21514304be9e98a4386cb18542582068a59c5586.tar.bz2 luasocket-21514304be9e98a4386cb18542582068a59c5586.zip |
wrap visibility pragmas in #ifndef _WIN32
Diffstat (limited to 'src')
-rw-r--r-- | src/auxiliar.h | 4 | ||||
-rw-r--r-- | src/buffer.h | 4 | ||||
-rw-r--r-- | src/compat.h | 4 | ||||
-rw-r--r-- | src/except.h | 4 | ||||
-rw-r--r-- | src/inet.h | 4 | ||||
-rw-r--r-- | src/io.h | 5 | ||||
-rw-r--r-- | src/options.h | 4 | ||||
-rw-r--r-- | src/select.h | 4 | ||||
-rw-r--r-- | src/socket.h | 4 | ||||
-rw-r--r-- | src/tcp.h | 4 | ||||
-rw-r--r-- | src/timeout.c | 8 | ||||
-rw-r--r-- | src/timeout.h | 4 | ||||
-rw-r--r-- | src/udp.h | 4 | ||||
-rw-r--r-- | src/unixdgram.h | 4 | ||||
-rw-r--r-- | src/unixstream.h | 4 | ||||
-rwxr-xr-x | src/wsocket.c | 8 |
16 files changed, 56 insertions, 17 deletions
diff --git a/src/auxiliar.h b/src/auxiliar.h index 234b00a..e8c3ead 100644 --- a/src/auxiliar.h +++ b/src/auxiliar.h | |||
@@ -31,7 +31,9 @@ | |||
31 | 31 | ||
32 | #include "luasocket.h" | 32 | #include "luasocket.h" |
33 | 33 | ||
34 | #ifndef _WIN32 | ||
34 | #pragma GCC visibility push(hidden) | 35 | #pragma GCC visibility push(hidden) |
36 | #endif | ||
35 | 37 | ||
36 | int auxiliar_open(lua_State *L); | 38 | int auxiliar_open(lua_State *L); |
37 | void auxiliar_newclass(lua_State *L, const char *classname, luaL_Reg *func); | 39 | 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); | |||
45 | void *auxiliar_getclassudata(lua_State *L, const char *groupname, int objidx); | 47 | void *auxiliar_getclassudata(lua_State *L, const char *groupname, int objidx); |
46 | int auxiliar_typeerror(lua_State *L, int narg, const char *tname); | 48 | int auxiliar_typeerror(lua_State *L, int narg, const char *tname); |
47 | 49 | ||
50 | #ifndef _WIN32 | ||
48 | #pragma GCC visibility pop | 51 | #pragma GCC visibility pop |
52 | #endif | ||
49 | 53 | ||
50 | #endif /* AUXILIAR_H */ | 54 | #endif /* AUXILIAR_H */ |
diff --git a/src/buffer.h b/src/buffer.h index 4218ea0..a0901fc 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
@@ -33,7 +33,9 @@ typedef struct t_buffer_ { | |||
33 | } t_buffer; | 33 | } t_buffer; |
34 | typedef t_buffer *p_buffer; | 34 | typedef t_buffer *p_buffer; |
35 | 35 | ||
36 | #ifndef _WIN32 | ||
36 | #pragma GCC visibility push(hidden) | 37 | #pragma GCC visibility push(hidden) |
38 | #endif | ||
37 | 39 | ||
38 | int buffer_open(lua_State *L); | 40 | int buffer_open(lua_State *L); |
39 | void buffer_init(p_buffer buf, p_io io, p_timeout tm); | 41 | 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); | |||
43 | int buffer_meth_receive(lua_State *L, p_buffer buf); | 45 | int buffer_meth_receive(lua_State *L, p_buffer buf); |
44 | int buffer_isempty(p_buffer buf); | 46 | int buffer_isempty(p_buffer buf); |
45 | 47 | ||
48 | #ifndef _WIN32 | ||
46 | #pragma GCC visibility pop | 49 | #pragma GCC visibility pop |
50 | #endif | ||
47 | 51 | ||
48 | #endif /* BUF_H */ | 52 | #endif /* BUF_H */ |
diff --git a/src/compat.h b/src/compat.h index 8c32b07..fa2d7d7 100644 --- a/src/compat.h +++ b/src/compat.h | |||
@@ -3,12 +3,16 @@ | |||
3 | 3 | ||
4 | #if LUA_VERSION_NUM==501 | 4 | #if LUA_VERSION_NUM==501 |
5 | 5 | ||
6 | #ifndef _WIN32 | ||
6 | #pragma GCC visibility push(hidden) | 7 | #pragma GCC visibility push(hidden) |
8 | #endif | ||
7 | 9 | ||
8 | void luasocket_setfuncs (lua_State *L, const luaL_Reg *l, int nup); | 10 | void luasocket_setfuncs (lua_State *L, const luaL_Reg *l, int nup); |
9 | void *luasocket_testudata ( lua_State *L, int arg, const char *tname); | 11 | void *luasocket_testudata ( lua_State *L, int arg, const char *tname); |
10 | 12 | ||
13 | #ifndef _WIN32 | ||
11 | #pragma GCC visibility pop | 14 | #pragma GCC visibility pop |
15 | #endif | ||
12 | 16 | ||
13 | #define luaL_setfuncs luasocket_setfuncs | 17 | #define luaL_setfuncs luasocket_setfuncs |
14 | #define luaL_testudata luasocket_testudata | 18 | #define luaL_testudata luasocket_testudata |
diff --git a/src/except.h b/src/except.h index baa7b09..71c31fd 100644 --- a/src/except.h +++ b/src/except.h | |||
@@ -33,10 +33,14 @@ | |||
33 | 33 | ||
34 | #include "luasocket.h" | 34 | #include "luasocket.h" |
35 | 35 | ||
36 | #ifndef _WIN32 | ||
36 | #pragma GCC visibility push(hidden) | 37 | #pragma GCC visibility push(hidden) |
38 | #endif | ||
37 | 39 | ||
38 | int except_open(lua_State *L); | 40 | int except_open(lua_State *L); |
39 | 41 | ||
42 | #ifndef _WIN32 | ||
40 | #pragma GCC visibility pop | 43 | #pragma GCC visibility pop |
44 | #endif | ||
41 | 45 | ||
42 | #endif | 46 | #endif |
@@ -22,7 +22,9 @@ | |||
22 | #define LUASOCKET_INET_ATON | 22 | #define LUASOCKET_INET_ATON |
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | #ifndef _WIN32 | ||
25 | #pragma GCC visibility push(hidden) | 26 | #pragma GCC visibility push(hidden) |
27 | #endif | ||
26 | 28 | ||
27 | int inet_open(lua_State *L); | 29 | int inet_open(lua_State *L); |
28 | 30 | ||
@@ -47,6 +49,8 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt); | |||
47 | int inet_pton(int af, const char *src, void *dst); | 49 | int inet_pton(int af, const char *src, void *dst); |
48 | #endif | 50 | #endif |
49 | 51 | ||
52 | #ifndef _WIN32 | ||
50 | #pragma GCC visibility pop | 53 | #pragma GCC visibility pop |
54 | #endif | ||
51 | 55 | ||
52 | #endif /* INET_H */ | 56 | #endif /* INET_H */ |
@@ -56,12 +56,15 @@ typedef struct t_io_ { | |||
56 | } t_io; | 56 | } t_io; |
57 | typedef t_io *p_io; | 57 | typedef t_io *p_io; |
58 | 58 | ||
59 | #ifndef _WIN32 | ||
59 | #pragma GCC visibility push(hidden) | 60 | #pragma GCC visibility push(hidden) |
61 | #endif | ||
60 | 62 | ||
61 | void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx); | 63 | void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx); |
62 | const char *io_strerror(int err); | 64 | const char *io_strerror(int err); |
63 | 65 | ||
66 | #ifndef _WIN32 | ||
64 | #pragma GCC visibility pop | 67 | #pragma GCC visibility pop |
68 | #endif | ||
65 | 69 | ||
66 | #endif /* IO_H */ | 70 | #endif /* IO_H */ |
67 | |||
diff --git a/src/options.h b/src/options.h index 1457f43..41f7337 100644 --- a/src/options.h +++ b/src/options.h | |||
@@ -18,7 +18,9 @@ typedef struct t_opt { | |||
18 | } t_opt; | 18 | } t_opt; |
19 | typedef t_opt *p_opt; | 19 | typedef t_opt *p_opt; |
20 | 20 | ||
21 | #ifndef _WIN32 | ||
21 | #pragma GCC visibility push(hidden) | 22 | #pragma GCC visibility push(hidden) |
23 | #endif | ||
22 | 24 | ||
23 | int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps); | 25 | int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps); |
24 | int opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps); | 26 | 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); | |||
93 | 95 | ||
94 | int opt_get_error(lua_State *L, p_socket ps); | 96 | int opt_get_error(lua_State *L, p_socket ps); |
95 | 97 | ||
98 | #ifndef _WIN32 | ||
96 | #pragma GCC visibility pop | 99 | #pragma GCC visibility pop |
100 | #endif | ||
97 | 101 | ||
98 | #endif | 102 | #endif |
diff --git a/src/select.h b/src/select.h index 95272db..5d45fe7 100644 --- a/src/select.h +++ b/src/select.h | |||
@@ -10,10 +10,14 @@ | |||
10 | * true if there is data ready for reading (required for buffered input). | 10 | * true if there is data ready for reading (required for buffered input). |
11 | \*=========================================================================*/ | 11 | \*=========================================================================*/ |
12 | 12 | ||
13 | #ifndef _WIN32 | ||
13 | #pragma GCC visibility push(hidden) | 14 | #pragma GCC visibility push(hidden) |
15 | #endif | ||
14 | 16 | ||
15 | int select_open(lua_State *L); | 17 | int select_open(lua_State *L); |
16 | 18 | ||
19 | #ifndef _WIN32 | ||
17 | #pragma GCC visibility pop | 20 | #pragma GCC visibility pop |
21 | #endif | ||
18 | 22 | ||
19 | #endif /* SELECT_H */ | 23 | #endif /* SELECT_H */ |
diff --git a/src/socket.h b/src/socket.h index 4adc562..e541f27 100644 --- a/src/socket.h +++ b/src/socket.h | |||
@@ -36,7 +36,9 @@ typedef struct sockaddr SA; | |||
36 | * interface to sockets | 36 | * interface to sockets |
37 | \*=========================================================================*/ | 37 | \*=========================================================================*/ |
38 | 38 | ||
39 | #ifndef _WIN32 | ||
39 | #pragma GCC visibility push(hidden) | 40 | #pragma GCC visibility push(hidden) |
41 | #endif | ||
40 | 42 | ||
41 | int socket_waitfd(p_socket ps, int sw, p_timeout tm); | 43 | int socket_waitfd(p_socket ps, int sw, p_timeout tm); |
42 | int socket_open(void); | 44 | int socket_open(void); |
@@ -64,6 +66,8 @@ const char *socket_strerror(int err); | |||
64 | const char *socket_ioerror(p_socket ps, int err); | 66 | const char *socket_ioerror(p_socket ps, int err); |
65 | const char *socket_gaistrerror(int err); | 67 | const char *socket_gaistrerror(int err); |
66 | 68 | ||
69 | #ifndef _WIN32 | ||
67 | #pragma GCC visibility pop | 70 | #pragma GCC visibility pop |
71 | #endif | ||
68 | 72 | ||
69 | #endif /* SOCKET_H */ | 73 | #endif /* SOCKET_H */ |
@@ -30,10 +30,14 @@ typedef struct t_tcp_ { | |||
30 | 30 | ||
31 | typedef t_tcp *p_tcp; | 31 | typedef t_tcp *p_tcp; |
32 | 32 | ||
33 | #ifndef _WIN32 | ||
33 | #pragma GCC visibility push(hidden) | 34 | #pragma GCC visibility push(hidden) |
35 | #endif | ||
34 | 36 | ||
35 | int tcp_open(lua_State *L); | 37 | int tcp_open(lua_State *L); |
36 | 38 | ||
39 | #ifndef _WIN32 | ||
37 | #pragma GCC visibility pop | 40 | #pragma GCC visibility pop |
41 | #endif | ||
38 | 42 | ||
39 | #endif /* TCP_H */ | 43 | #endif /* TCP_H */ |
diff --git a/src/timeout.c b/src/timeout.c index 0e3ee27..2bdc069 100644 --- a/src/timeout.c +++ b/src/timeout.c | |||
@@ -26,10 +26,6 @@ | |||
26 | #define MAX(x, y) ((x) > (y) ? x : y) | 26 | #define MAX(x, y) ((x) > (y) ? x : y) |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | #ifndef _WIN32 | ||
30 | #pragma GCC visibility push(hidden) | ||
31 | #endif | ||
32 | |||
33 | /*=========================================================================*\ | 29 | /*=========================================================================*\ |
34 | * Internal function prototypes | 30 | * Internal function prototypes |
35 | \*=========================================================================*/ | 31 | \*=========================================================================*/ |
@@ -228,7 +224,3 @@ int timeout_lua_sleep(lua_State *L) | |||
228 | return 0; | 224 | return 0; |
229 | } | 225 | } |
230 | #endif | 226 | #endif |
231 | |||
232 | #ifndef _WIN32 | ||
233 | #pragma GCC visibility pop | ||
234 | #endif | ||
diff --git a/src/timeout.h b/src/timeout.h index df05eaf..9e5250d 100644 --- a/src/timeout.h +++ b/src/timeout.h | |||
@@ -14,7 +14,9 @@ typedef struct t_timeout_ { | |||
14 | } t_timeout; | 14 | } t_timeout; |
15 | typedef t_timeout *p_timeout; | 15 | typedef t_timeout *p_timeout; |
16 | 16 | ||
17 | #ifndef _WIN32 | ||
17 | #pragma GCC visibility push(hidden) | 18 | #pragma GCC visibility push(hidden) |
19 | #endif | ||
18 | 20 | ||
19 | void timeout_init(p_timeout tm, double block, double total); | 21 | void timeout_init(p_timeout tm, double block, double total); |
20 | double timeout_get(p_timeout tm); | 22 | double timeout_get(p_timeout tm); |
@@ -29,7 +31,9 @@ int timeout_open(lua_State *L); | |||
29 | int timeout_meth_settimeout(lua_State *L, p_timeout tm); | 31 | int timeout_meth_settimeout(lua_State *L, p_timeout tm); |
30 | int timeout_meth_gettimeout(lua_State *L, p_timeout tm); | 32 | int timeout_meth_gettimeout(lua_State *L, p_timeout tm); |
31 | 33 | ||
34 | #ifndef _WIN32 | ||
32 | #pragma GCC visibility pop | 35 | #pragma GCC visibility pop |
36 | #endif | ||
33 | 37 | ||
34 | #define timeout_iszero(tm) ((tm)->block == 0.0) | 38 | #define timeout_iszero(tm) ((tm)->block == 0.0) |
35 | 39 | ||
@@ -26,10 +26,14 @@ typedef struct t_udp_ { | |||
26 | } t_udp; | 26 | } t_udp; |
27 | typedef t_udp *p_udp; | 27 | typedef t_udp *p_udp; |
28 | 28 | ||
29 | #ifndef _WIN32 | ||
29 | #pragma GCC visibility push(hidden) | 30 | #pragma GCC visibility push(hidden) |
31 | #endif | ||
30 | 32 | ||
31 | int udp_open(lua_State *L); | 33 | int udp_open(lua_State *L); |
32 | 34 | ||
35 | #ifndef _WIN32 | ||
33 | #pragma GCC visibility pop | 36 | #pragma GCC visibility pop |
37 | #endif | ||
34 | 38 | ||
35 | #endif /* UDP_H */ | 39 | #endif /* UDP_H */ |
diff --git a/src/unixdgram.h b/src/unixdgram.h index 433fe25..a1a0166 100644 --- a/src/unixdgram.h +++ b/src/unixdgram.h | |||
@@ -15,10 +15,14 @@ | |||
15 | 15 | ||
16 | #include "unix.h" | 16 | #include "unix.h" |
17 | 17 | ||
18 | #ifndef _WIN32 | ||
18 | #pragma GCC visibility push(hidden) | 19 | #pragma GCC visibility push(hidden) |
20 | #endif | ||
19 | 21 | ||
20 | int unixdgram_open(lua_State *L); | 22 | int unixdgram_open(lua_State *L); |
21 | 23 | ||
24 | #ifndef _WIN32 | ||
22 | #pragma GCC visibility pop | 25 | #pragma GCC visibility pop |
26 | #endif | ||
23 | 27 | ||
24 | #endif /* UNIXDGRAM_H */ | 28 | #endif /* UNIXDGRAM_H */ |
diff --git a/src/unixstream.h b/src/unixstream.h index 8ffba8f..7916aff 100644 --- a/src/unixstream.h +++ b/src/unixstream.h | |||
@@ -16,10 +16,14 @@ | |||
16 | \*=========================================================================*/ | 16 | \*=========================================================================*/ |
17 | #include "unix.h" | 17 | #include "unix.h" |
18 | 18 | ||
19 | #ifndef _WIN32 | ||
19 | #pragma GCC visibility push(hidden) | 20 | #pragma GCC visibility push(hidden) |
21 | #endif | ||
20 | 22 | ||
21 | int unixstream_open(lua_State *L); | 23 | int unixstream_open(lua_State *L); |
22 | 24 | ||
25 | #ifndef _WIN32 | ||
23 | #pragma GCC visibility pop | 26 | #pragma GCC visibility pop |
27 | #endif | ||
24 | 28 | ||
25 | #endif /* UNIXSTREAM_H */ | 29 | #endif /* UNIXSTREAM_H */ |
diff --git a/src/wsocket.c b/src/wsocket.c index 1da984c..20da330 100755 --- a/src/wsocket.c +++ b/src/wsocket.c | |||
@@ -12,10 +12,6 @@ | |||
12 | #include "socket.h" | 12 | #include "socket.h" |
13 | #include "pierror.h" | 13 | #include "pierror.h" |
14 | 14 | ||
15 | #ifndef _WIN32 | ||
16 | #pragma GCC visibility push(hidden) | ||
17 | #endif | ||
18 | |||
19 | /* WinSock doesn't have a strerror... */ | 15 | /* WinSock doesn't have a strerror... */ |
20 | static const char *wstrerror(int err); | 16 | static const char *wstrerror(int err); |
21 | 17 | ||
@@ -436,7 +432,3 @@ const char *socket_gaistrerror(int err) { | |||
436 | default: return gai_strerror(err); | 432 | default: return gai_strerror(err); |
437 | } | 433 | } |
438 | } | 434 | } |
439 | |||
440 | #ifndef _WIN32 | ||
441 | #pragma GCC visibility pop | ||
442 | #endif | ||