diff --git a/mongoose.h b/mongoose.h index 3b50b26d..acfe09b4 100644 --- a/mongoose.h +++ b/mongoose.h @@ -558,6 +558,17 @@ static inline int mg_mkdir(const char *path, mode_t mode) { #define _CRT_RAND_S #endif +#ifndef _WIN32_WINNT +#if defined(_MSC_VER) && _MSC_VER < 1700 +#define _WIN32_WINNT 0x0400 // Let vc98 pick up wincrypt.h +#else +#define _WIN32_WINNT 0x0600 +#endif +#endif +#ifndef WINVER +#define WINVER _WIN32_WINNT +#endif + #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -585,6 +596,8 @@ static inline int mg_mkdir(const char *path, mode_t mode) { #include #include +#include // fix missing macros and types + #if defined(_MSC_VER) && _MSC_VER < 1700 #define __func__ "" typedef __int64 int64_t; @@ -606,13 +619,9 @@ typedef enum { false = 0, true = 1 } bool; #include #include -#include // fix missing macros and types // For mg_random() #if defined(_MSC_VER) && _MSC_VER < 1700 -#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x400 // Let vc98 pick up wincrypt.h -#endif #include #pragma comment(lib, "advapi32.lib") #endif diff --git a/src/arch_win32.h b/src/arch_win32.h index 7ac8b763..ebaeca76 100644 --- a/src/arch_win32.h +++ b/src/arch_win32.h @@ -18,6 +18,17 @@ #define _CRT_RAND_S #endif +#ifndef _WIN32_WINNT +#if defined(_MSC_VER) && _MSC_VER < 1700 +#define _WIN32_WINNT 0x0400 // Let vc98 pick up wincrypt.h +#else +#define _WIN32_WINNT 0x0600 +#endif +#endif +#ifndef WINVER +#define WINVER _WIN32_WINNT +#endif + #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -45,6 +56,8 @@ #include #include +#include // fix missing macros and types + #if defined(_MSC_VER) && _MSC_VER < 1700 #define __func__ "" typedef __int64 int64_t; @@ -66,13 +79,9 @@ typedef enum { false = 0, true = 1 } bool; #include #include -#include // fix missing macros and types // For mg_random() #if defined(_MSC_VER) && _MSC_VER < 1700 -#ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x400 // Let vc98 pick up wincrypt.h -#endif #include #pragma comment(lib, "advapi32.lib") #endif diff --git a/test/Makefile b/test/Makefile index 0a16b237..c44a4587 100644 --- a/test/Makefile +++ b/test/Makefile @@ -205,11 +205,11 @@ vc22: Makefile mongoose.h $(SRCS) $(DOCKER) mdashnet/vc22 wine64 $@.exe mingw: Makefile mongoose.h $(SRCS) - $(DOCKER) mdashnet/mingw x86_64-w64-mingw32-gcc $(SRCS) -W -Wall -Werror -I. $(DEFS) $(TFLAGS) -lwsock32 -lbcrypt -o $@.exe + $(DOCKER) mdashnet/mingw x86_64-w64-mingw32-gcc $(SRCS) -W -Wall -Werror -I. $(DEFS) $(TFLAGS) -lws2_32 -lbcrypt -o $@.exe $(DOCKER) mdashnet/mingw wine64 $@.exe mingw++: Makefile mongoose.h $(SRCS) - $(DOCKER) mdashnet/mingw x86_64-w64-mingw32-g++ $(SRCS) -W -Wall -Werror -I. $(DEFS) $(TFLAGS) -lwsock32 -lbcrypt -o $@.exe + $(DOCKER) mdashnet/mingw x86_64-w64-mingw32-g++ $(SRCS) -W -Wall -Werror -I. $(DEFS) $(TFLAGS) -lws2_32 -lbcrypt -o $@.exe @echo "NOT RUNNING" linux-libs: CFLAGS += -fPIC