diff --git a/src/boot/boot.janet b/src/boot/boot.janet index a4fae6e9..5487befd 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -2852,6 +2852,14 @@ (each h local-headers (do-one-file h)) + # windows.h should not be included in any of the external or internal headers - only in .c files. + (print) + (print "/* Windows work around - winsock2 must be included before windows.h, especially in amalgamated build */") + (print "#if defined(JANET_WINDOWS) && defined(JANET_NET)") + (print "#include ") + (print "#endif") + (print) + (each s core-sources (do-one-file s)) diff --git a/src/core/net.c b/src/core/net.c index 560e5985..dc86f01b 100644 --- a/src/core/net.c +++ b/src/core/net.c @@ -27,8 +27,8 @@ #endif #ifdef JANET_WINDOWS -#include #include +#include #include #pragma comment (lib, "Ws2_32.lib") #pragma comment (lib, "Mswsock.lib")