config_windows.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. commit 4c8ab8b4415d129d0283d7d0d9a5789163ec8d5e
  2. Author: Rémi Verschelde <[email protected]>
  3. Date: Sat May 27 16:38:46 2017 +0200
  4. openssl: Define WIN32_LEAN_AND_MEAN on Windows
  5. This avoids namespace collisions with things such as X509_NAME.
  6. Also force include of necessary definitions in `crypto/o_str.c`
  7. which seem missing on MSVC (but work on MinGW).
  8. diff --git a/thirdparty/openssl/crypto/o_str.c b/thirdparty/openssl/crypto/o_str.c
  9. index 7e61cde85..1854798e2 100644
  10. --- a/thirdparty/openssl/crypto/o_str.c
  11. +++ b/thirdparty/openssl/crypto/o_str.c
  12. @@ -59,6 +59,9 @@
  13. #include <ctype.h>
  14. #include <e_os.h>
  15. +// -- GODOT start --
  16. +#include <openssl/opensslconf.h>
  17. +// -- GODOT end --
  18. #include "o_str.h"
  19. #if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \
  20. diff --git a/thirdparty/openssl/openssl/opensslconf.h b/thirdparty/openssl/openssl/opensslconf.h
  21. index f533508b1..19fad2342 100644
  22. --- a/thirdparty/openssl/openssl/opensslconf.h
  23. +++ b/thirdparty/openssl/openssl/opensslconf.h
  24. @@ -7,6 +7,20 @@ extern "C" {
  25. /* OpenSSL was configured with the following options: */
  26. #ifndef OPENSSL_DOING_MAKEDEPEND
  27. +// -- GODOT start --
  28. +#if defined(OPENSSL_SYS_WINDOWS)
  29. +# define WIN32_LEAN_AND_MEAN
  30. +// Seems like we have troubles properly using the logic in e_os2.h
  31. +# if defined(_WIN32)
  32. +# define OPENSSL_SYS_WIN32
  33. +# define OPENSSL_SYSNAME_WIN32
  34. +# endif
  35. +# if defined(_WIN64)
  36. +# define OPENSSL_SYS_WIN64
  37. +# define OPENSSL_SYSNAME_WIN64
  38. +# endif
  39. +#endif
  40. +// -- GODOT end --
  41. #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
  42. # define OPENSSL_NO_EC_NISTP_64_GCC_128