From bca18299d24e38f86e914cb1cdfbc6eb68a14701 Mon Sep 17 00:00:00 2001 From: "James E. King, III" Date: Tue, 3 Oct 2017 21:36:17 -0400 Subject: [PATCH] correct Windows UWP platform detection (#57) --- appveyor.yml | 59 ++++++ include/boost/predef/platform.h | 7 +- .../boost/predef/platform/windows_desktop.h | 10 +- include/boost/predef/platform/windows_phone.h | 10 +- .../boost/predef/platform/windows_runtime.h | 18 +- .../boost/predef/platform/windows_server.h | 48 +++++ include/boost/predef/platform/windows_store.h | 12 +- .../boost/predef/platform/windows_system.h | 48 +++++ include/boost/predef/platform/windows_uwp.h | 72 +++++++ test/build.jam | 1 + test/platform_windows.cpp | 176 ++++++++++++++++++ 11 files changed, 445 insertions(+), 16 deletions(-) create mode 100644 include/boost/predef/platform/windows_server.h create mode 100644 include/boost/predef/platform/windows_system.h create mode 100644 include/boost/predef/platform/windows_uwp.h create mode 100644 test/platform_windows.cpp diff --git a/appveyor.yml b/appveyor.yml index 3f3e59a..5f23d61 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,6 +33,15 @@ environment: APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: vs-2012 platform: 32 + - TOOLSET: vs-2012 + COMMENT: UWP DESKTOP + CXXFLAGS: /D_WIN32_WINNT=0x0602 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP + platform: 32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: vs-2012 + COMMENT: UWP STORE + CXXFLAGS: /D_WIN32_WINNT=0x0602 /DWINAPI_FAMILY=WINAPI_FAMILY_APP + platform: 32 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: vs-2013 platform: 32 @@ -40,6 +49,21 @@ environment: - TOOLSET: vs-2013 platform: 64 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: vs-2013 + COMMENT: UWP DESKTOP + CXXFLAGS: /D_WIN32_WINNT=0x0603 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: vs-2013 + COMMENT: UWP PHONE + CXXFLAGS: /D_WIN32_WINNT=0x0603 /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: vs-2013 + COMMENT: UWP STORE + CXXFLAGS: /D_WIN32_WINNT=0x0603 /DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: vs-2015 platform: 32 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 @@ -60,12 +84,47 @@ environment: CXXFLAGS: /std:c++latest platform: 64 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: vs-2017 + COMMENT: UWP DESKTOP + CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: vs-2017 + COMMENT: UWP PHONE + CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: vs-2017 + COMMENT: UWP STORE + CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: vs-2017 + COMMENT: UWP SERVER + CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_SERVER + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: vs-2017 + COMMENT: UWP SYSTEM + CXXFLAGS: /D_WIN32_WINNT=0x0A00 /DWINAPI_FAMILY=WINAPI_FAMILY_SYSTEM + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - TOOLSET: mingw-5 platform: 32 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: mingw64-6 platform: 64 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: mingw64-6 + COMMENT: UWP DESKTOP + CXXFLAGS: -D_WIN32_WINNT=0x0602 -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: mingw64-6 + COMMENT: UWP STORE + CXXFLAGS: -D_WIN32_WINNT=0x0602 -DWINAPI_FAMILY=WINAPI_FAMILY_APP + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 # We can also set up configurations for testing which map to # the b2 build variants. diff --git a/include/boost/predef/platform.h b/include/boost/predef/platform.h index 7da697e..483aeb6 100644 --- a/include/boost/predef/platform.h +++ b/include/boost/predef/platform.h @@ -12,10 +12,13 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #include +#include #include -#include #include -#include +#include +#include +#include +#include // deprecated #include /*#include */ diff --git a/include/boost/predef/platform/windows_desktop.h b/include/boost/predef/platform/windows_desktop.h index 62719b4..77cad1d 100644 --- a/include/boost/predef/platform/windows_desktop.h +++ b/include/boost/predef/platform/windows_desktop.h @@ -9,17 +9,21 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_PLAT_WINDOWS_DESKTOP_H #define BOOST_PREDEF_PLAT_WINDOWS_DESKTOP_H -#include #include #include +#include +#include /*` [heading `BOOST_PLAT_WINDOWS_DESKTOP`] +BOOST_PLAT_WINDOWS_DESKTOP is available if the Platform SDK supports UWP development +with the DESKTOP family, and WINAPI_FAMILY is set to WINAPI_FAMILY_DESKTOP_APP. + [table [[__predef_symbol__] [__predef_version__]] - [[`!WINAPI_FAMILY`] [__predef_detection__]] + [[`WINAPI_FAMILY_DESKTOP_APP`] [__predef_detection__]] [[`WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP`] [__predef_detection__]] ] */ @@ -27,7 +31,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PLAT_WINDOWS_DESKTOP BOOST_VERSION_NUMBER_NOT_AVAILABLE #if BOOST_OS_WINDOWS && \ - ( !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) ) + defined(WINAPI_FAMILY_DESKTOP_APP) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP # undef BOOST_PLAT_WINDOWS_DESKTOP # define BOOST_PLAT_WINDOWS_DESKTOP BOOST_VERSION_NUMBER_AVAILABLE #endif diff --git a/include/boost/predef/platform/windows_phone.h b/include/boost/predef/platform/windows_phone.h index df583ad..acfad0e 100644 --- a/include/boost/predef/platform/windows_phone.h +++ b/include/boost/predef/platform/windows_phone.h @@ -9,23 +9,29 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_PLAT_WINDOWS_PHONE_H #define BOOST_PREDEF_PLAT_WINDOWS_PHONE_H -#include #include #include +#include +#include /*` [heading `BOOST_PLAT_WINDOWS_PHONE`] +BOOST_PLAT_WINDOWS_PHONE is available if the Platform SDK supports UWP development +with the PHONE family, and WINAPI_FAMILY is set to WINAPI_FAMILY_PHONE_APP. + [table [[__predef_symbol__] [__predef_version__]] + [[`WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]] [[`WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]] ] */ #define BOOST_PLAT_WINDOWS_PHONE BOOST_VERSION_NUMBER_NOT_AVAILABLE -#if BOOST_OS_WINDOWS && defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if BOOST_OS_WINDOWS && \ + defined(WINAPI_FAMILY_PHONE_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP # undef BOOST_PLAT_WINDOWS_PHONE # define BOOST_PLAT_WINDOWS_PHONE BOOST_VERSION_NUMBER_AVAILABLE #endif diff --git a/include/boost/predef/platform/windows_runtime.h b/include/boost/predef/platform/windows_runtime.h index 03be514..1282e02 100644 --- a/include/boost/predef/platform/windows_runtime.h +++ b/include/boost/predef/platform/windows_runtime.h @@ -9,25 +9,33 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_PLAT_WINDOWS_RUNTIME_H #define BOOST_PREDEF_PLAT_WINDOWS_RUNTIME_H -#include #include #include +#include +#include +#include /*` [heading `BOOST_PLAT_WINDOWS_RUNTIME`] +This is deprecated. Consumers should switch to use: + + `BOOST_PLAT_WINDOWS_PHONE || BOOST_PLAT_WINDOWS_STORE` + +to detect a non-desktop UWP target. + [table [[__predef_symbol__] [__predef_version__]] - [[`WINAPI_FAMILY == WINAPI_FAMILY_APP`] [__predef_detection__]] - [[`WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]] + [[`BOOST_PLAT_WINDOWS_PHONE`] [__predef_detection__]] + [[`BOOST_PLAT_WINDOWS_STORE`] [__predef_detection__]] ] */ #define BOOST_PLAT_WINDOWS_RUNTIME BOOST_VERSION_NUMBER_NOT_AVAILABLE -#if BOOST_OS_WINDOWS && defined(WINAPI_FAMILY) && \ - ( WINAPI_FAMILY == WINAPI_FAMILY_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP ) +#if BOOST_OS_WINDOWS && \ + (BOOST_PLAT_WINDOWS_STORE || BOOST_PLAT_WINDOWS_PHONE) # undef BOOST_PLAT_WINDOWS_RUNTIME # define BOOST_PLAT_WINDOWS_RUNTIME BOOST_VERSION_NUMBER_AVAILABLE #endif diff --git a/include/boost/predef/platform/windows_server.h b/include/boost/predef/platform/windows_server.h new file mode 100644 index 0000000..0e12ce0 --- /dev/null +++ b/include/boost/predef/platform/windows_server.h @@ -0,0 +1,48 @@ +/* +Copyright James E. King III, 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_PLAT_WINDOWS_SERVER_H +#define BOOST_PREDEF_PLAT_WINDOWS_SERVER_H + +#include +#include +#include +#include + +/*` +[heading `BOOST_PLAT_WINDOWS_SERVER`] + +BOOST_PLAT_WINDOWS_SERVER is available if the Platform SDK supports UWP development +with the SERVER family, and WINAPI_FAMILY is set to WINAPI_FAMILY_SERVER_APP. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`WINAPI_FAMILY_SERVER`] [__predef_detection__]] + [[`WINAPI_FAMILY == WINAPI_FAMILY_SERVER`] [__predef_detection__]] + ] + */ + +#define BOOST_PLAT_WINDOWS_SERVER BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if BOOST_OS_WINDOWS && \ + defined(WINAPI_FAMILY_SERVER) && WINAPI_FAMILY == WINAPI_FAMILY_SERVER +# undef BOOST_PLAT_WINDOWS_SERVER +# define BOOST_PLAT_WINDOWS_SERVER BOOST_VERSION_NUMBER_AVAILABLE +#endif + +#if BOOST_PLAT_WINDOWS_SERVER +# define BOOST_PLAT_WINDOWS_SERVER_AVAILABLE +# include +#endif + +#define BOOST_PLAT_WINDOWS_SERVER_NAME "Windows Server" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_SERVER,BOOST_PLAT_WINDOWS_SERVER_NAME) diff --git a/include/boost/predef/platform/windows_store.h b/include/boost/predef/platform/windows_store.h index a34968b..41c1af1 100644 --- a/include/boost/predef/platform/windows_store.h +++ b/include/boost/predef/platform/windows_store.h @@ -9,9 +9,10 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_PLAT_WINDOWS_STORE_H #define BOOST_PREDEF_PLAT_WINDOWS_STORE_H -#include #include #include +#include +#include /*` [heading `BOOST_PLAT_WINDOWS_STORE`] @@ -19,13 +20,16 @@ http://www.boost.org/LICENSE_1_0.txt) [table [[__predef_symbol__] [__predef_version__]] - [[`WINAPI_FAMILY == WINAPI_FAMILY_APP`] [__predef_detection__]] - ] + [[`WINAPI_FAMILY == WINAPI_FAMILY_PC_APP`] [__predef_detection__]] + [[`WINAPI_FAMILY == WINAPI_FAMILY_APP` (deprecated)] [__predef_detection__]] +] */ #define BOOST_PLAT_WINDOWS_STORE BOOST_VERSION_NUMBER_NOT_AVAILABLE -#if BOOST_OS_WINDOWS && defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP +#if BOOST_OS_WINDOWS && \ + ((defined(WINAPI_FAMILY_PC_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) || \ + (defined(WINAPI_FAMILY_APP) && WINAPI_FAMILY == WINAPI_FAMILY_APP)) # undef BOOST_PLAT_WINDOWS_STORE # define BOOST_PLAT_WINDOWS_STORE BOOST_VERSION_NUMBER_AVAILABLE #endif diff --git a/include/boost/predef/platform/windows_system.h b/include/boost/predef/platform/windows_system.h new file mode 100644 index 0000000..2c3046c --- /dev/null +++ b/include/boost/predef/platform/windows_system.h @@ -0,0 +1,48 @@ +/* +Copyright James E. King III, 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_PLAT_WINDOWS_SYSTEM_H +#define BOOST_PREDEF_PLAT_WINDOWS_SYSTEM_H + +#include +#include +#include +#include + +/*` +[heading `BOOST_PLAT_WINDOWS_SYSTEM`] + +BOOST_PLAT_WINDOWS_SYSTEM is available if the Platform SDK supports UWP development +with the SYSTEM family, and WINAPI_FAMILY is set to WINAPI_FAMILY_SYSTEM_APP. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`WINAPI_FAMILY_SYSTEM`] [__predef_detection__]] + [[`WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM`] [__predef_detection__]] + ] + */ + +#define BOOST_PLAT_WINDOWS_SYSTEM BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if BOOST_OS_WINDOWS && \ + defined(WINAPI_FAMILY_SYSTEM) && WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM +# undef BOOST_PLAT_WINDOWS_SYSTEM +# define BOOST_PLAT_WINDOWS_SYSTEM BOOST_VERSION_NUMBER_AVAILABLE +#endif + +#if BOOST_PLAT_WINDOWS_SYSTEM +# define BOOST_PLAT_WINDOWS_SYSTEM_AVAILABLE +# include +#endif + +#define BOOST_PLAT_WINDOWS_SYSTEM_NAME "Windows Drivers and Tools" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_SYSTEM,BOOST_PLAT_WINDOWS_SYSTEM_NAME) diff --git a/include/boost/predef/platform/windows_uwp.h b/include/boost/predef/platform/windows_uwp.h new file mode 100644 index 0000000..97e1051 --- /dev/null +++ b/include/boost/predef/platform/windows_uwp.h @@ -0,0 +1,72 @@ +/* +Copyright James E. King III, 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_PLAT_WINDOWS_UWP_H +#define BOOST_PREDEF_PLAT_WINDOWS_UWP_H + +#include +#include +#include + +/*` +[heading `BOOST_PLAT_WINDOWS_UWP`] + +[@http://docs.microsoft.com/windows/uwp/ Universal Windows Platform]. +BOOST_PLAT_WINDOWS_UWP is available if the current development environment +is capable of targeting Universal Windows Platform development. To target +a specific family one would define WINAPI_FAMILY, and in a UWP-capable +environment this may limit the Win32 APIs available to achieve portability. + +To detect Windows API availability that is backwards compatible to pre-UWP SDKs, use: + `#if !BOOST_PLAT_WINDOWS_UWP || BOOST_PLAT_WINDOWS_DESKTOP` + +To detect Windows API availability in a specific UWP family, for example SYSTEM: + `#if BOOST_PLAT_WINDOWS_SYSTEM` + +UWP development is available on: + - Microsoft Windows SDK 8.0 or later + - MinGW-w64 version 3.0 or later + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW64_VERSION_MAJOR` from `_mingw.h`] [`>= 3`]] + [[`VER_PRODUCTBUILD` from `ntverp.h`] [`>= 9200`]] +] +*/ + +#define BOOST_PLAT_WINDOWS_UWP BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_PLAT_WINDOWS_SDK_VERSION BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if BOOST_OS_WINDOWS +// MinGW (32-bit) has no ntverp.h header +#if !defined(__MINGW32__) +# include +# undef BOOST_PLAT_WINDOWS_SDK_VERSION +# define BOOST_PLAT_WINDOWS_SDK_VERSION BOOST_VERSION_NUMBER(0, 0, VER_PRODUCTBUILD) +#endif + +// 9200 is Windows SDK 8.0 from ntverp.h which introduced family support +#if ((BOOST_PLAT_WINDOWS_SDK_VERSION >= BOOST_VERSION_NUMBER(0, 0, 9200)) || \ + (defined(__MINGW64__) && __MINGW64_VERSION_MAJOR >= 3)) +# undef BOOST_PLAT_WINDOWS_UWP +# define BOOST_PLAT_WINDOWS_UWP BOOST_VERSION_NUMBER_AVAILABLE +#endif +#endif + +#if BOOST_PLAT_WINDOWS_UWP +# define BOOST_PLAT_WINDOWS_UWP_AVAILABLE +# include +# include // Windows SDK +#endif + +#define BOOST_PLAT_WINDOWS_UWP_NAME "Universal Windows Platform" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_UWP, BOOST_PLAT_WINDOWS_UWP_NAME) diff --git a/test/build.jam b/test/build.jam index 6fc2bdc..223950e 100644 --- a/test/build.jam +++ b/test/build.jam @@ -63,6 +63,7 @@ test-suite predef : [ compile workaround_strict_config.cpp ] [ run tested_at.cpp ] [ compile-fail tested_at_outdated.cpp : always_show_run_output ] + [ compile platform_windows.cpp ] ; # Minimal testing done for predef for CI. Since diff --git a/test/platform_windows.cpp b/test/platform_windows.cpp new file mode 100644 index 0000000..3cab102 --- /dev/null +++ b/test/platform_windows.cpp @@ -0,0 +1,176 @@ +/* +Copyright James E. King, III - 2017 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#include + +// +// This file is used to verify the BOOST_PLAT_WINDOWS_* logic. +// +// To exercise all of the combinations the CI build needs many +// jobs where it defines all the different possible WINAPI_FAMILY +// values on all supported platforms. +// + +// +// UWP is available on Windows SDK 8.0 or later, or on MinGW-w64 major release 3 or later +// +#if (defined(__MINGW64__) && (__MINGW64_VERSION_MAJOR >= 3)) || (BOOST_PLAT_WINDOWS_SDK_VERSION >= 9200) +#if !BOOST_PLAT_WINDOWS_UWP +#error "BOOST_PLAT_WINDOWS_UWP should be available" +#endif +#else +#if BOOST_PLAT_WINDOWS_UWP +#error "BOOST_PLAT_WINDOWS_UWP should not be available" +#endif +#endif + +#if !BOOST_PLAT_WINDOWS_UWP + +// +// If BOOST_PLAT_WINDOWS_UWP not available, none of the other BOOST_PLAT_WINDOWS_* are either +// + +#if BOOST_PLAT_WINDOWS_DESKTOP +#error "BOOST_PLAT_WINDOWS_DESKTOP should not be available" +#endif +#if BOOST_PLAT_WINDOWS_PHONE +#error "BOOST_PLAT_WINDOWS_PHONE should not be available" +#endif +#if BOOST_PLAT_WINDOWS_RUNTIME /* deprecated */ +#error "BOOST_PLAT_WINDOWS_RUNTIME should not be available" +#endif +#if BOOST_PLAT_WINDOWS_SERVER +#error "BOOST_PLAT_WINDOWS_SERVER should not be available" +#endif +#if BOOST_PLAT_WINDOWS_STORE +#error "BOOST_PLAT_WINDOWS_STORE should not be available" +#endif +#if BOOST_PLAT_WINDOWS_SYSTEM +#error "BOOST_PLAT_WINDOWS_SYSTEM should not be available" +#endif + +#else // !BOOST_PLAT_WINDOWS_UWP + +// +// If BOOST_PLAT_WINDOWS_UWP is available, and the SDK supports a particular family, +// and if WINAPI_FAMILY is set to it, then it and only it should be available. +// + +#if !defined(WINAPI_FAMILY) +#error "windows_uwp.h should have included which should have defined supported families" +#endif + +#if WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP +#if !BOOST_PLAT_WINDOWS_DESKTOP +#error "BOOST_PLAT_WINDOWS_DESKTOP should be available" +#endif +#if BOOST_PLAT_WINDOWS_PHONE +#error "BOOST_PLAT_WINDOWS_PHONE should not be available" +#endif +#if BOOST_PLAT_WINDOWS_RUNTIME /* deprecated */ +#error "BOOST_PLAT_WINDOWS_RUNTIME should not be available" +#endif +#if BOOST_PLAT_WINDOWS_SERVER +#error "BOOST_PLAT_WINDOWS_SERVER should not be available" +#endif +#if BOOST_PLAT_WINDOWS_STORE +#error "BOOST_PLAT_WINDOWS_STORE should not be available" +#endif +#if BOOST_PLAT_WINDOWS_SYSTEM +#error "BOOST_PLAT_WINDOWS_SYSTEM should not be available" +#endif +#endif + +#if defined(WINAPI_FAMILY_PHONE_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if BOOST_PLAT_WINDOWS_DESKTOP +#error "BOOST_PLAT_WINDOWS_DESKTOP should not be available" +#endif +#if !BOOST_PLAT_WINDOWS_PHONE +#error "BOOST_PLAT_WINDOWS_PHONE should be available" +#endif +#if !BOOST_PLAT_WINDOWS_RUNTIME /* deprecated */ +#error "BOOST_PLAT_WINDOWS_RUNTIME should be available" +#endif +#if BOOST_PLAT_WINDOWS_SERVER +#error "BOOST_PLAT_WINDOWS_SERVER should not be available" +#endif +#if BOOST_PLAT_WINDOWS_STORE +#error "BOOST_PLAT_WINDOWS_STORE should not be available" +#endif +#if BOOST_PLAT_WINDOWS_SYSTEM +#error "BOOST_PLAT_WINDOWS_SYSTEM should not be available" +#endif +#endif + +#if defined(WINAPI_FAMILY_SERVER_APP) && WINAPI_FAMILY == WINAPI_FAMILY_SERVER_APP +#if BOOST_PLAT_WINDOWS_DESKTOP +#error "BOOST_PLAT_WINDOWS_DESKTOP should not be available" +#endif +#if BOOST_PLAT_WINDOWS_PHONE +#error "BOOST_PLAT_WINDOWS_PHONE should not be available" +#endif +#if BOOST_PLAT_WINDOWS_RUNTIME /* deprecated */ +#error "BOOST_PLAT_WINDOWS_RUNTIME should not be available" +#endif +#if !BOOST_PLAT_WINDOWS_SERVER +#error "BOOST_PLAT_WINDOWS_SERVER should be available" +#endif +#if BOOST_PLAT_WINDOWS_STORE +#error "BOOST_PLAT_WINDOWS_STORE should not be available" +#endif +#if BOOST_PLAT_WINDOWS_SYSTEM +#error "BOOST_PLAT_WINDOWS_SYSTEM should not be available" +#endif +#endif + +// Store is WINAPI_FAMILY_APP in MinGW-w64 and in Windows SDK 8.0 +// then in Windows SDK 8.1 it was deprecated in favor of WINAPI_FAMILY_PC_APP + +#if ((defined(WINAPI_FAMILY_PC_APP) && WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) || \ + (defined(WINAPI_FAMILY_APP) && WINAPI_FAMILY == WINAPI_FAMILY_APP)) +#if BOOST_PLAT_WINDOWS_DESKTOP +#error "BOOST_PLAT_WINDOWS_DESKTOP should not be available" +#endif +#if BOOST_PLAT_WINDOWS_PHONE +#error "BOOST_PLAT_WINDOWS_PHONE should not be available" +#endif +#if !BOOST_PLAT_WINDOWS_RUNTIME /* deprecated */ +#error "BOOST_PLAT_WINDOWS_RUNTIME should be available" +#endif +#if BOOST_PLAT_WINDOWS_SERVER +#error "BOOST_PLAT_WINDOWS_SERVER should not be available" +#endif +#if !BOOST_PLAT_WINDOWS_STORE +#error "BOOST_PLAT_WINDOWS_STORE should be available" +#endif +#if BOOST_PLAT_WINDOWS_SYSTEM +#error "BOOST_PLAT_WINDOWS_SYSTEM should not be available" +#endif +#endif + +#if defined(WINAPI_FAMILY_SYSTEM_APP) && WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM_APP +#if BOOST_PLAT_WINDOWS_DESKTOP +#error "BOOST_PLAT_WINDOWS_DESKTOP should not be available" +#endif +#if BOOST_PLAT_WINDOWS_PHONE +#error "BOOST_PLAT_WINDOWS_PHONE should not be available" +#endif +#if BOOST_PLAT_WINDOWS_RUNTIME /* deprecated */ +#error "BOOST_PLAT_WINDOWS_RUNTIME should not be available" +#endif +#if BOOST_PLAT_WINDOWS_SERVER +#error "BOOST_PLAT_WINDOWS_SERVER should not be available" +#endif +#if BOOST_PLAT_WINDOWS_STORE +#error "BOOST_PLAT_WINDOWS_STORE should not be available" +#endif +#if !BOOST_PLAT_WINDOWS_SYSTEM +#error "BOOST_PLAT_WINDOWS_SYSTEM should be available" +#endif +#endif + +#endif // !BOOST_PLAT_WINDOWS_UWP