From acc7330800b9cd4e8e293ce57e733ec650a2a9a6 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sat, 7 Apr 2012 00:00:23 +0000 Subject: [PATCH] get miniupnpc building on non-BSD systems --- third-party/miniupnp/miniupnpc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/third-party/miniupnp/miniupnpc.c b/third-party/miniupnp/miniupnpc.c index 4eb59aea7..ab5e7feef 100644 --- a/third-party/miniupnp/miniupnpc.c +++ b/third-party/miniupnp/miniupnpc.c @@ -18,6 +18,10 @@ #endif #if !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(MACOSX) && !defined(_WIN32) +/* miniupnpc's unmodified source says _BSD_SOURCE or _GNU_SOURCE is needed + for struct ip_mreqn... since the above #if chain rules out the former, + use the latter here */ +#define _GNU_SOURCE #define HAS_IP_MREQN #endif @@ -112,9 +116,10 @@ LIBSPEC void parserootdesc(const char * buffer, int bufsize, struct IGDdatas * d * return values : * pointer - OK * NULL - error */ -char * simpleUPnPcommand2(int s, const char * url, const char * service, - const char * action, struct UPNParg * args, - int * bufsize, const char * httpversion) +static char * +simpleUPnPcommand2(int s, const char * url, const char * service, + const char * action, struct UPNParg * args, + int * bufsize, const char * httpversion) { char hostname[MAXHOSTNAMELEN+1]; unsigned short port = 0;