vexed
Joined: 27 Oct 2013 Posts: 2
|
Posted: Sun Oct 27, 2013 12:19 am Post subject: HAS_IP_MREQN breaks compile on debian x64 |
|
|
in miniupnpc.c:
Code: |
#ifdef HAS_IP_MREQN
/* was not an ip address, try with an interface name */
struct ip_mreqn reqn; /* only defined with -D_BSD_SOURCE or -D_GNU_SOURCE */
memset(&reqn, 0, sizeof(struct ip_mreqn));
reqn.imr_ifindex = if_nametoindex(multicastif);
if(setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_IF, (const char *)&reqn, sizeof(reqn)) < 0)
{
PRINT_SOCKET_ERROR("setsockopt");
}
#else
|
gcc (Debian 4.7.3-4) 4.7.3
results in:
Code: |
miniupnpc.c: In function ‘upnpDiscover’:
miniupnpc.c:521:21: error: storage size of ‘reqn’ isn’t known
miniupnpc.c:522:29: error: invalid application of ‘sizeof’ to incomplete type ‘struct ip_mreqn’
miniupnpc.c:521:21: error: unused variable ‘reqn’ [-Werror=unused-variable]
cc1: all warnings being treated as errors
make[2]: *** [miniupnpc.o] Error 1
|
Forcing to compile without HAS_IP_MREQN has no errors, and it works as far as I can tell.
Code: |
#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(MACOSX) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun)
// NOTE: This breaks our builds. (linux). All other builds don't use this.
//#define HAS_IP_MREQN
#endif
|
Also note that in minissdpc.c, had to add
Code: | #if defined(_MSC_VER)
typedef SSIZE_T ssize_t;
#endif |
to get it to compile on MSVC. |
|