pineapple-src/externals/vcpkg/ports/libssh2/0001-Fix-UWP.patch
2022-07-23 03:01:36 +02:00

64 lines
2.1 KiB
Diff
Executable file

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6401acf..64de3e9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -349,7 +349,7 @@ target_include_directories(libssh2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
# Check for the OS.
# Daniel's note: this should not be necessary and we need to work to
# get this removed.
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows" OR ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
target_compile_definitions(libssh2 PRIVATE LIBSSH2_WIN32)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
target_compile_definitions(libssh2 PRIVATE LIBSSH2_DARWIN)
diff --git a/src/agent.c b/src/agent.c
index c2ba422..f1799f8 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -55,6 +55,10 @@
#include <stdlib.h>
#endif
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+#define IS_UWP 1
+#endif /* #if defined(WINAPI_FAMILY) */
+
/* Requests from client to agent for protocol 1 key operations */
#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1
#define SSH_AGENTC_RSA_CHALLENGE 3
@@ -254,7 +258,7 @@ struct agent_ops agent_ops_unix = {
};
#endif /* PF_UNIX */
-#ifdef WIN32
+#if defined(WIN32) && !defined(IS_UWP)
/* Code to talk to Pageant was taken from PuTTY.
*
* Portions copyright Robert de Bath, Joris van Rantwijk, Delian
@@ -362,8 +366,8 @@ static struct {
const char *name;
struct agent_ops *ops;
} supported_backends[] = {
-#ifdef WIN32
- {"Pageant", &agent_ops_pageant},
+#if defined(WIN32) && !defined(IS_UWP)
+ {"Pageant", &agent_ops_pageant},
{"OpenSSH", &agent_ops_openssh},
#endif /* WIN32 */
#ifdef PF_UNIX
diff --git a/src/agent_win.c b/src/agent_win.c
--- a/src/agent_win.c
+++ b/src/agent_win.c
@@ -55,7 +55,11 @@
#include <stdlib.h>
#endif
-#ifdef WIN32
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+#define IS_UWP 1
+#endif /* #if defined(WINAPI_FAMILY) */
+
+#if defined(WIN32) && !defined(IS_UWP)
/* Code to talk to OpenSSH was taken and modified from the Win32 port of
* Portable OpenSSH by the PowerShell team. Commit
* 8ab565c53f3619d6a1f5ac229e212cad8a52852c of