From 996f1ae29e8d9bd2719f0dc72bfde6a8d77b1b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 27 May 2017 15:44:57 +0200 Subject: openssl: Reapply necessary UWP changes from patch --- thirdparty/README.md | 1 + thirdparty/openssl/crypto/rand/rand_win.c | 9 ++++- thirdparty/openssl/openssl/dtls1.h | 3 ++ thirdparty/openssl/patches/uwp_fix.patch | 64 +++++++++++++++++++++++++++++++ thirdparty/openssl/uwp_fix.patch | 64 ------------------------------- 5 files changed, 75 insertions(+), 66 deletions(-) create mode 100644 thirdparty/openssl/patches/uwp_fix.patch delete mode 100644 thirdparty/openssl/uwp_fix.patch diff --git a/thirdparty/README.md b/thirdparty/README.md index ddec1cb431..0ff1c3f54a 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -266,6 +266,7 @@ Files extracted from the upstream source: ``` For the rest check the `git status` and decide. - e_os.h +- Apply the Godot-specific patches in the `patches/` folder. ## opus diff --git a/thirdparty/openssl/crypto/rand/rand_win.c b/thirdparty/openssl/crypto/rand/rand_win.c index 06670ae017..cb4093128d 100644 --- a/thirdparty/openssl/crypto/rand/rand_win.c +++ b/thirdparty/openssl/crypto/rand/rand_win.c @@ -118,8 +118,10 @@ # ifndef _WIN32_WINNT # define _WIN32_WINNT 0x0400 # endif +#ifndef UWP_ENABLED // -- GODOT -- # include # include +#endif // -- GODOT -- /* * Limit the time spent walking through the heap, processes, threads and @@ -161,7 +163,7 @@ typedef struct tagCURSORINFO { # define CURSOR_SHOWING 0x00000001 # endif /* CURSOR_SHOWING */ -# if !defined(OPENSSL_SYS_WINCE) +# if !defined(OPENSSL_SYS_WINCE) && !defined(UWP_ENABLED) // -- GODOT -- typedef BOOL(WINAPI *CRYPTACQUIRECONTEXTW) (HCRYPTPROV *, LPCWSTR, LPCWSTR, DWORD, DWORD); typedef BOOL(WINAPI *CRYPTGENRANDOM) (HCRYPTPROV, DWORD, BYTE *); @@ -196,6 +198,7 @@ typedef NET_API_STATUS(NET_API_FUNCTION *NETFREE) (LPBYTE); # endif /* 1 */ # endif /* !OPENSSL_SYS_WINCE */ +#if !defined(UWP_ENABLED) // -- GODOT -- int RAND_poll(void) { MEMORYSTATUS m; @@ -580,6 +583,8 @@ int RAND_poll(void) return (1); } +#endif // UWP_ENABLED // -- GODOT -- + int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam) { double add_entropy = 0; @@ -682,7 +687,7 @@ static void readtimer(void) static void readscreen(void) { -# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) +# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) && !defined(UWP_ENABLED) // -- GODOT -- HDC hScrDC; /* screen DC */ HBITMAP hBitmap; /* handle for our bitmap */ BITMAP bm; /* bitmap properties */ diff --git a/thirdparty/openssl/openssl/dtls1.h b/thirdparty/openssl/openssl/dtls1.h index 30bbcf278a..81d28c29cd 100644 --- a/thirdparty/openssl/openssl/dtls1.h +++ b/thirdparty/openssl/openssl/dtls1.h @@ -78,6 +78,9 @@ # include # endif # endif +#ifdef UWP_ENABLED // -- GODOT start -- +#include +#endif // -- GODOT end -- #ifdef __cplusplus extern "C" { diff --git a/thirdparty/openssl/patches/uwp_fix.patch b/thirdparty/openssl/patches/uwp_fix.patch new file mode 100644 index 0000000000..54aeb1f80d --- /dev/null +++ b/thirdparty/openssl/patches/uwp_fix.patch @@ -0,0 +1,64 @@ +diff --git a/thirdparty/openssl/crypto/rand/rand_win.c b/thirdparty/openssl/crypto/rand/rand_win.c +index 06670ae01..cb4093128 100644 +--- a/thirdparty/openssl/crypto/rand/rand_win.c ++++ b/thirdparty/openssl/crypto/rand/rand_win.c +@@ -118,8 +118,10 @@ + # ifndef _WIN32_WINNT + # define _WIN32_WINNT 0x0400 + # endif ++#ifndef UWP_ENABLED // -- GODOT -- + # include + # include ++#endif // -- GODOT -- + + /* + * Limit the time spent walking through the heap, processes, threads and +@@ -161,7 +163,7 @@ typedef struct tagCURSORINFO { + # define CURSOR_SHOWING 0x00000001 + # endif /* CURSOR_SHOWING */ + +-# if !defined(OPENSSL_SYS_WINCE) ++# if !defined(OPENSSL_SYS_WINCE) && !defined(UWP_ENABLED) // -- GODOT -- + typedef BOOL(WINAPI *CRYPTACQUIRECONTEXTW) (HCRYPTPROV *, LPCWSTR, LPCWSTR, + DWORD, DWORD); + typedef BOOL(WINAPI *CRYPTGENRANDOM) (HCRYPTPROV, DWORD, BYTE *); +@@ -196,6 +198,7 @@ typedef NET_API_STATUS(NET_API_FUNCTION *NETFREE) (LPBYTE); + # endif /* 1 */ + # endif /* !OPENSSL_SYS_WINCE */ + ++#if !defined(UWP_ENABLED) // -- GODOT -- + int RAND_poll(void) + { + MEMORYSTATUS m; +@@ -580,6 +583,8 @@ int RAND_poll(void) + return (1); + } + ++#endif // UWP_ENABLED // -- GODOT -- ++ + int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam) + { + double add_entropy = 0; +@@ -682,7 +687,7 @@ static void readtimer(void) + + static void readscreen(void) + { +-# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) ++# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) && !defined(UWP_ENABLED) // -- GODOT -- + HDC hScrDC; /* screen DC */ + HBITMAP hBitmap; /* handle for our bitmap */ + BITMAP bm; /* bitmap properties */ +diff --git a/thirdparty/openssl/openssl/dtls1.h b/thirdparty/openssl/openssl/dtls1.h +index 30bbcf278..81d28c29c 100644 +--- a/thirdparty/openssl/openssl/dtls1.h ++++ b/thirdparty/openssl/openssl/dtls1.h +@@ -78,6 +78,9 @@ + # include + # endif + # endif ++#ifdef UWP_ENABLED // -- GODOT start -- ++#include ++#endif // -- GODOT end -- + + #ifdef __cplusplus + extern "C" { diff --git a/thirdparty/openssl/uwp_fix.patch b/thirdparty/openssl/uwp_fix.patch deleted file mode 100644 index 00d8b64d00..0000000000 --- a/thirdparty/openssl/uwp_fix.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/drivers/builtin_openssl2/crypto/rand/rand_win.c b/drivers/builtin_openssl2/crypto/rand/rand_win.c -index 06670ae..70fd52a 100644 ---- a/drivers/builtin_openssl2/crypto/rand/rand_win.c -+++ b/drivers/builtin_openssl2/crypto/rand/rand_win.c -@@ -118,8 +118,10 @@ - # ifndef _WIN32_WINNT - # define _WIN32_WINNT 0x0400 - # endif -+#ifndef UWP_ENABLED - # include - # include -+#endif - - /* - * Limit the time spent walking through the heap, processes, threads and -@@ -161,7 +163,7 @@ typedef struct tagCURSORINFO { - # define CURSOR_SHOWING 0x00000001 - # endif /* CURSOR_SHOWING */ - --# if !defined(OPENSSL_SYS_WINCE) -+# if !defined(OPENSSL_SYS_WINCE) && !defined(UWP_ENABLED) - typedef BOOL(WINAPI *CRYPTACQUIRECONTEXTW) (HCRYPTPROV *, LPCWSTR, LPCWSTR, - DWORD, DWORD); - typedef BOOL(WINAPI *CRYPTGENRANDOM) (HCRYPTPROV, DWORD, BYTE *); -@@ -196,6 +198,7 @@ typedef NET_API_STATUS(NET_API_FUNCTION *NETFREE) (LPBYTE); - # endif /* 1 */ - # endif /* !OPENSSL_SYS_WINCE */ - -+#if !defined(UWP_ENABLED) - int RAND_poll(void) - { - MEMORYSTATUS m; -@@ -580,6 +583,8 @@ int RAND_poll(void) - return (1); - } - -+#endif // UWP_ENABLED -+ - int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam) - { - double add_entropy = 0; -@@ -682,7 +687,7 @@ static void readtimer(void) - - static void readscreen(void) - { --# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) -+# if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN) && !defined(UWP_ENABLED) - HDC hScrDC; /* screen DC */ - HBITMAP hBitmap; /* handle for our bitmap */ - BITMAP bm; /* bitmap properties */ -diff --git a/drivers/builtin_openssl2/openssl/dtls1.h b/drivers/builtin_openssl2/openssl/dtls1.h -index 64ad3c8..a58aca2 100644 ---- a/drivers/builtin_openssl2/openssl/dtls1.h -+++ b/drivers/builtin_openssl2/openssl/dtls1.h -@@ -81,6 +81,9 @@ - # include - # endif - # endif -+#ifdef UWP_ENABLED -+#include -+#endif - - #ifdef __cplusplus - extern "C" { -- cgit v1.2.3