From 3fc23c3b88023e2bf78ada7bf0bb60611771fcc5 Mon Sep 17 00:00:00 2001 From: Thomas BERNARD Date: Thu, 1 Oct 2015 23:37:05 +0200 Subject: [PATCH] fix miniupnpc compilation under OS X 10.4 (darwin 8) --- miniupnpc/Makefile | 2 ++ miniupnpc/connecthostport.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/miniupnpc/Makefile b/miniupnpc/Makefile index 5065b91..80e7822 100644 --- a/miniupnpc/Makefile +++ b/miniupnpc/Makefile @@ -38,9 +38,11 @@ CFLAGS += -DMINIUPNPC_GET_SRC_ADDR CFLAGS += -D_BSD_SOURCE CFLAGS += -D_DEFAULT_SOURCE ifneq ($(OS), FreeBSD) +ifneq ($(OS), Darwin) #CFLAGS += -D_POSIX_C_SOURCE=200112L CFLAGS += -D_XOPEN_SOURCE=600 endif +endif #CFLAGS += -ansi # -DNO_GETADDRINFO INSTALL = install diff --git a/miniupnpc/connecthostport.c b/miniupnpc/connecthostport.c index d66ae31..b9a3bec 100644 --- a/miniupnpc/connecthostport.c +++ b/miniupnpc/connecthostport.c @@ -23,6 +23,10 @@ #define socklen_t int #else /* #ifdef _WIN32 */ #include +#include +#ifdef MINIUPNPC_SET_SOCKET_TIMEOUT +#include +#endif /* #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT */ #include #include #include @@ -33,7 +37,6 @@ * during the connect() call */ #define MINIUPNPC_IGNORE_EINTR #ifndef USE_GETHOSTBYNAME -#include #include #include #endif /* #ifndef USE_GETHOSTBYNAME */