[Gauche-devel] [patch] fix warnings on OpenBSD
R7RS Scheme scripting engine
Status: Beta
Brought to you by:
shirok
From: <tim...@wi...> - 2016-10-15 06:18:07
|
Hi, Gauche seems to incorrectly define NI_MAXHOST and NI_MAXSERV defines when IPv6 is enabled. It causes following warning on OpenBSD and probably other BSD's: In file included from net.c:34: gauche-net.h:365:1: warning: "NI_MAXHOST" redefined In file included from gauche-net.h:43, from net.c:34: /usr/include/netdb.h:179:1: warning: this is the location of the previous definition Here's an simple patch to match GNU libc behavior and protect the defines behind __USE_MISC which fixes it at least on OpenBSD. Timo --- ext/net/gauche-net.h.orig Sat Oct 15 08:45:08 2016 +++ ext/net/gauche-net.h Sat Oct 15 08:45:36 2016 @@ -362,8 +362,10 @@ extern ScmObj Scm_GetAddrinfo(const char *nodename, struct addrinfo *hints); extern ScmObj Scm_GetNameinfo(ScmSockAddr *addr, int flags); +#ifdef __USE_MISC #define NI_MAXHOST 1025 #define NI_MAXSERV 32 +#endif #endif /* HAVE_IPV6 */ |