diff --git a/mongoose.c b/mongoose.c index 42b571fb..ff996417 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4155,7 +4155,7 @@ bool mg_open_listener(struct mg_connection *c, const char *url) { // but won't work! (setsockopt will return EINVAL) MG_ERROR(("reuseaddr: %d", MG_SOCK_ERRNO)); #endif -#if MG_ARCH == MG_ARCH_WIN32 && defined(SO_EXCLUSIVEADDRUSE) && !defined(WINCE) +#if MG_ARCH == MG_ARCH_WIN32 && !defined(SO_EXCLUSIVEADDRUSE) && !defined(WINCE) } else if (setsockopt(fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *) &on, sizeof(on)) != 0) { // "Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE" diff --git a/src/sock.c b/src/sock.c index b71a1d10..700067be 100644 --- a/src/sock.c +++ b/src/sock.c @@ -237,7 +237,7 @@ bool mg_open_listener(struct mg_connection *c, const char *url) { // but won't work! (setsockopt will return EINVAL) MG_ERROR(("reuseaddr: %d", MG_SOCK_ERRNO)); #endif -#if MG_ARCH == MG_ARCH_WIN32 && defined(SO_EXCLUSIVEADDRUSE) && !defined(WINCE) +#if MG_ARCH == MG_ARCH_WIN32 && !defined(SO_EXCLUSIVEADDRUSE) && !defined(WINCE) } else if (setsockopt(fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char *) &on, sizeof(on)) != 0) { // "Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE"