From 7f3df8040858bc604b4b7ec9e6e3544e7184c9ca Mon Sep 17 00:00:00 2001 From: Marco Deckel Date: Sun, 21 Aug 2016 13:44:33 +0200 Subject: win: Basic support for Universal Windows Platform apps Closes #820 --- lib/connect.c | 3 +++ lib/curl_setup.h | 10 ++++++++++ lib/getenv.c | 3 ++- lib/md5.c | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/connect.c b/lib/connect.c index 0047f9a0b..7f8c0870a 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -130,6 +130,9 @@ tcpkeepalive(struct Curl_easy *data, infof(data, "Failed to set SIO_KEEPALIVE_VALS on fd %d: %d\n", (int)sockfd, WSAGetLastError()); } +#elif defined(CURL_WINDOWS_APP) + (void)majorVersion; + detectOsState = DETECT_OS_VISTA_OR_LATER; #else #ifdef TCP_KEEPIDLE optval = curlx_sltosi(data->set.tcp_keepidle); diff --git a/lib/curl_setup.h b/lib/curl_setup.h index e585ea6a5..9f29b2e9a 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -747,4 +747,14 @@ endings either CRLF or LF so 't' is appropriate. # endif #endif /* DONT_USE_RECV_BEFORE_SEND_WORKAROUNDS */ +/* Detect Windows App environment which has a restricted access + * to the Win32 APIs. */ +# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602) +# include +# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \ + !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +# define CURL_WINDOWS_APP +# endif +# endif + #endif /* HEADER_CURL_SETUP_H */ diff --git a/lib/getenv.c b/lib/getenv.c index 50bb79f53..89d181de3 100644 --- a/lib/getenv.c +++ b/lib/getenv.c @@ -30,7 +30,8 @@ static char *GetEnv(const char *variable) { -#ifdef _WIN32_WCE +#if defined(_WIN32_WCE) || defined(CURL_WINDOWS_APP) + (void)variable; return NULL; #else #ifdef WIN32 diff --git a/lib/md5.c b/lib/md5.c index 84adb9926..f818d3288 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -124,7 +124,7 @@ static void MD5_Final(unsigned char digest[16], MD5_CTX *ctx) CC_MD5_Final(digest, ctx); } -#elif defined(_WIN32) +#elif defined(_WIN32) && !defined(CURL_WINDOWS_APP) #include #include "curl_memory.h" -- cgit v1.2.3