io: pragma visibility

This commit is contained in:
E. Westbrook 2019-02-27 20:57:25 -07:00
parent 611cdd19cc
commit ee30e4643d
2 changed files with 7 additions and 8 deletions

View File

@ -5,13 +5,10 @@
#include "luasocket.h" #include "luasocket.h"
#include "io.h" #include "io.h"
/*=========================================================================*\
* Exported functions
\*=========================================================================*/
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
* Initializes C structure * Initializes C structure
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
LUASOCKET_PRIVATE 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) {
io->send = send; io->send = send;
io->recv = recv; io->recv = recv;
io->error = error; io->error = error;
@ -21,7 +18,7 @@ LUASOCKET_PRIVATE void io_init(p_io io, p_send send, p_recv recv, p_error error,
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
* I/O error strings * I/O error strings
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
LUASOCKET_PRIVATE const char *io_strerror(int err) { const char *io_strerror(int err) {
switch (err) { switch (err) {
case IO_DONE: return NULL; case IO_DONE: return NULL;
case IO_CLOSED: return "closed"; case IO_CLOSED: return "closed";

View File

@ -12,9 +12,7 @@
* The module socket.h implements this interface, and thus the module tcp.h * The module socket.h implements this interface, and thus the module tcp.h
* is very simple. * is very simple.
\*=========================================================================*/ \*=========================================================================*/
#include <stdio.h> #include "luasocket.h"
#include "lua.h"
#include "timeout.h" #include "timeout.h"
/* IO error codes */ /* IO error codes */
@ -58,8 +56,12 @@ typedef struct t_io_ {
} t_io; } t_io;
typedef t_io *p_io; typedef t_io *p_io;
#pragma GCC visibility push(hidden)
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);
#pragma GCC visibility pop
#endif /* IO_H */ #endif /* IO_H */