diff --git a/Makefile b/Makefile index d76d36aa..65c6768a 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,7 @@ endif ifneq (, $(findstring mingw32, $(shell $(CC) -dumpmachine))) BUILD_RESOURCES = $(BUILD_DIR)/$(WINDOWS_RESOURCES:.rc=.o) - LIBS := -lws2_32 -mwindows + LIBS += -lws2_32 -mwindows SHARED_LIB = dll else SHARED_LIB = so diff --git a/src/civetweb.c b/src/civetweb.c index caa6bfeb..8030bcba 100755 --- a/src/civetweb.c +++ b/src/civetweb.c @@ -24,6 +24,9 @@ #if !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS /* Disable deprecation warning in VS2005 */ #endif +#ifndef _WIN32_WINNT /* defined for tdm-gcc so we can use getnameinfo */ +#define _WIN32_WINNT 0x0501 +#endif #else #if defined(__GNUC__) && !defined(_GNU_SOURCE) #define _GNU_SOURCE /* for setgroups() */ @@ -86,10 +89,6 @@ mg_static_assert(sizeof(void *) >= sizeof(int), "data type size check"); #define WIN32_LEAN_AND_MEAN #endif -#if defined(_WIN32) -#include -#endif - #if defined(__SYMBIAN32__) #define NO_SSL /* SSL is not supported */ #define NO_CGI /* CGI is not supported */ @@ -180,6 +179,7 @@ mg_static_assert(MAX_WORKER_THREADS >= 1, #if defined(_WIN32) && !defined(__SYMBIAN32__) /* Windows specific */ #include #include /* DTL add for SO_EXCLUSIVE */ +#include typedef const char *SOCK_OPT_TYPE; diff --git a/src/main.c b/src/main.c index 59be9f80..bed8dd1b 100644 --- a/src/main.c +++ b/src/main.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -59,7 +60,7 @@ #ifdef _WIN32 #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0501 /* Target Windows XP or higher */ +#define _WIN32_WINNT 0x0501 /* for tdm-gcc so we can use getconsolewindow */ #endif #undef UNICODE #include