winrt_fix.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. diff --git a/thirdparty/openssl/crypto/rand/rand_win.c b/thirdparty/openssl/crypto/rand/rand_win.c
  2. index b4be3097e9..63a9e9975a 100644
  3. --- a/thirdparty/openssl/crypto/rand/rand_win.c
  4. +++ b/thirdparty/openssl/crypto/rand/rand_win.c
  5. @@ -118,8 +118,10 @@
  6. # ifndef _WIN32_WINNT
  7. # define _WIN32_WINNT 0x0400
  8. # endif
  9. +#ifndef WINRT_ENABLED // -- GODOT --
  10. # include <wincrypt.h>
  11. # include <tlhelp32.h>
  12. +#endif // -- GODOT --
  13. /*
  14. * Limit the time spent walking through the heap, processes, threads and
  15. @@ -161,7 +163,7 @@ typedef struct tagCURSORINFO {
  16. # define CURSOR_SHOWING 0x00000001
  17. # endif /* CURSOR_SHOWING */
  18. -# if !defined(OPENSSL_SYS_WINCE)
  19. +# if !defined(OPENSSL_SYS_WINCE) && !defined(WINRT_ENABLED) // -- GODOT --
  20. typedef BOOL(WINAPI *CRYPTACQUIRECONTEXTW) (HCRYPTPROV *, LPCWSTR, LPCWSTR,
  21. DWORD, DWORD);
  22. typedef BOOL(WINAPI *CRYPTGENRANDOM) (HCRYPTPROV, DWORD, BYTE *);
  23. @@ -198,6 +200,7 @@ typedef NET_API_STATUS(NET_API_FUNCTION *NETFREE) (LPBYTE);
  24. #define NOTTOOLONG(start) ((GetTickCount() - (start)) < MAXDELAY)
  25. +#if !defined(WINRT_ENABLED) // -- GODOT --
  26. int RAND_poll(void)
  27. {
  28. MEMORYSTATUS m;
  29. @@ -576,6 +579,8 @@ int RAND_poll(void)
  30. return (1);
  31. }
  32. +#endif // WINRT_ENABLED // -- GODOT --
  33. +
  34. int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam)
  35. {
  36. double add_entropy = 0;
  37. @@ -678,7 +683,7 @@ static void readtimer(void)
  38. static void readscreen(void)
  39. {
  40. -# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN)
  41. +# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) && !defined(WINRT_ENABLED) // -- GODOT --
  42. HDC hScrDC; /* screen DC */
  43. HBITMAP hBitmap; /* handle for our bitmap */
  44. BITMAP bm; /* bitmap properties */
  45. diff --git a/thirdparty/openssl/openssl/dtls1.h b/thirdparty/openssl/openssl/dtls1.h
  46. index 30bbcf278a..31cb6d7eb9 100644
  47. --- a/thirdparty/openssl/openssl/dtls1.h
  48. +++ b/thirdparty/openssl/openssl/dtls1.h
  49. @@ -78,6 +78,9 @@
  50. # include <sys/time.h>
  51. # endif
  52. # endif
  53. +#ifdef WINRT_ENABLED // -- GODOT start --
  54. +#include <winsock2.h>
  55. +#endif // -- GODOT end --
  56. #ifdef __cplusplus
  57. extern "C" {