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/doc/history.qbk b/doc/history.qbk index 4af13d3..c6845a0 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -7,6 +7,12 @@ 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) +* Add detection for CloudABI with cloudlibc. (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/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. 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 7da697e..6c366d5 100644 --- a/include/boost/predef/platform.h +++ b/include/boost/predef/platform.h @@ -11,11 +11,17 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_PLATFORM_H #endif +#include #include +#include +#include +#include #include -#include #include -#include +#include +#include +#include +#include // deprecated #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) 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 diff --git a/include/boost/predef/platform/windows_desktop.h b/include/boost/predef/platform/windows_desktop.h index 62719b4..afb3907 100644 --- a/include/boost/predef/platform/windows_desktop.h +++ b/include/boost/predef/platform/windows_desktop.h @@ -9,25 +9,31 @@ 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`] +[@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`] [__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) || (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 df583ad..0ebc76d 100644 --- a/include/boost/predef/platform/windows_phone.h +++ b/include/boost/predef/platform/windows_phone.h @@ -9,13 +9,17 @@ 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`] +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Phone development. + [table [[__predef_symbol__] [__predef_version__]] @@ -25,7 +29,8 @@ http://www.boost.org/LICENSE_1_0.txt) #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..e7978d7 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`] +Deprecated. + +[@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__]] - [[`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..7bd629d --- /dev/null +++ b/include/boost/predef/platform/windows_server.h @@ -0,0 +1,47 @@ +/* +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`] + +[@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 == 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..3a3fd8e 100644 --- a/include/boost/predef/platform/windows_store.h +++ b/include/boost/predef/platform/windows_store.h @@ -9,23 +9,30 @@ 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`] +[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] +for Windows Store development. + [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..92f424f --- /dev/null +++ b/include/boost/predef/platform/windows_system.h @@ -0,0 +1,47 @@ +/* +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`] + +[@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 == 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..e4c6647 --- /dev/null +++ b/include/boost/predef/platform/windows_uwp.h @@ -0,0 +1,60 @@ +/* +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] +is available if the current development environment is capable of targeting +UWP development. + +[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/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 diff --git a/test/build.jam b/test/build.jam old mode 100755 new mode 100644 index 43bf007..223950e --- 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 @@ -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..53f3ecc --- /dev/null +++ b/test/platform_windows.cpp @@ -0,0 +1,177 @@ +/* +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 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_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" +#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