summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2018-03-28 17:31:59 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2018-04-03 20:13:12 +0200
commit7e776f5b2e8f6c4375dae7a46c87d56a7ef6c075 (patch)
tree3c5af671117bad0f4cb62cd6aef1694e383ef191
parentfebec687639533570236e491fce464cd03eac1ae (diff)
Small patch to change mbedtls _WIN32_WINNT
-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>