From e7a46991353b3ab5aa0bc45403b87beacca3c31c Mon Sep 17 00:00:00 2001 From: Sebastián Katzer Date: Tue, 5 Jun 2018 15:59:12 +0200 Subject: Declare inet_ntop and inet_pton as static To avoid conflicts with multiple definitions of inet_ntop and inet_pton if compiled with # define _WIN32_WINNT _WIN32_WINNT_VISTA C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libWs2_32.a(dghfs00169.o):(.text+0x0): multiple definition of `inet_pton' 722C:/projects/iss/mruby/build/host/lib/libmruby.a(socket.o):C:/projects/iss/mruby/mrbgems/mruby-socket/src/socket.c:80: first defined here define _WIN32_WINNT _WIN32_WINNT_VISTA --- mrbgems/mruby-socket/src/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mrbgems/mruby-socket') diff --git a/mrbgems/mruby-socket/src/socket.c b/mrbgems/mruby-socket/src/socket.c index 4d56d5374..037400077 100644 --- a/mrbgems/mruby-socket/src/socket.c +++ b/mrbgems/mruby-socket/src/socket.c @@ -51,7 +51,7 @@ #endif #ifdef _WIN32 -const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) +static const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) { if (af == AF_INET) { @@ -76,7 +76,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) return NULL; } -int inet_pton(int af, const char *src, void *dst) +static int inet_pton(int af, const char *src, void *dst) { struct addrinfo hints, *res, *ressave; -- cgit v1.2.3