]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_setup: Improve detection of CURL_WINDOWS_APP
authorMartin Storsjo <martin@martin.st>
Fri, 27 Oct 2017 08:21:01 +0000 (11:21 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 27 Oct 2017 09:02:42 +0000 (11:02 +0200)
If WINAPI_FAMILY is defined, it should be safe to try to include
winapifamily.h to check what the define evaluates to.

This should fix detection of CURL_WINDOWS_APP if building with
_WIN32_WINNT set to 0x0600.

Closes #2025

lib/curl_setup.h

index 402ebc03d2179780f3bcd5e718b7e43eaa902d23..efd8281a455a44e1efd8babef3d44c4e617be233 100644 (file)
@@ -751,7 +751,7 @@ endings either CRLF or LF so 't' is appropriate.
 
 /* Detect Windows App environment which has a restricted access
  * to the Win32 APIs. */
-# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)
+# if (defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)) || defined(WINAPI_FAMILY)
 #  include <winapifamily.h>
 #  if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
      !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)