From ba45bd73f35ffe1690848c063371faecb586417c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 1 Aug 2017 12:24:55 -0500 Subject: [PATCH 01/11] Seems we need to avoid duplicate project names. --- test/build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/build.jam b/test/build.jam index 43bf007..6fc2bdc 100755 --- a/test/build.jam +++ b/test/build.jam @@ -38,7 +38,7 @@ else predef-dependency = $(predef-include-root)/boost/predef.h ; } -project test +project predef-test : requirements $(predef-include-root) # Add explicit dependency since we don't have header scanner for From aa4604a3bd23a29839633852f1e3325ab4886b06 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Sun, 17 Sep 2017 10:21:38 -0400 Subject: [PATCH 02/11] Remove executable attribute from file. (#53) --- test/build.jam | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 test/build.jam diff --git a/test/build.jam b/test/build.jam old mode 100755 new mode 100644 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 03/11] 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 From 284cde95a24d213d9ae3c7326d6b536a71f162e2 Mon Sep 17 00:00:00 2001 From: "James E. King, III" Date: Wed, 4 Oct 2017 11:20:45 -0400 Subject: [PATCH 04/11] isolate all headers to ensure that none rely on inclusions from another (#60) --- test/build.jam | 28 ++++++++++++++++++++++++++++ test/compile/decl_header.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 test/compile/decl_header.cpp diff --git a/test/build.jam b/test/build.jam index 223950e..0ca4056 100644 --- a/test/build.jam +++ b/test/build.jam @@ -46,9 +46,37 @@ project predef-test $(predef-dependency) ; +import path ; +import regex ; using testing ; +# this rule enumerates through all the headers and ensures +# that inclusion of the header by itself is sufficient to +# compile successfully, proving the header does not depend +# on any other headers to be included first - adapted from +# logic in the winapi test bjam script +rule test_all_headers_isolated +{ + local all_rules = ; + local file ; + local headers_path = [ path.make $(BOOST_ROOT)/libs/predef/include/boost/predef ] ; + for file in [ path.glob-tree $(headers_path) : *.h* : predef ] + { + local rel_file = [ path.relative-to $(headers_path) $(file) ] ; + # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end. + # All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes. + local test_name = [ regex.replace $(rel_file) "/" "-" ] ; + local decl_test_name = ~hdr-decl-$(test_name) ; + # ECHO $(rel_file) ; + all_rules += [ compile compile/decl_header.cpp : "BOOST_PREDEF_TEST_HEADER=$(rel_file)" $(file) : $(decl_test_name) ] ; + } + + # ECHO All rules: $(all_rules) ; + return $(all_rules) ; +} + test-suite predef : + [ test_all_headers_isolated ] [ run info_as_cpp.cpp : : : always_show_run_output ] [ run info_as_c.c : : : always_show_run_output ] [ run info_as_objcpp.mm : : : always_show_run_output ] diff --git a/test/compile/decl_header.cpp b/test/compile/decl_header.cpp new file mode 100644 index 0000000..8cc3b05 --- /dev/null +++ b/test/compile/decl_header.cpp @@ -0,0 +1,24 @@ +/* + * Copyright Andrey Semashev 2015. + * 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) + */ +/*! + * \file decl_header.cpp + * \author Andrey Semashev + * \date 21.06.2015 + * + * \brief This file contains a test boilerplate for checking that every + * public header is self-contained and does not have any missing + * #includes. + */ + +#define BOOST_PREDEF_TEST_INCLUDE_HEADER() + +#include BOOST_PREDEF_TEST_INCLUDE_HEADER() + +int main(int, char*[]) +{ + return 0; +} From 7c99dfbbd54c775084318cc387adb31ad8da4f05 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 4 Oct 2017 14:13:28 -0500 Subject: [PATCH 05/11] Revert "isolate all headers to ensure that none rely on inclusions from another (#60)" (#62) This reverts commit 284cde95a24d213d9ae3c7326d6b536a71f162e2. --- test/build.jam | 28 ---------------------------- test/compile/decl_header.cpp | 24 ------------------------ 2 files changed, 52 deletions(-) delete mode 100644 test/compile/decl_header.cpp diff --git a/test/build.jam b/test/build.jam index 0ca4056..223950e 100644 --- a/test/build.jam +++ b/test/build.jam @@ -46,37 +46,9 @@ project predef-test $(predef-dependency) ; -import path ; -import regex ; using testing ; -# this rule enumerates through all the headers and ensures -# that inclusion of the header by itself is sufficient to -# compile successfully, proving the header does not depend -# on any other headers to be included first - adapted from -# logic in the winapi test bjam script -rule test_all_headers_isolated -{ - local all_rules = ; - local file ; - local headers_path = [ path.make $(BOOST_ROOT)/libs/predef/include/boost/predef ] ; - for file in [ path.glob-tree $(headers_path) : *.h* : predef ] - { - local rel_file = [ path.relative-to $(headers_path) $(file) ] ; - # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end. - # All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes. - local test_name = [ regex.replace $(rel_file) "/" "-" ] ; - local decl_test_name = ~hdr-decl-$(test_name) ; - # ECHO $(rel_file) ; - all_rules += [ compile compile/decl_header.cpp : "BOOST_PREDEF_TEST_HEADER=$(rel_file)" $(file) : $(decl_test_name) ] ; - } - - # ECHO All rules: $(all_rules) ; - return $(all_rules) ; -} - test-suite predef : - [ test_all_headers_isolated ] [ run info_as_cpp.cpp : : : always_show_run_output ] [ run info_as_c.c : : : always_show_run_output ] [ run info_as_objcpp.mm : : : always_show_run_output ] diff --git a/test/compile/decl_header.cpp b/test/compile/decl_header.cpp deleted file mode 100644 index 8cc3b05..0000000 --- a/test/compile/decl_header.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright Andrey Semashev 2015. - * 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) - */ -/*! - * \file decl_header.cpp - * \author Andrey Semashev - * \date 21.06.2015 - * - * \brief This file contains a test boilerplate for checking that every - * public header is self-contained and does not have any missing - * #includes. - */ - -#define BOOST_PREDEF_TEST_INCLUDE_HEADER() - -#include BOOST_PREDEF_TEST_INCLUDE_HEADER() - -int main(int, char*[]) -{ - return 0; -} From de79c6d341e2e7e3226c29d72d6ac8061071672a Mon Sep 17 00:00:00 2001 From: Roki Date: Wed, 11 Oct 2017 22:16:56 +0900 Subject: [PATCH 06/11] fix typo s/BOOST_ARCH_PARISK/BOOST_ARCH_PARISC (#63) --- include/boost/predef/architecture/parisc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/predef/architecture/parisc.h b/include/boost/predef/architecture/parisc.h index 7c7625f..c75a1f3 100644 --- a/include/boost/predef/architecture/parisc.h +++ b/include/boost/predef/architecture/parisc.h @@ -12,7 +12,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include /*` -[heading `BOOST_ARCH_PARISK`] +[heading `BOOST_ARCH_PARISC`] [@http://en.wikipedia.org/wiki/PA-RISC_family HP/PA RISC] architecture. From 7c17b932e4ac9d33272c91cfb45d7cff994f0c32 Mon Sep 17 00:00:00 2001 From: "James E. King, III" Date: Mon, 16 Oct 2017 19:41:33 -0400 Subject: [PATCH 07/11] detect mingw32 and mingw64 as separate entities (#61) --- include/boost/predef/platform.h | 2 + include/boost/predef/platform/mingw.h | 4 +- include/boost/predef/platform/mingw32.h | 63 +++++++++++++++++++++++++ include/boost/predef/platform/mingw64.h | 63 +++++++++++++++++++++++++ 4 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 include/boost/predef/platform/mingw32.h create mode 100644 include/boost/predef/platform/mingw64.h diff --git a/include/boost/predef/platform.h b/include/boost/predef/platform.h index 483aeb6..86ca707 100644 --- a/include/boost/predef/platform.h +++ b/include/boost/predef/platform.h @@ -12,6 +12,8 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #include +#include +#include #include #include #include diff --git a/include/boost/predef/platform/mingw.h b/include/boost/predef/platform/mingw.h index 5a1334b..c52827d 100644 --- a/include/boost/predef/platform/mingw.h +++ b/include/boost/predef/platform/mingw.h @@ -14,7 +14,7 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_PLAT_MINGW`] -[@http://en.wikipedia.org/wiki/MinGW MinGW] platform. +[@http://en.wikipedia.org/wiki/MinGW MinGW] platform, either variety. Version number available as major, minor, and patch. [table @@ -56,7 +56,7 @@ Version number available as major, minor, and patch. # include #endif -#define BOOST_PLAT_MINGW_NAME "MinGW" +#define BOOST_PLAT_MINGW_NAME "MinGW (any variety)" #endif diff --git a/include/boost/predef/platform/mingw32.h b/include/boost/predef/platform/mingw32.h new file mode 100644 index 0000000..ff90038 --- /dev/null +++ b/include/boost/predef/platform/mingw32.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +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_MINGW32_H +#define BOOST_PREDEF_PLAT_MINGW32_H + +#include +#include + +/*` +[heading `BOOST_PLAT_MINGW32`] + +[@http://www.mingw.org/ MinGW] platform. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW32__`] [__predef_detection__]] + + [[`__MINGW32_VERSION_MAJOR`, `__MINGW32_VERSION_MINOR`] [V.R.0]] + ] + */ + +#define BOOST_PLAT_MINGW32 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MINGW32__) +# include <_mingw.h> +# if !defined(BOOST_PLAT_MINGW32_DETECTION) && (defined(__MINGW32_VERSION_MAJOR) && defined(__MINGW32_VERSION_MINOR)) +# define BOOST_PLAT_MINGW32_DETECTION \ + BOOST_VERSION_NUMBER(__MINGW32_VERSION_MAJOR,__MINGW32_VERSION_MINOR,0) +# endif +# if !defined(BOOST_PLAT_MINGW32_DETECTION) +# define BOOST_PLAT_MINGW32_DETECTION BOOST_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef BOOST_PLAT_MINGW32_DETECTION +# define BOOST_PLAT_MINGW32_AVAILABLE +# if defined(BOOST_PREDEF_DETAIL_PLAT_DETECTED) +# define BOOST_PLAT_MINGW32_EMULATED BOOST_PLAT_MINGW32_DETECTION +# else +# undef BOOST_PLAT_MINGW32 +# define BOOST_PLAT_MINGW32 BOOST_PLAT_MINGW32_DETECTION +# endif +# include +#endif + +#define BOOST_PLAT_MINGW32_NAME "MinGW" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW32,BOOST_PLAT_MINGW32_NAME) + +#ifdef BOOST_PLAT_MINGW32_EMULATED +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW32_EMULATED,BOOST_PLAT_MINGW32_NAME) +#endif diff --git a/include/boost/predef/platform/mingw64.h b/include/boost/predef/platform/mingw64.h new file mode 100644 index 0000000..a35dd3e --- /dev/null +++ b/include/boost/predef/platform/mingw64.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +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_MINGW64_H +#define BOOST_PREDEF_PLAT_MINGW64_H + +#include +#include + +/*` +[heading `BOOST_PLAT_MINGW64`] + +[@https://mingw-w64.org/ MinGW-w64] platform. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW64__`] [__predef_detection__]] + + [[`__MINGW64_VERSION_MAJOR`, `__MINGW64_VERSION_MINOR`] [V.R.0]] + ] + */ + +#define BOOST_PLAT_MINGW64 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MINGW64__) +# include <_mingw.h> +# if !defined(BOOST_PLAT_MINGW64_DETECTION) && (defined(__MINGW64_VERSION_MAJOR) && defined(__MINGW64_VERSION_MINOR)) +# define BOOST_PLAT_MINGW64_DETECTION \ + BOOST_VERSION_NUMBER(__MINGW64_VERSION_MAJOR,__MINGW64_VERSION_MINOR,0) +# endif +# if !defined(BOOST_PLAT_MINGW64_DETECTION) +# define BOOST_PLAT_MINGW64_DETECTION BOOST_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef BOOST_PLAT_MINGW64_DETECTION +# define BOOST_PLAT_MINGW64_AVAILABLE +# if defined(BOOST_PREDEF_DETAIL_PLAT_DETECTED) +# define BOOST_PLAT_MINGW64_EMULATED BOOST_PLAT_MINGW64_DETECTION +# else +# undef BOOST_PLAT_MINGW64 +# define BOOST_PLAT_MINGW64 BOOST_PLAT_MINGW64_DETECTION +# endif +# include +#endif + +#define BOOST_PLAT_MINGW64_NAME "MinGW-w64" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW64,BOOST_PLAT_MINGW64_NAME) + +#ifdef BOOST_PLAT_MINGW64_EMULATED +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW64_EMULATED,BOOST_PLAT_MINGW64_NAME) +#endif From 0ab200d19e9216059706b5d9a33645fa711164e7 Mon Sep 17 00:00:00 2001 From: "James E. King, III" Date: Wed, 18 Oct 2017 08:00:02 -0400 Subject: [PATCH 08/11] make BOOST_PLAT_WINDOWS_DESKTOP available in older SDKs for backwards compatibility (#64) --- .../boost/predef/platform/windows_desktop.h | 10 ++++++---- include/boost/predef/platform/windows_phone.h | 5 ++--- .../boost/predef/platform/windows_runtime.h | 8 ++++---- include/boost/predef/platform/windows_server.h | 5 ++--- include/boost/predef/platform/windows_store.h | 3 +++ include/boost/predef/platform/windows_system.h | 5 ++--- include/boost/predef/platform/windows_uwp.h | 18 +++--------------- test/platform_windows.cpp | 7 ++++--- 8 files changed, 26 insertions(+), 35 deletions(-) diff --git a/include/boost/predef/platform/windows_desktop.h b/include/boost/predef/platform/windows_desktop.h index 77cad1d..afb3907 100644 --- a/include/boost/predef/platform/windows_desktop.h +++ b/include/boost/predef/platform/windows_desktop.h @@ -17,21 +17,23 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [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. +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Desktop development. Also available if the Platform SDK is too +old to support UWP. [table [[__predef_symbol__] [__predef_version__]] - [[`WINAPI_FAMILY_DESKTOP_APP`] [__predef_detection__]] [[`WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP`] [__predef_detection__]] + [[`!BOOST_PLAT_WINDOWS_UWP`] [__predef_detection__]] ] */ #define BOOST_PLAT_WINDOWS_DESKTOP BOOST_VERSION_NUMBER_NOT_AVAILABLE #if BOOST_OS_WINDOWS && \ - defined(WINAPI_FAMILY_DESKTOP_APP) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP + ((defined(WINAPI_FAMILY_DESKTOP_APP) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) || \ + !BOOST_PLAT_WINDOWS_UWP) # 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 acfad0e..0ebc76d 100644 --- a/include/boost/predef/platform/windows_phone.h +++ b/include/boost/predef/platform/windows_phone.h @@ -17,13 +17,12 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [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. +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Phone development. [table [[__predef_symbol__] [__predef_version__]] - [[`WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]] [[`WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]] ] */ diff --git a/include/boost/predef/platform/windows_runtime.h b/include/boost/predef/platform/windows_runtime.h index 1282e02..e7978d7 100644 --- a/include/boost/predef/platform/windows_runtime.h +++ b/include/boost/predef/platform/windows_runtime.h @@ -18,11 +18,11 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_PLAT_WINDOWS_RUNTIME`] -This is deprecated. Consumers should switch to use: +Deprecated. - `BOOST_PLAT_WINDOWS_PHONE || BOOST_PLAT_WINDOWS_STORE` - -to detect a non-desktop UWP target. +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Phone or Store development. This does not align to the existing development model for +UWP and is deprecated. Use one of the other `BOOST_PLAT_WINDOWS_*`definitions instead. [table [[__predef_symbol__] [__predef_version__]] diff --git a/include/boost/predef/platform/windows_server.h b/include/boost/predef/platform/windows_server.h index 0e12ce0..7bd629d 100644 --- a/include/boost/predef/platform/windows_server.h +++ b/include/boost/predef/platform/windows_server.h @@ -16,13 +16,12 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [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. +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Server development. [table [[__predef_symbol__] [__predef_version__]] - [[`WINAPI_FAMILY_SERVER`] [__predef_detection__]] [[`WINAPI_FAMILY == WINAPI_FAMILY_SERVER`] [__predef_detection__]] ] */ diff --git a/include/boost/predef/platform/windows_store.h b/include/boost/predef/platform/windows_store.h index 41c1af1..3a3fd8e 100644 --- a/include/boost/predef/platform/windows_store.h +++ b/include/boost/predef/platform/windows_store.h @@ -17,6 +17,9 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_PLAT_WINDOWS_STORE`] +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Store development. + [table [[__predef_symbol__] [__predef_version__]] diff --git a/include/boost/predef/platform/windows_system.h b/include/boost/predef/platform/windows_system.h index 2c3046c..92f424f 100644 --- a/include/boost/predef/platform/windows_system.h +++ b/include/boost/predef/platform/windows_system.h @@ -16,13 +16,12 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [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. +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows System development. [table [[__predef_symbol__] [__predef_version__]] - [[`WINAPI_FAMILY_SYSTEM`] [__predef_detection__]] [[`WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM`] [__predef_detection__]] ] */ diff --git a/include/boost/predef/platform/windows_uwp.h b/include/boost/predef/platform/windows_uwp.h index 97e1051..e4c6647 100644 --- a/include/boost/predef/platform/windows_uwp.h +++ b/include/boost/predef/platform/windows_uwp.h @@ -15,21 +15,9 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [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 +[@http://docs.microsoft.com/windows/uwp/ Universal Windows Platform] +is available if the current development environment is capable of targeting +UWP development. [table [[__predef_symbol__] [__predef_version__]] diff --git a/test/platform_windows.cpp b/test/platform_windows.cpp index 3cab102..53f3ecc 100644 --- a/test/platform_windows.cpp +++ b/test/platform_windows.cpp @@ -31,11 +31,12 @@ http://www.boost.org/LICENSE_1_0.txt) #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_UWP is not available, none of the other BOOST_PLAT_WINDOWS_* are either +// except for BOOST_PLAT_WINDOWS_DESKTOP which is available for backwards compatibility. // -#if BOOST_PLAT_WINDOWS_DESKTOP -#error "BOOST_PLAT_WINDOWS_DESKTOP should not be available" +#if BOOST_OS_WINDOWS && !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" From 1c0b55c2f909e7dee1085f6b491ecd07ce61ce58 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 23 Oct 2017 09:25:43 -0500 Subject: [PATCH 09/11] Some tweak for 1.7 release. * Bump version to 1.7 * Tweak docs for UWP detection. * Add 1.7 history items. --- doc/history.qbk | 5 +++++ doc/predef.qbk | 2 +- include/boost/predef/platform/windows_runtime.h | 9 ++++----- include/boost/predef/platform/windows_uwp.h | 13 +++++++++---- include/boost/predef/version.h | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/doc/history.qbk b/doc/history.qbk index 4af13d3..b3e13d9 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -7,6 +7,11 @@ http://www.boost.org/LICENSE_1_0.txt) [section History] +[heading 1.7] + +* Fix BOOST_ARCH_PARISK/BOOST_ARCH_PARISC typo. +* Improved Windows Universal Platform detection. (from James E. King, III) + [heading 1.6] * Fix Intel C/C++ version 9999 detection to be 12.1.0. diff --git a/doc/predef.qbk b/doc/predef.qbk index c5d39c6..4e8b79b 100644 --- a/doc/predef.qbk +++ b/doc/predef.qbk @@ -1,6 +1,6 @@ [article Boost.Predef [quickbook 1.7] - [version 1.6] + [version 1.7] [authors [Rivera, Rene]] [copyright 2005-2016 Rene Rivera] [copyright 2015 Charly Chevalier] diff --git a/include/boost/predef/platform/windows_runtime.h b/include/boost/predef/platform/windows_runtime.h index 1282e02..c67afef 100644 --- a/include/boost/predef/platform/windows_runtime.h +++ b/include/boost/predef/platform/windows_runtime.h @@ -18,11 +18,10 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [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. +To detect a non-desktop UWP target It is preferable to use the more specific: +``` + BOOST_PLAT_WINDOWS_PHONE || BOOST_PLAT_WINDOWS_STORE +``` [table [[__predef_symbol__] [__predef_version__]] diff --git a/include/boost/predef/platform/windows_uwp.h b/include/boost/predef/platform/windows_uwp.h index 97e1051..56bbf33 100644 --- a/include/boost/predef/platform/windows_uwp.h +++ b/include/boost/predef/platform/windows_uwp.h @@ -22,14 +22,19 @@ 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` +``` + #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` +``` + #if BOOST_PLAT_WINDOWS_SYSTEM +``` UWP development is available on: - - Microsoft Windows SDK 8.0 or later - - MinGW-w64 version 3.0 or later + +* Microsoft Windows SDK 8.0 or later +* MinGW-w64 version 3.0 or later [table [[__predef_symbol__] [__predef_version__]] diff --git a/include/boost/predef/version.h b/include/boost/predef/version.h index e03469f..bcf97ad 100644 --- a/include/boost/predef/version.h +++ b/include/boost/predef/version.h @@ -10,6 +10,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include -#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,6,0) +#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,7,0) #endif From 6f8a9ae4409cbf7ab0fa7f204072ce9bfe348fa7 Mon Sep 17 00:00:00 2001 From: "James E. King, III" Date: Mon, 23 Oct 2017 14:54:01 -0400 Subject: [PATCH 10/11] platform detection for CloudABI with cloudlibc detection (#65) --- include/boost/predef/library/c.h | 1 + include/boost/predef/library/c/cloudlibc.h | 53 ++++++++++++++++++++++ include/boost/predef/platform.h | 1 + include/boost/predef/platform/cloudabi.h | 43 ++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 include/boost/predef/library/c/cloudlibc.h create mode 100644 include/boost/predef/platform/cloudabi.h diff --git a/include/boost/predef/library/c.h b/include/boost/predef/library/c.h index fa8841e..eb9b73c 100644 --- a/include/boost/predef/library/c.h +++ b/include/boost/predef/library/c.h @@ -12,6 +12,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include +#include #include #include #include diff --git a/include/boost/predef/library/c/cloudlibc.h b/include/boost/predef/library/c/cloudlibc.h new file mode 100644 index 0000000..6db32b8 --- /dev/null +++ b/include/boost/predef/library/c/cloudlibc.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2017 James E. King, III + * + * 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_LIBRARY_C_CLOUDLIBC_H +#define BOOST_PREDEF_LIBRARY_C_CLOUDLIBC_H + +#include +#include + +#include + +#if defined(__CloudABI__) +#include +#endif + +/*` +[heading `BOOST_LIB_C_CLOUDABI`] + +[@https://github.com/NuxiNL/cloudlibc cloudlibc] - CloudABI's standard C library. +Version number available as major, and minor. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__cloudlibc__`] [__predef_detection__]] + + [[`__cloudlibc_major__`, `__cloudlibc_minor__`] [V.R.0]] + ] + */ + +#define BOOST_LIB_C_CLOUDABI BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__cloudlibc__) +# undef BOOST_LIB_C_CLOUDABI +# define BOOST_LIB_C_CLOUBABI \ + BOOST_VERSION_NUMBER(__cloudlibc_major__,__cloudlibc_minor__,0) +#endif + +#if BOOST_LIB_C_CLOUDABI +# define BOOST_LIB_C_CLOUDABI_AVAILABLE +#endif + +#define BOOST_LIB_C_CLOUDABI_NAME "cloudlibc" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_C_CLOUDABI,BOOST_LIB_C_CLOUDABI_NAME) diff --git a/include/boost/predef/platform.h b/include/boost/predef/platform.h index 86ca707..6c366d5 100644 --- a/include/boost/predef/platform.h +++ b/include/boost/predef/platform.h @@ -11,6 +11,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_PLATFORM_H #endif +#include #include #include #include diff --git a/include/boost/predef/platform/cloudabi.h b/include/boost/predef/platform/cloudabi.h new file mode 100644 index 0000000..c44f689 --- /dev/null +++ b/include/boost/predef/platform/cloudabi.h @@ -0,0 +1,43 @@ +/* + Copyright 2017 James E. King, III + 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_CLOUDABI_H +#define BOOST_PREDEF_PLAT_CLOUDABI_H + +#include +#include + +/*` +[heading `BOOST_PLAT_CLOUDABI`] + +[@https://github.com/NuxiNL/cloudabi CloudABI] platform. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CloudABI__`] [__predef_detection__]] + ] + */ + +#define BOOST_PLAT_CLOUDABI BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__CloudABI__) +# undef BOOST_PLAT_CLOUDABI +# define BOOST_PLAT_CLOUDABI BOOST_VERSION_NUMBER_AVAILABLE +#endif + +#if BOOST_PLAT_CLOUDABI +# define BOOST_PLAT_CLOUDABI_AVAILABLE +# include +#endif + +#define BOOST_PLAT_CLOUDABI_NAME "CloudABI" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_CLOUDABI,BOOST_PLAT_CLOUDABI_NAME) From e87cef64fe774a4fdd1d27b01b500c5093ba180a Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 23 Oct 2017 17:07:20 -0500 Subject: [PATCH 11/11] History note for CloudABI/LIB addition. --- doc/history.qbk | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/history.qbk b/doc/history.qbk index b3e13d9..c6845a0 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -11,6 +11,7 @@ http://www.boost.org/LICENSE_1_0.txt) * Fix BOOST_ARCH_PARISK/BOOST_ARCH_PARISC typo. * Improved Windows Universal Platform detection. (from James E. King, III) +* Add detection for CloudABI with cloudlibc. (from James E. King, III) [heading 1.6]