From 06f6303d166390cf7c816b5acf2760af77ccae35 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 7 Oct 2016 23:07:35 -0500 Subject: [PATCH 01/16] Add, and update, documentation build targets. --- doc/build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build.jam b/doc/build.jam index 6b5cc76..8558f75 100644 --- a/doc/build.jam +++ b/doc/build.jam @@ -76,7 +76,7 @@ boostbook standalone # alias boostdoc ; # explicit boostdoc ; # -alias boostdoc : predef : : : predef ; +alias boostdoc : predef ; explicit boostdoc ; # Target for Boost standalone release documentation building. From 3680a040a281c42a6d0d936cae5392c8135093e7 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 9 Nov 2016 23:34:23 -0600 Subject: [PATCH 02/16] Switch CI testing script to latest generic version. --- .travis.yml | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 04df287..807315f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,22 @@ +# Use, modification, and distribution are +# subject to 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) +# +# Copyright Rene Rivera 2015-2016. + +branches: + only: + - master + - develop + +dist: trusty + language: cpp notifications: email: recipients: - grafikrobot@gmail.com - irc: - channels: - - "chat.freenode.net#boost" - template: - - "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}" sudo: required @@ -62,10 +70,15 @@ matrix: os: osx osx_image: xcode7.2 -before_install: wget "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/script.py" -install: python script.py install -before_script: python script.py before_script -script: python script.py script -after_success: python script.py after_success -after_failure: python script.py after_failure -after_script: python script.py after_script +before_install: + # Fetch the scripts to do the actual building/testing. + - | + wget "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/ci_boost_common.py" -P .. + wget "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/ci_boost_library_test.py" -P .. + +install: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" install +before_script: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" before_script +script: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" script +after_success: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" after_success +after_failure: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" after_failure +after_script: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" after_script From 0fb2c586b0c597f58874215b9951c12ce6569a65 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 10 Nov 2016 23:37:38 -0600 Subject: [PATCH 03/16] Switch Appveyor CI to latest generic testing scripts. --- appveyor.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0d02119..330bcfe 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,16 +27,17 @@ configuration: init: - cd %APPVEYOR_BUILD_FOLDER%/.. - - appveyor DownloadFile "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/script.py" + - appveyor DownloadFile "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/ci_boost_common.py" + - appveyor DownloadFile "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/ci_boost_library_test.py" - dir - cd %APPVEYOR_BUILD_FOLDER% -install: python ../script.py install -before_build: python ../script.py before_build -build_script: python ../script.py build_script -after_build: python ../script.py after_build -before_test: python ../script.py before_test -test_script: python ../script.py test_script -after_test: python ../script.py after_test -on_success: python ../script.py on_success -on_failure: python ../script.py on_failure -on_finish: python ../script.py on_finish +install: python ../ci_boost_library_test.py install +before_build: python ../ci_boost_library_test.py before_build +build_script: python ../ci_boost_library_test.py build_script +after_build: python ../ci_boost_library_test.py after_build +before_test: python ../ci_boost_library_test.py before_test +test_script: python ../ci_boost_library_test.py test_script +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 From d39d1b9dc454624d9576a46e85a99ccd7aa3db50 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 12 Nov 2016 17:31:12 -0600 Subject: [PATCH 04/16] Add current Xcode versions for testing. --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 807315f..b6c081d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,6 +69,12 @@ matrix: - env: TOOLSET=xcode-7.2 os: osx osx_image: xcode7.2 + - env: TOOLSET=xcode-7.3 + os: osx + osx_image: xcode7.3 + - env: TOOLSET=xcode-8.0 + os: osx + osx_image: xcode8 before_install: # Fetch the scripts to do the actual building/testing. From 99bcba4ff9d8a655709b29d12fdfb27cf58458a2 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 13 Nov 2016 08:14:28 -0600 Subject: [PATCH 05/16] Test plain gcc-5 toolset. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b6c081d..385bba7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ branches: dist: trusty -language: cpp +language: generic notifications: email: @@ -46,7 +46,7 @@ matrix: - env: TOOLSET=gcc-4.9 os: linux dist: precise - - env: TOOLSET=gcc-5.1 + - env: TOOLSET=gcc-5 os: linux dist: precise - env: TOOLSET=xcode-6.1 From 6cc5e91e7c11652a59fd809a13b3948d6a01e2e4 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 13 Nov 2016 09:22:08 -0600 Subject: [PATCH 06/16] Add g++-6 testing. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 385bba7..f3cc266 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,6 +49,9 @@ matrix: - env: TOOLSET=gcc-5 os: linux dist: precise + - env: TOOLSET=gcc-6 + os: linux + dist: precise - env: TOOLSET=xcode-6.1 os: osx - env: TOOLSET=xcode-6.2 From 5393bee297342edbcae78e9d8749137a3bbaa952 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 13 Nov 2016 14:24:03 -0600 Subject: [PATCH 07/16] Make sure we run on trusty and add all clang versions for Travis. --- .travis.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3cc266..81dd22b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,28 +30,26 @@ matrix: include: - env: TOOLSET=clang-3.4 os: linux - dist: precise - env: TOOLSET=clang-3.5 os: linux - dist: precise - env: TOOLSET=clang-3.6 os: linux - dist: precise + - env: TOOLSET=clang-3.7 + os: linux + - env: TOOLSET=clang-3.8 + os: linux + - env: TOOLSET=clang-3.9 + os: linux - env: TOOLSET=gcc-4.7 os: linux - dist: precise - env: TOOLSET=gcc-4.8 os: linux - dist: precise - env: TOOLSET=gcc-4.9 os: linux - dist: precise - env: TOOLSET=gcc-5 os: linux - dist: precise - env: TOOLSET=gcc-6 os: linux - dist: precise - env: TOOLSET=xcode-6.1 os: osx - env: TOOLSET=xcode-6.2 From dc9b1430617881889e6ce06d7e0f1e4e2091a9fb Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 17 Nov 2016 13:24:58 -0600 Subject: [PATCH 08/16] Clean up and document Travis setup. --- .travis.yml | 58 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81dd22b..ac8bf4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,52 +4,68 @@ # # Copyright Rene Rivera 2015-2016. -branches: - only: - - master - - develop - -dist: trusty - -language: generic - +# Setting up notifications like this is optional as the default behavior +# of Travis is to notify the commiter of problems. But setting a specific +# recipient this way ensures you get all the communications about the +# builds. notifications: email: recipients: - grafikrobot@gmail.com +# For now the CI scripts only support the two main branches available +# on the boost super-project. +branches: + only: + - master + - develop + +# We specify a generic language instead of C++ as Travis sets up +# additional environment vars that point to its default toolset +# instead of the one we install. The extra env doesn't interfere, +# but at the same time it's misleading. So to avoid confusion and +# possible unseen side effects we stick with no C++ default setup. +language: generic + +# Speficy the default as Linux here, to avoid duplication in the matrix +# below. We use Trausty as that's the latest we can use. And it's better +# supported by the whole range of C++ toolsets we like to test on. +dist: trusty +os: linux + +# Because we install our own toolsets and other software we need +# 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 - os: linux - env: TOOLSET=clang-3.5 - os: linux - env: TOOLSET=clang-3.6 - os: linux - env: TOOLSET=clang-3.7 - os: linux - env: TOOLSET=clang-3.8 - os: linux - env: TOOLSET=clang-3.9 - os: linux - env: TOOLSET=gcc-4.7 - os: linux - env: TOOLSET=gcc-4.8 - os: linux - env: TOOLSET=gcc-4.9 - os: linux - env: TOOLSET=gcc-5 - os: linux - env: TOOLSET=gcc-6 - os: linux - env: TOOLSET=xcode-6.1 os: osx - env: TOOLSET=xcode-6.2 @@ -77,6 +93,8 @@ matrix: os: osx osx_image: xcode8 +# These are the standard steps to bootstrap the Boost CI scripts +# and to forward the actions to the scripts. before_install: # Fetch the scripts to do the actual building/testing. - | From 72e2f8c2888f5fa45fba02d4477ab60a4f8e84f2 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 17 Nov 2016 16:04:13 -0600 Subject: [PATCH 09/16] Reduce Xcode builds to the new smaller set Travis supports. --- .travis.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac8bf4d..e60aeb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,24 +68,9 @@ matrix: - env: TOOLSET=gcc-6 - env: TOOLSET=xcode-6.1 os: osx - - env: TOOLSET=xcode-6.2 - os: osx - osx_image: beta-xcode6.2 - - env: TOOLSET=xcode-6.3 - os: osx - osx_image: beta-xcode6.3 - env: TOOLSET=xcode-6.4 os: osx osx_image: xcode6.4 - - env: TOOLSET=xcode-7.0 - os: osx - osx_image: xcode7 - - env: TOOLSET=xcode-7.1 - os: osx - osx_image: xcode7.1 - - env: TOOLSET=xcode-7.2 - os: osx - osx_image: xcode7.2 - env: TOOLSET=xcode-7.3 os: osx osx_image: xcode7.3 From af39447f7007af36c9e0f45ec27353d383613f73 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 18 Nov 2016 09:37:47 -0600 Subject: [PATCH 10/16] First attempt at caching with Appveyor. --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 330bcfe..fa82bce 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,3 +41,5 @@ 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 +cache: + - C:\projects\boostorg\boost -> appveyor.yml From 4f9b045d7427e7355f10bd30681f5adbcc09ddb1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 18 Nov 2016 13:24:47 -0600 Subject: [PATCH 11/16] Try and directly add git subtree to see if it makes the cache work. --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index fa82bce..5b9340e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,6 +5,7 @@ notifications: on_build_status_changed: true environment: + APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=1 matrix: - TOOLSET: vs-2008 platform: 32 From 5111859be2b041cfecd0523850aad824423cf5b8 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 18 Nov 2016 18:54:23 -0600 Subject: [PATCH 12/16] Lets see if the cache works on Travis. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index e60aeb4..7de567f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -89,6 +89,10 @@ before_install: install: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" install before_script: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" before_script script: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" script +before_cache: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" before_cache after_success: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" after_success after_failure: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" after_failure after_script: python "${TRAVIS_BUILD_DIR}/../ci_boost_library_test.py" after_script +cache: + directories: + - $HOME/boostorg/boost From 3c2d8bdb476c36bfd8af96865030c576a3b030b3 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 18 Nov 2016 19:15:24 -0600 Subject: [PATCH 13/16] Try and tweak the cache settings to get a valid git repo back. --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 5b9340e..1d329dd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ notifications: on_build_status_changed: true environment: - APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=1 + APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma2 -mx=3 matrix: - TOOLSET: vs-2008 platform: 32 @@ -44,3 +44,4 @@ on_failure: python ../ci_boost_library_test.py on_failure on_finish: python ../ci_boost_library_test.py on_finish cache: - C:\projects\boostorg\boost -> appveyor.yml + - C:\projects\boostorg\boost\.git -> appveyor.yml From eaccac21dcc18a11d29cbe6960413a3b19c8c96c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 19 Nov 2016 09:51:01 -0600 Subject: [PATCH 14/16] Back to just the boost repo in the cache. --- appveyor.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1d329dd..394779f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,9 @@ +# Use, modification, and distribution are +# subject to 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) +# +# Copyright Rene Rivera 2015-2016. + notifications: - provider: Email to: @@ -44,4 +50,3 @@ on_failure: python ../ci_boost_library_test.py on_failure on_finish: python ../ci_boost_library_test.py on_finish cache: - C:\projects\boostorg\boost -> appveyor.yml - - C:\projects\boostorg\boost\.git -> appveyor.yml From e7e3a2ac383e96641b8b9d623cf8b5f45014e913 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 19 Nov 2016 16:18:44 -0600 Subject: [PATCH 15/16] Document and cleanup Appveyor build spec. --- appveyor.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 394779f..058b74c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,12 +4,24 @@ # # Copyright Rene Rivera 2015-2016. +# Set up notifications so that the maintainers of the library get +# build status messages. notifications: - provider: Email to: - grafikrobot@gmail.com on_build_status_changed: 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. +# +# This also includes setting up how to create the cache. We +# opt for slightly better compression and solid archives. +# As we have a lot of files in the boost tree which is what +# we are putting in the cache. environment: APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma2 -mx=3 matrix: @@ -28,15 +40,19 @@ environment: - TOOLSET: vs-2015 platform: 64 +# We can also set up configurations for testing which map to +# the b2 build variants. configuration: - debug - release +# These are the standard steps to bootstrap the Boost CI scripts +# and to forward the actions to the scripts. init: + # Fetch the scripts to do the actual building/testing. - cd %APPVEYOR_BUILD_FOLDER%/.. - appveyor DownloadFile "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/ci_boost_common.py" - appveyor DownloadFile "https://raw.githubusercontent.com/boostorg/regression/develop/ci/src/ci_boost_library_test.py" - - dir - cd %APPVEYOR_BUILD_FOLDER% install: python ../ci_boost_library_test.py install before_build: python ../ci_boost_library_test.py before_build @@ -48,5 +64,9 @@ 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 822d09f19bc2f4ea6f42da8e0be83d10ce912ce1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 3 Jan 2017 22:07:48 -0600 Subject: [PATCH 16/16] Fix Intel C/C++ compiler version specification. Add `BOOST_VERSION_NUMBER_MAJOR`, `BOOST_VERSION_NUMBER_MINOR`, `BOOST_VERSION_NUMBER_PATCH` macros to extract components from valid version numbers. --- doc/history.qbk | 7 +++++++ doc/predef.qbk | 4 ++-- include/boost/predef/compiler/intel.h | 11 +++++++++-- include/boost/predef/version.h | 2 +- include/boost/predef/version_number.h | 21 ++++++++++++++++++++- test/version.cpp | 21 +++++++++++++++++++++ 6 files changed, 60 insertions(+), 6 deletions(-) diff --git a/doc/history.qbk b/doc/history.qbk index 45807e8..f63663d 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -7,6 +7,13 @@ http://www.boost.org/LICENSE_1_0.txt) [section History] +[heading 1.5] + +* Fix Intel C/C++ compiler version specification. +* Add `BOOST_VERSION_NUMBER_MAJOR`, `BOOST_VERSION_NUMBER_MINOR`, + `BOOST_VERSION_NUMBER_PATCH` macros to extract components from valid version + numbers. + [heading 1.4.1] * Small fixes for some redefinition errors, and mispelled macros. diff --git a/doc/predef.qbk b/doc/predef.qbk index b04b807..3c802ac 100644 --- a/doc/predef.qbk +++ b/doc/predef.qbk @@ -1,8 +1,8 @@ [article Boost.Predef [quickbook 1.7] - [version 1.4.1] + [version 1.5] [authors [Rivera, Rene]] - [copyright 2005, 2008-2016 Rene Rivera] + [copyright 2005-2016 Rene Rivera] [copyright 2015 Charly Chevalier] [copyright 2015 Joel Falcou] [purpose Identification and specification of predefined macros.] diff --git a/include/boost/predef/compiler/intel.h b/include/boost/predef/compiler/intel.h index 65bde67..3bd76fe 100644 --- a/include/boost/predef/compiler/intel.h +++ b/include/boost/predef/compiler/intel.h @@ -25,7 +25,8 @@ Version number available as major, minor, and patch. [[`__ICC`] [__predef_detection__]] [[`__ECC`] [__predef_detection__]] - [[`__INTEL_COMPILER`] [V.R.P]] + [[`__INTEL_COMPILER`] [V.R]] + [[`__INTEL_COMPILER` and `__INTEL_COMPILER_UPDATE`] [V.R.P]] ] */ @@ -33,8 +34,14 @@ Version number available as major, minor, and patch. #if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || \ defined(__ECC) +# 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)), \ + BOOST_VERSION_NUMBER_MINOR(BOOST_PREDEF_MAKE_10_VVRR(__INTEL_COMPILER)), \ + __INTEL_COMPILER_UPDATE) +# endif # if !defined(BOOST_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER) -# define BOOST_COMP_INTEL_DETECTION BOOST_PREDEF_MAKE_10_VRP(__INTEL_COMPILER) +# define BOOST_COMP_INTEL_DETECTION BOOST_PREDEF_MAKE_10_VVRR(__INTEL_COMPILER) # endif # if !defined(BOOST_COMP_INTEL_DETECTION) # define BOOST_COMP_INTEL_DETECTION BOOST_VERSION_NUMBER_AVAILABLE diff --git a/include/boost/predef/version.h b/include/boost/predef/version.h index 8745c94..ebd2b4f 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,4,1) +#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,5,0) #endif diff --git a/include/boost/predef/version_number.h b/include/boost/predef/version_number.h index 3903a36..4494270 100644 --- a/include/boost/predef/version_number.h +++ b/include/boost/predef/version_number.h @@ -1,5 +1,5 @@ /* -Copyright Rene Rivera 2005, 2008-2013 +Copyright Rene Rivera 2005-2016 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,4 +50,23 @@ Defines standard version numbers, with these properties: #define BOOST_VERSION_NUMBER_NOT_AVAILABLE \ BOOST_VERSION_NUMBER_ZERO +/*` +`` +BOOST_VERSION_NUMBER_MAJOR(N), BOOST_VERSION_NUMBER_MINOR(N), BOOST_VERSION_NUMBER_PATCH(N) +`` + +The macros extract the major, minor, and patch portion from a well formed +version number resulting in a preprocessor expression in the range of +\[0,99\] or \[0,99999\] for the major and minor, or patch numbers +respectively. +*/ +#define BOOST_VERSION_NUMBER_MAJOR(N) \ + ( ((N)/10000000)%100 ) + +#define BOOST_VERSION_NUMBER_MINOR(N) \ + ( ((N)/100000)%100 ) + +#define BOOST_VERSION_NUMBER_PATCH(N) \ + ( (N)%100000 ) + #endif diff --git a/test/version.cpp b/test/version.cpp index e86834c..68e724f 100644 --- a/test/version.cpp +++ b/test/version.cpp @@ -34,6 +34,27 @@ void test_BOOST_VERSION_NUMBER() PREDEF_CHECK(BOOST_VERSION_NUMBER(100,99,99999) != 1009999999L); PREDEF_CHECK(BOOST_VERSION_NUMBER(100,99,99999) == 9999999L); PREDEF_CHECK(BOOST_VERSION_NUMBER(100,100,100000) == 0L); + + PREDEF_CHECK( + BOOST_VERSION_NUMBER_MAJOR(BOOST_VERSION_NUMBER(0,0,0)) == 0); + PREDEF_CHECK( + BOOST_VERSION_NUMBER_MAJOR(BOOST_VERSION_NUMBER(3,3,3)) == 3); + PREDEF_CHECK( + BOOST_VERSION_NUMBER_MAJOR(BOOST_VERSION_NUMBER(99,99,99999)) == 99); + + PREDEF_CHECK( + BOOST_VERSION_NUMBER_MINOR(BOOST_VERSION_NUMBER(0,0,0)) == 0); + PREDEF_CHECK( + BOOST_VERSION_NUMBER_MINOR(BOOST_VERSION_NUMBER(3,3,3)) == 3); + PREDEF_CHECK( + BOOST_VERSION_NUMBER_MINOR(BOOST_VERSION_NUMBER(99,99,99999)) == 99); + + PREDEF_CHECK( + BOOST_VERSION_NUMBER_PATCH(BOOST_VERSION_NUMBER(0,0,0)) == 0); + PREDEF_CHECK( + BOOST_VERSION_NUMBER_PATCH(BOOST_VERSION_NUMBER(3,3,3)) == 3); + PREDEF_CHECK( + BOOST_VERSION_NUMBER_PATCH(BOOST_VERSION_NUMBER(99,99,99999)) == 99999); } int main()