1
0
mirror of https://github.com/janet-lang/janet synced 2025-02-03 18:59:09 +00:00

Make sure winsock2.h is included before windows.h

This should be true in the normal build, and especially in the
amalgamated build.
This commit is contained in:
Calvin Rose 2020-05-16 12:41:26 -05:00
parent 657fae490c
commit 1bb9a9368b
2 changed files with 9 additions and 1 deletions

View File

@ -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 <winsock2.h>")
(print "#endif")
(print)
(each s core-sources
(do-one-file s))

View File

@ -27,8 +27,8 @@
#endif
#ifdef JANET_WINDOWS
#include <windows.h>
#include <winsock2.h>
#include <windows.h>
#include <ws2tcpip.h>
#pragma comment (lib, "Ws2_32.lib")
#pragma comment (lib, "Mswsock.lib")