From 0f86c9b95e6458fd51c985daa2874a2a96b7e764 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 21 May 2017 22:57:26 -0500 Subject: [PATCH 01/15] Add latest toolsets for CI testing. --- .travis.yml | 6 ++++-- appveyor.yml | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7de567f..ad23a7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,11 +61,13 @@ matrix: - env: TOOLSET=clang-3.7 - env: TOOLSET=clang-3.8 - env: TOOLSET=clang-3.9 + - env: TOOLSET=clang-4.0 - env: TOOLSET=gcc-4.7 - env: TOOLSET=gcc-4.8 - env: TOOLSET=gcc-4.9 - env: TOOLSET=gcc-5 - env: TOOLSET=gcc-6 + - env: TOOLSET=gcc-7 - env: TOOLSET=xcode-6.1 os: osx - env: TOOLSET=xcode-6.4 @@ -74,9 +76,9 @@ matrix: - env: TOOLSET=xcode-7.3 os: osx osx_image: xcode7.3 - - env: TOOLSET=xcode-8.0 + - env: TOOLSET=xcode-8.3 os: osx - osx_image: xcode8 + osx_image: xcode8.3 # These are the standard steps to bootstrap the Boost CI scripts # and to forward the actions to the scripts. diff --git a/appveyor.yml b/appveyor.yml index 058b74c..7c76129 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,18 +27,31 @@ environment: matrix: - TOOLSET: vs-2008 platform: 32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: vs-2010 platform: 32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: vs-2012 platform: 32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: vs-2013 platform: 32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: vs-2013 platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: vs-2015 platform: 32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: vs-2015 platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: vs-2017 + platform: 32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: vs-2017 + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 # We can also set up configurations for testing which map to # the b2 build variants. From ec6c26ef68e2dfcfd27d3b760c273016ffc4d47e Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Fri, 19 May 2017 22:59:34 +0300 Subject: [PATCH 02/15] Detect iOS simulator/device --- include/boost/predef/platform.h | 1 + include/boost/predef/platform/ios.h | 57 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 include/boost/predef/platform/ios.h diff --git a/include/boost/predef/platform.h b/include/boost/predef/platform.h index c0c8706..7da697e 100644 --- a/include/boost/predef/platform.h +++ b/include/boost/predef/platform.h @@ -16,6 +16,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include #include +#include /*#include */ #endif diff --git a/include/boost/predef/platform/ios.h b/include/boost/predef/platform/ios.h new file mode 100644 index 0000000..fdae448 --- /dev/null +++ b/include/boost/predef/platform/ios.h @@ -0,0 +1,57 @@ +/* +Copyright Ruslan Baratov 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_IOS_H +#define BOOST_PREDEF_PLAT_IOS_H + +#include // BOOST_OS_IOS +#include // BOOST_VERSION_NUMBER_NOT_AVAILABLE + +/*` +[heading `BOOST_PLAT_IOS_DEVICE`] +[heading `BOOST_PLAT_IOS_SIMULATOR`] + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`TARGET_IPHONE_SIMULATOR`] [__predef_detection__]] + ] + */ + +#define BOOST_PLAT_IOS_DEVICE BOOST_VERSION_NUMBER_NOT_AVAILABLE +#define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_NOT_AVAILABLE + +// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h +#if BOOST_OS_IOS +# include +# if TARGET_IPHONE_SIMULATOR == 1 +# undef BOOST_PLAT_IOS_SIMULATOR +# define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_AVAILABLE +# else +# undef BOOST_PLAT_IOS_DEVICE +# define BOOST_PLAT_IOS_DEVICE BOOST_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#if BOOST_PLAT_IOS_SIMULATOR +# define BOOST_PLAT_IOS_SIMULATOR_AVAILABLE +# include +#endif + +#if BOOST_PLAT_IOS_DEVICE +# define BOOST_PLAT_IOS_DEVICE_AVAILABLE +# include +#endif + +#define BOOST_PLAT_IOS_SIMULATOR_NAME "iOS Simulator" +#define BOOST_PLAT_IOS_DEVICE_NAME "iOS Device" + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_SIMULATOR,BOOST_PLAT_IOS_SIMULATOR_NAME) +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_DEVICE,BOOST_PLAT_IOS_DEVICE_NAME) + +#endif // BOOST_PREDEF_PLAT_IOS_H From 43758299bc928998737094514772f62cc7f9926a Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 27 May 2017 09:50:52 -0500 Subject: [PATCH 03/15] Remove no longer needed empty job workaround. --- .travis.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad23a7e..6ba9119 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,23 +37,12 @@ os: linux # to run the sudo support. sudo: required -# Travis has a long standing bug with their rather complicated -# build matrix evaluation that causes empty jobs to be created. -# This global matrix entry in combination with the exclusion -# below works around that bug. This is the suggested fix from -# the Travis support people. -env: - matrix: - - TRAVIS_EMPTY_JOB_WORKAROUND=true - # This lists all the toolsets we will test with the Boost CI # scripts. Predef needs to check all of them as its job is to # distiguish between all of them. For other libraries you would # want to limit the list to the toolsets that are important # for that. matrix: - exclude: - - env: TRAVIS_EMPTY_JOB_WORKAROUND=true include: - env: TOOLSET=clang-3.4 - env: TOOLSET=clang-3.5 From 77c66456dc7959ef3b4687b11c01e8a36e936107 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 27 May 2017 10:01:09 -0500 Subject: [PATCH 04/15] Remove caching. Free limits are too low for Boost. --- appveyor.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7c76129..7215904 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -77,9 +77,3 @@ after_test: python ../ci_boost_library_test.py after_test on_success: python ../ci_boost_library_test.py on_success on_failure: python ../ci_boost_library_test.py on_failure on_finish: python ../ci_boost_library_test.py on_finish - -# We cache the boost repo, which is cleaned before caching. -# This saves some time as cloning the git submodules fresh -# takes a few minutes on Windows. -cache: - - C:\projects\boostorg\boost -> appveyor.yml From 693e9736354da68284a5be6587a10a4925c620fd Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 27 May 2017 10:09:23 -0500 Subject: [PATCH 05/15] Never mind.. Travis empty job bug is not fixed. --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6ba9119..ad23a7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,12 +37,23 @@ os: linux # to run the sudo support. sudo: required +# Travis has a long standing bug with their rather complicated +# build matrix evaluation that causes empty jobs to be created. +# This global matrix entry in combination with the exclusion +# below works around that bug. This is the suggested fix from +# the Travis support people. +env: + matrix: + - TRAVIS_EMPTY_JOB_WORKAROUND=true + # This lists all the toolsets we will test with the Boost CI # scripts. Predef needs to check all of them as its job is to # distiguish between all of them. For other libraries you would # want to limit the list to the toolsets that are important # for that. matrix: + exclude: + - env: TRAVIS_EMPTY_JOB_WORKAROUND=true include: - env: TOOLSET=clang-3.4 - env: TOOLSET=clang-3.5 From 87c4de2da2cd2fd01b1c69585965316dcbd2d2ea Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 27 May 2017 14:35:24 -0500 Subject: [PATCH 06/15] Lets try MinGW builds. --- appveyor.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 7215904..d3a5474 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -52,6 +52,15 @@ environment: - TOOLSET: vs-2017 platform: 64 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: mingw-5 + platform: 32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: mingw64-5 + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: mingw64-6 + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 # We can also set up configurations for testing which map to # the b2 build variants. From 541ec7edef08c3b83a86574250e9c008c9460978 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 27 May 2017 18:42:14 -0500 Subject: [PATCH 07/15] MinGW64 5.x doesn't seem to actually exist in Appveyor. --- appveyor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d3a5474..9c0345e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,9 +55,6 @@ environment: - TOOLSET: mingw-5 platform: 32 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - - TOOLSET: mingw64-5 - platform: 64 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: mingw64-6 platform: 64 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 From 5e76979e05f5ff6d4d00338de739d178d4ff34a0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 28 May 2017 13:59:25 -0500 Subject: [PATCH 08/15] No MinGW for now, as it fails for some unknown reason. --- appveyor.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9c0345e..90ee174 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -52,12 +52,12 @@ environment: - TOOLSET: vs-2017 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: mingw-5 +# platform: 32 +# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 +# - TOOLSET: mingw64-6 +# platform: 64 +# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 # We can also set up configurations for testing which map to # the b2 build variants. From 6dfdf9d4dd6a676021b0f41e9b36a017a3ab39a3 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 28 May 2017 15:53:55 -0500 Subject: [PATCH 09/15] Add testing with language flags. --- .travis.yml | 25 ++++++++++++++++++++++--- appveyor.yml | 8 ++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad23a7e..0ffe948 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,13 +61,23 @@ matrix: - env: TOOLSET=clang-3.7 - env: TOOLSET=clang-3.8 - env: TOOLSET=clang-3.9 - - env: TOOLSET=clang-4.0 + - env: TOOLSET=clang-4.0 CXXFLAGS=-std=c++03 + - env: TOOLSET=clang-4.0 CXXFLAGS=-std=c++11 + - env: TOOLSET=clang-4.0 CXXFLAGS=-std=c++14 + - env: TOOLSET=clang-4.0 CXXFLAGS=-std=c++1z - env: TOOLSET=gcc-4.7 - env: TOOLSET=gcc-4.8 - env: TOOLSET=gcc-4.9 - env: TOOLSET=gcc-5 - env: TOOLSET=gcc-6 - - env: TOOLSET=gcc-7 + - env: TOOLSET=gcc-7 CXXFLAGS=-std=c++03 + - env: TOOLSET=gcc-7 CXXFLAGS=-std=c++11 + - env: TOOLSET=gcc-7 CXXFLAGS=-std=c++14 + - env: TOOLSET=gcc-7 CXXFLAGS=-std=c++1z + - env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++03 + - env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++11 + - env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++14 + - env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++1z - env: TOOLSET=xcode-6.1 os: osx - env: TOOLSET=xcode-6.4 @@ -76,7 +86,16 @@ matrix: - env: TOOLSET=xcode-7.3 os: osx osx_image: xcode7.3 - - env: TOOLSET=xcode-8.3 + - env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++03 + os: osx + osx_image: xcode8.3 + - env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++11 + os: osx + osx_image: xcode8.3 + - env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++14 + os: osx + osx_image: xcode8.3 + - env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++1z os: osx osx_image: xcode8.3 diff --git a/appveyor.yml b/appveyor.yml index 90ee174..72ad28d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -52,6 +52,14 @@ environment: - TOOLSET: vs-2017 platform: 64 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: vs-2017 + CXXFLAGS: /std:c++14 + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - TOOLSET: vs-2017 + CXXFLAGS: /std:c++latest + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 # - TOOLSET: mingw-5 # platform: 32 # APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 From cda33c33d9cc5429c2304a7cad5d10ac0248fe42 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 28 May 2017 16:39:29 -0500 Subject: [PATCH 10/15] Try mingw testing again. --- appveyor.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 72ad28d..3f3e59a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -60,12 +60,12 @@ environment: CXXFLAGS: /std:c++latest 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: mingw-5 + platform: 32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - TOOLSET: mingw64-6 + platform: 64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 # We can also set up configurations for testing which map to # the b2 build variants. From f109e20ad14f29736e3e71b0ae171d3c5992807f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 28 May 2017 23:31:06 -0500 Subject: [PATCH 11/15] Fix missing non-detection test for new iOS platform. --- include/boost/predef/platform/ios.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/predef/platform/ios.h b/include/boost/predef/platform/ios.h index fdae448..af1c364 100644 --- a/include/boost/predef/platform/ios.h +++ b/include/boost/predef/platform/ios.h @@ -1,5 +1,6 @@ /* Copyright Ruslan Baratov 2017 +Copyright Rene Rivera 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) @@ -50,8 +51,8 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PLAT_IOS_SIMULATOR_NAME "iOS Simulator" #define BOOST_PLAT_IOS_DEVICE_NAME "iOS Device" +#endif // BOOST_PREDEF_PLAT_IOS_H + #include BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_SIMULATOR,BOOST_PLAT_IOS_SIMULATOR_NAME) BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_IOS_DEVICE,BOOST_PLAT_IOS_DEVICE_NAME) - -#endif // BOOST_PREDEF_PLAT_IOS_H From 4c822c49c2ad5485b4c35ecdb6822d3b552dcf8d Mon Sep 17 00:00:00 2001 From: Minmin Gong Date: Thu, 1 Jun 2017 00:08:56 -0700 Subject: [PATCH 12/15] Adds support for MSVC ARM64 target. --- include/boost/predef/architecture/arm.h | 7 ++++++- include/boost/predef/hardware/simd/arm.h | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/boost/predef/architecture/arm.h b/include/boost/predef/architecture/arm.h index b200c62..76f9f94 100644 --- a/include/boost/predef/architecture/arm.h +++ b/include/boost/predef/architecture/arm.h @@ -27,11 +27,13 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__TARGET_ARCH_ARM`] [__predef_detection__]] [[`__TARGET_ARCH_THUMB`] [__predef_detection__]] [[`_M_ARM`] [__predef_detection__]] + [[`_M_ARM64`] [__predef_detection__]] [[`__arm64`] [8.0.0]] [[`__TARGET_ARCH_ARM`] [V.0.0]] [[`__TARGET_ARCH_THUMB`] [V.0.0]] [[`_M_ARM`] [V.0.0]] + [[`_M_ARM64`] [8.0.0]] ] */ @@ -39,7 +41,7 @@ http://www.boost.org/LICENSE_1_0.txt) #if defined(__arm__) || defined(__arm64) || defined(__thumb__) || \ defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB) || \ - defined(_M_ARM) + defined(_M_ARM) || defined(_M_ARM64) # undef BOOST_ARCH_ARM # if !defined(BOOST_ARCH_ARM) && defined(__arm64) # define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(8,0,0) @@ -50,6 +52,9 @@ http://www.boost.org/LICENSE_1_0.txt) # if !defined(BOOST_ARCH_ARM) && defined(__TARGET_ARCH_THUMB) # define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__TARGET_ARCH_THUMB,0,0) # endif +# if !defined(BOOST_ARCH_ARM) && defined(_M_ARM64) +# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(8,0,0) +# endif # if !defined(BOOST_ARCH_ARM) && defined(_M_ARM) # define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(_M_ARM,0,0) # endif diff --git a/include/boost/predef/hardware/simd/arm.h b/include/boost/predef/hardware/simd/arm.h index d067c93..3b3fc3f 100644 --- a/include/boost/predef/hardware/simd/arm.h +++ b/include/boost/predef/hardware/simd/arm.h @@ -24,6 +24,7 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__ARM_NEON__`] [__predef_detection__]] [[`__aarch64__`] [__predef_detection__]] [[`_M_ARM`] [__predef_detection__]] + [[`_M_ARM64`] [__predef_detection__]] ] [table @@ -32,6 +33,7 @@ http://www.boost.org/LICENSE_1_0.txt) [[`__ARM_NEON__`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] [[`__aarch64__`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] [[`_M_ARM`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] + [[`_M_ARM64`] [BOOST_HW_SIMD_ARM_NEON_VERSION]] ] */ @@ -39,7 +41,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_HW_SIMD_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE #undef BOOST_HW_SIMD_ARM -#if !defined(BOOST_HW_SIMD_ARM) && (defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM)) +#if !defined(BOOST_HW_SIMD_ARM) && (defined(__ARM_NEON__) || defined(__aarch64__) || defined (_M_ARM) || defined (_M_ARM64)) # define BOOST_HW_SIMD_ARM BOOST_HW_SIMD_ARM_NEON_VERSION #endif From db499c07df51f05a6c11f5aa44f69c4affc0dad7 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 1 Jun 2017 22:31:09 -0500 Subject: [PATCH 13/15] Add WORKAROUND style definitions for public use. --- doc/todo.qbk | 3 +- include/boost/predef/other/workaround.h | 87 +++++++++++++++++++++++++ test/build.jam | 4 ++ test/tested_at.cpp | 62 ++++++++++++++++++ test/tested_at_outdated.cpp | 18 +++++ test/workaround.cpp | 62 ++++++++++++++++++ test/workaround_strict_config.cpp | 17 +++++ 7 files changed, 251 insertions(+), 2 deletions(-) create mode 100644 include/boost/predef/other/workaround.h create mode 100644 test/tested_at.cpp create mode 100644 test/tested_at_outdated.cpp create mode 100644 test/workaround.cpp create mode 100644 test/workaround_strict_config.cpp diff --git a/doc/todo.qbk b/doc/todo.qbk index aa1c845..ea50d20 100644 --- a/doc/todo.qbk +++ b/doc/todo.qbk @@ -1,5 +1,5 @@ [/ -Copyright 2014 Rene Rivera +Copyright 2014-2017 Rene Rivera 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) @@ -8,6 +8,5 @@ http://www.boost.org/LICENSE_1_0.txt) [section To Do] * Improve reference documentation. -* Provide BOOST_WORKAROUND style macros for public use. [endsect] diff --git a/include/boost/predef/other/workaround.h b/include/boost/predef/other/workaround.h new file mode 100644 index 0000000..7167a18 --- /dev/null +++ b/include/boost/predef/other/workaround.h @@ -0,0 +1,87 @@ +/* +Copyright Rene Rivera 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_WORKAROUND_H +#define BOOST_PREDEF_WORKAROUND_H + +/*` +[heading `BOOST_PREDEF_WORKAROUND`] + +`` +BOOST_PREDEF_WORKAROUND(symbol,comp,major,minor,patch) +`` + +Usage: + +`` +#if BOOST_PREDEF_WORKAROUND(BOOST_COMP_CLANG,<,3,0,0) + // Workaround for old clang compilers.. +#endif +`` + +Defines a comparison against two version numbers that depends on the definion +of `BOOST_STRICT_CONFIG`. When `BOOST_STRICT_CONFIG` is defined this will expand +to a value convertible to `false`. Which has the effect of disabling all code +conditionally guarded by `BOOST_PREDEF_WORKAROUND`. When `BOOST_STRICT_CONFIG` +is undefine this expand to test the given `symbol` version value with the +`comp` comparison against `BOOST_VERSION_NUMBER(major,minor,patch)`. +*/ +#ifdef BOOST_STRICT_CONFIG +# define BOOST_PREDEF_WORKAROUND(symbol, comp, major, minor, patch) (0) +#else +# include +# define BOOST_PREDEF_WORKAROUND(symbol, comp, major, minor, patch) \ + ( (symbol) != (0) ) && \ + ( (symbol) comp (BOOST_VERSION_NUMBER( (major) , (minor) , (patch) )) ) +#endif + +/*` +[heading `BOOST_PREDEF_TESTED_AT`] + +`` +BOOST_PREDEF_TESTED_AT(symbol,major,minor,patch) +`` + +Usage: + +`` +#if BOOST_PREDEF_TESTED_AT(BOOST_COMP_CLANG,3,5,0) + // Needed for clang, and last checked for 3.5.0. +#endif +`` + +Defines a comparison against two version numbers that depends on the definion +of `BOOST_STRICT_CONFIG` and `BOOST_DETECT_OUTDATED_WORKAROUNDS`. +When `BOOST_STRICT_CONFIG` is defined this will expand to a value convertible +to `false`. Which has the effect of disabling all code +conditionally guarded by `BOOST_PREDEF_TESTED_AT`. When `BOOST_STRICT_CONFIG` +is undefined this expand to either: + +* A value convertible to `true` when `BOOST_DETECT_OUTDATED_WORKAROUNDS` is not + defined. +* A value convertible `true` when the expansion of + `BOOST_PREDEF_WORKAROUND(symbol, <=, major, minor, patch)` is `true` and + `BOOST_DETECT_OUTDATED_WORKAROUNDS` is defined. +* A compile error when the expansion of + `BOOST_PREDEF_WORKAROUND(symbol, >, major, minor, patch)` is true and + `BOOST_DETECT_OUTDATED_WORKAROUNDS` is defined. +*/ +#ifdef BOOST_STRICT_CONFIG +# define BOOST_PREDEF_TESTED_AT(symbol, major, minor, patch) (0) +#else +# ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS +# define BOOST_PREDEF_TESTED_AT(symbol, major, minor, patch) ( \ + BOOST_PREDEF_WORKAROUND(symbol, <=, major, minor, patch) \ + ? 1 \ + : (1%0) ) +# else +# define BOOST_PREDEF_TESTED_AT(symbol, major, minor, patch) \ + ( (symbol) >= BOOST_VERSION_NUMBER_AVAILABLE ) +# endif +#endif + +#endif diff --git a/test/build.jam b/test/build.jam index 74c658c..43bf007 100755 --- a/test/build.jam +++ b/test/build.jam @@ -59,6 +59,10 @@ test-suite predef : [ compile macos_vs_bsd.c : [ predef-require "BOOST_OS_MACOS" : cpp ] ] [ run check_value.cpp : : : always_show_run_output [ predef-check "BOOST_COMP_CLANG > 0.0.0" "BOOST_OS_LINUX == 0" : : -DCHECK_VALUE=true ] ] + [ run workaround.cpp ] + [ compile workaround_strict_config.cpp ] + [ run tested_at.cpp ] + [ compile-fail tested_at_outdated.cpp : always_show_run_output ] ; # Minimal testing done for predef for CI. Since diff --git a/test/tested_at.cpp b/test/tested_at.cpp new file mode 100644 index 0000000..2c4816e --- /dev/null +++ b/test/tested_at.cpp @@ -0,0 +1,62 @@ +/* +Copyright Rene Rivera 2011-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 +#include +#include +#include +#include +#include + +namespace +{ + struct test_info + { + std::string value; + bool passed; + + test_info(std::string const & v, bool p) : value(v), passed(p) {} + test_info(test_info const & o) : value(o.value), passed(o.passed) {} + }; + + std::vector test_results; +} + +#define PREDEF_CHECK(X) test_results.push_back(test_info(#X,(X))) + +void test_BOOST_PREDEF_TESTED_AT() +{ + PREDEF_CHECK(BOOST_PREDEF_TESTED_AT(BOOST_VERSION_NUMBER(15,15,15),0xF,0xF,0xF)); + PREDEF_CHECK(BOOST_PREDEF_TESTED_AT(BOOST_VERSION_NUMBER(1,0,0),1,0,0)); + PREDEF_CHECK(BOOST_PREDEF_TESTED_AT(BOOST_VERSION_NUMBER(0,9,0),1,0,0)); + PREDEF_CHECK(BOOST_PREDEF_TESTED_AT(BOOST_VERSION_NUMBER(2,0,0),1,0,0)); + PREDEF_CHECK(!BOOST_PREDEF_TESTED_AT(BOOST_VERSION_NUMBER_NOT_AVAILABLE,1,0,0)); +} + +int main() +{ + test_BOOST_PREDEF_TESTED_AT(); + + unsigned fail_count = 0; + std::vector::iterator i = test_results.begin(); + std::vector::iterator e = test_results.end(); + for (; i != e; ++i) + { + std::cout + << (i->passed ? "[passed]" : "[failed]") + << " " << i->value + << std::endl; + fail_count += i->passed ? 0 : 1; + } + std::cout + << std::endl + << "TOTAL: " + << "passed " << (test_results.size()-fail_count) << ", " + << "failed " << (fail_count) << ", " + << "of " << (test_results.size()) + << std::endl; + return fail_count; +} diff --git a/test/tested_at_outdated.cpp b/test/tested_at_outdated.cpp new file mode 100644 index 0000000..534ebaf --- /dev/null +++ b/test/tested_at_outdated.cpp @@ -0,0 +1,18 @@ +/* +Copyright Rene Rivera 2011-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 +#define BOOST_DETECT_OUTDATED_WORKAROUNDS +#include + +int main() +{ +#if BOOST_PREDEF_TESTED_AT(BOOST_VERSION_NUMBER(2,0,0),1,0,0) + return 1; +#else + return 0; +#endif +} diff --git a/test/workaround.cpp b/test/workaround.cpp new file mode 100644 index 0000000..368daea --- /dev/null +++ b/test/workaround.cpp @@ -0,0 +1,62 @@ +/* +Copyright Rene Rivera 2011-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 +#include +#include +#include +#include +#include + +namespace +{ + struct test_info + { + std::string value; + bool passed; + + test_info(std::string const & v, bool p) : value(v), passed(p) {} + test_info(test_info const & o) : value(o.value), passed(o.passed) {} + }; + + std::vector test_results; +} + +#define PREDEF_CHECK(X) test_results.push_back(test_info(#X,(X))) + +void test_BOOST_PREDEF_WORKAROUND() +{ + PREDEF_CHECK(BOOST_PREDEF_WORKAROUND(BOOST_VERSION_NUMBER(15,15,15),==,0xF,0xF,0xF)); + PREDEF_CHECK(BOOST_PREDEF_WORKAROUND(BOOST_VERSION_NUMBER(0,9,0),<,1,0,0)); + PREDEF_CHECK(BOOST_PREDEF_WORKAROUND(BOOST_VERSION_NUMBER(0,9,0),!=,1,0,0)); + PREDEF_CHECK(BOOST_PREDEF_WORKAROUND(BOOST_VERSION_NUMBER_MIN,<,1,0,0)); + PREDEF_CHECK(BOOST_PREDEF_WORKAROUND(BOOST_VERSION_NUMBER_MIN,>,0,0,0)); +} + +int main() +{ + test_BOOST_PREDEF_WORKAROUND(); + + unsigned fail_count = 0; + std::vector::iterator i = test_results.begin(); + std::vector::iterator e = test_results.end(); + for (; i != e; ++i) + { + std::cout + << (i->passed ? "[passed]" : "[failed]") + << " " << i->value + << std::endl; + fail_count += i->passed ? 0 : 1; + } + std::cout + << std::endl + << "TOTAL: " + << "passed " << (test_results.size()-fail_count) << ", " + << "failed " << (fail_count) << ", " + << "of " << (test_results.size()) + << std::endl; + return fail_count; +} diff --git a/test/workaround_strict_config.cpp b/test/workaround_strict_config.cpp new file mode 100644 index 0000000..df7b176 --- /dev/null +++ b/test/workaround_strict_config.cpp @@ -0,0 +1,17 @@ +/* +Copyright Rene Rivera 2011-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 +#define BOOST_STRICT_CONFIG +#include + +int main() +{ +#if BOOST_PREDEF_WORKAROUND(BOOST_VERSION_NUMBER_AVAILABLE,==,0,0,1) + fail(); +#endif + return 0; +} From 9afb15401b83338fb85d01d41b0d8600f0917931 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 5 Jun 2017 09:09:13 -0500 Subject: [PATCH 14/15] Handle Intel version 9999 == 12.1.0 (fixes #38). --- include/boost/predef/compiler/intel.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/predef/compiler/intel.h b/include/boost/predef/compiler/intel.h index 3bd76fe..f8a17ef 100644 --- a/include/boost/predef/compiler/intel.h +++ b/include/boost/predef/compiler/intel.h @@ -1,5 +1,5 @@ /* -Copyright Rene Rivera 2008-2015 +Copyright Rene Rivera 2008-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) @@ -34,6 +34,13 @@ Version number available as major, minor, and patch. #if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || \ defined(__ECC) +/*` +[note Because of an Intel mistake in the release version numbering when +`__INTEL_COMPILER` is `9999` it is detected as version 12.1.0.] + */ +# if !defined(BOOST_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 9999) +# define BOOST_COMP_INTEL_DETECTION BOOST_VERSION_NUMBER(12,1,0) +# endif # if !defined(BOOST_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) # define BOOST_COMP_INTEL_DETECTION BOOST_VERSION_NUMBER( \ BOOST_VERSION_NUMBER_MAJOR(BOOST_PREDEF_MAKE_10_VVRR(__INTEL_COMPILER)), \ From 6a24a3a4bbd8d31398f48e92d20c76be84a81da8 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 5 Jun 2017 09:14:37 -0500 Subject: [PATCH 15/15] Changes for version 1.6. --- doc/history.qbk | 10 ++++++++++ doc/predef.qbk | 8 ++------ include/boost/predef/version.h | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/history.qbk b/doc/history.qbk index f49fdcc..4af13d3 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -7,6 +7,16 @@ http://www.boost.org/LICENSE_1_0.txt) [section History] +[heading 1.6] + +* Fix Intel C/C++ version 9999 detection to be 12.1.0. +* Addition of `BOOST_PREDEF_WORKAROUND` and `BOOST_PREDEF_TESTED_AT` macros + for defect workarounds and detection. +* Add ARM64 MSVC SIMD detection. (from Minmin Gong) +* Add detection of iOS simulator vs device as a platform choice. (from Ruslan + Baratov) +* Fix MinGW incorrect header guard. (from Ruslan Baratov) + [heading 1.5] * Fix Intel C/C++ compiler version specification. diff --git a/doc/predef.qbk b/doc/predef.qbk index 3c802ac..c5d39c6 100644 --- a/doc/predef.qbk +++ b/doc/predef.qbk @@ -1,6 +1,6 @@ [article Boost.Predef [quickbook 1.7] - [version 1.5] + [version 1.6] [authors [Rivera, Rene]] [copyright 2005-2016 Rene Rivera] [copyright 2015 Charly Chevalier] @@ -114,12 +114,8 @@ done: * Additionally, even if there is no auto-configure style option.. It would be good to add optionally included headers so that user can get consistent version number definitions for libraries they use. -* Having a consistent set of version number definitions opens the door to - improving the user level syntax of libraries that do checks against version - numbers. Specifically Boost Config's `BOOST_WORKAROUND` macro would benefit - from a more readable syntax. As would the `BOOST_TESTED_AT` detail macro. * And obviously there's lots of work to do in reformulating the existing - Boost libraries to use the Predef library once it's accepted. + Boost libraries to use the Predef library. * And there's the continuing work of adding definitions for present and future compilers, platforms, architectures, languages, and libraries. diff --git a/include/boost/predef/version.h b/include/boost/predef/version.h index ebd2b4f..e03469f 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,5,0) +#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,6,0) #endif