summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--thirdparty/README.md2
-rw-r--r--thirdparty/mbedtls/library/net_sockets.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 1cf3e0e38f..635babbfc6 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -260,6 +260,8 @@ Godot build configurations, check them out when updating.
File extracted from upstream release tarball `mbedtls-2.8.0-apache.tgz`:
- All `*.h` from `include/mbedtls/` to `thirdparty/mbedtls/include/mbedtls/`
- All `*.c` from `library/` to `thirdparty/mbedtls/library/`
+- In file `thirdparty/mbedtls/library/net_sockets.c` mbedTLS overrides the `_WIN32_WINNT` define.
+ Be sure to check the Godot addition to only redfine it when undefined or `< 0x0501` (PRed upstream).
## minizip
diff --git a/thirdparty/mbedtls/library/net_sockets.c b/thirdparty/mbedtls/library/net_sockets.c
index 345f10227b..2fb548caa9 100644
--- a/thirdparty/mbedtls/library/net_sockets.c
+++ b/thirdparty/mbedtls/library/net_sockets.c
@@ -45,11 +45,14 @@
#if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(EFIX64) && \
!defined(EFI32)
-#ifdef _WIN32_WINNT
+/* GODOT ADDITION */
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501)
#undef _WIN32_WINNT
-#endif
/* Enables getaddrinfo() & Co */
#define _WIN32_WINNT 0x0501
+#endif
+/* END GODOT ADDITION */
+
#include <ws2tcpip.h>
#include <winsock2.h>