Browse Source

Small patch to change mbedtls _WIN32_WINNT

Fabio Alessandrelli 7 years ago
parent
commit
7e776f5b2e
2 changed files with 7 additions and 2 deletions
  1. 2 0
      thirdparty/README.md
  2. 5 2
      thirdparty/mbedtls/library/net_sockets.c

+ 2 - 0
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
 

+ 5 - 2
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>