diff --git a/.travis.yml b/.travis.yml index 8619b2a9..2668f56d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,16 +6,11 @@ language: cpp sudo: false -python: "2.7" - -os: - - linux - - osx - branches: only: - master - develop + - /feature\/.*/ env: matrix: @@ -28,10 +23,10 @@ matrix: include: - os: linux - env: TOOLSET=gcc COMPILER=g++ CXXSTD=c++03 + env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11 - os: linux - env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++03 + env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11 addons: apt: packages: @@ -40,16 +35,7 @@ matrix: - ubuntu-toolchain-r-test - os: linux - env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=c++11 - addons: - apt: - packages: - - g++-4.7 - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++03 + env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11 addons: apt: packages: @@ -58,16 +44,7 @@ matrix: - ubuntu-toolchain-r-test - os: linux - env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=c++11 - addons: - apt: - packages: - - g++-4.8 - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++03 + env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11 addons: apt: packages: @@ -76,16 +53,7 @@ matrix: - ubuntu-toolchain-r-test - os: linux - env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=c++11 - addons: - apt: - packages: - - g++-4.9 - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++03 + env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z addons: apt: packages: @@ -94,25 +62,7 @@ matrix: - ubuntu-toolchain-r-test - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++11 - addons: - apt: - packages: - - g++-5 - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=c++14 - addons: - apt: - packages: - - g++-5 - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++03 + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z addons: apt: packages: @@ -121,7 +71,7 @@ matrix: - ubuntu-toolchain-r-test - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++11 + env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z CXXSTD_DIALECT=cxxstd-dialect=gnu addons: apt: packages: @@ -130,67 +80,19 @@ matrix: - ubuntu-toolchain-r-test - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++14 + env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 addons: apt: packages: - - g++-6 + - g++-7 sources: - ubuntu-toolchain-r-test - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=c++1z - addons: - apt: - packages: - - g++-6 - sources: - - ubuntu-toolchain-r-test + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11 - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++03 - addons: - apt: - packages: - - g++-6 - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++11 - addons: - apt: - packages: - - g++-6 - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++14 - addons: - apt: - packages: - - g++-6 - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=gnu++1z - addons: - apt: - packages: - - g++-6 - sources: - - ubuntu-toolchain-r-test - - - os: linux - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03 - - - os: linux - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++03 + env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11,14,1z addons: apt: packages: @@ -200,17 +102,7 @@ matrix: - llvm-toolchain-precise-3.5 - os: linux - env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=c++11 - addons: - apt: - packages: - - clang-3.5 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.5 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++03 + env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14,1z addons: apt: packages: @@ -220,17 +112,7 @@ matrix: - llvm-toolchain-precise-3.6 - os: linux - env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=c++11 - addons: - apt: - packages: - - clang-3.6 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.6 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++03 + env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z addons: apt: packages: @@ -240,17 +122,7 @@ matrix: - llvm-toolchain-precise-3.7 - os: linux - env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=c++11 - addons: - apt: - packages: - - clang-3.7 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.7 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++03 + env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z addons: apt: packages: @@ -260,37 +132,7 @@ matrix: - llvm-toolchain-precise-3.8 - os: linux - env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++11 - addons: - apt: - packages: - - clang-3.8 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++14 - addons: - apt: - packages: - - clang-3.8 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=c++1z - addons: - apt: - packages: - - clang-3.8 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++03 + env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z addons: apt: packages: @@ -300,134 +142,55 @@ matrix: - llvm-toolchain-precise-3.9 - os: linux - env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++11 + compiler: clang++-4.0 + env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z addons: apt: packages: - - clang-3.9 + - clang-4.0 sources: - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.9 + - llvm-toolchain-trusty-4.0 - os: linux - env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++14 + compiler: clang++-5.0 + env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z addons: apt: packages: - - clang-3.9 + - clang-5.0 sources: - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.9 - - - os: linux - env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=c++1z - addons: - apt: - packages: - - clang-3.9 - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.9 + - llvm-toolchain-trusty-5.0 - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03 + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + osx_image: xcode9.1 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + osx_image: xcode9 + + - os: osx + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z osx_image: xcode8.3 - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 - osx_image: xcode8.3 + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z + osx_image: xcode8 - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 - osx_image: xcode8.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z - osx_image: xcode8.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03 - osx_image: xcode8.2 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 - osx_image: xcode8.2 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 - osx_image: xcode8.2 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z - osx_image: xcode8.1 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03 - osx_image: xcode8.1 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 - osx_image: xcode8.1 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 - osx_image: xcode8.1 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z - osx_image: xcode8.1 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03 - osx_image: xcode8.0 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 - osx_image: xcode8.0 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 - osx_image: xcode8.0 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z - osx_image: xcode8.0 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03 + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z osx_image: xcode7.3 - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 - osx_image: xcode7.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 - osx_image: xcode7.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z - osx_image: xcode7.3 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++03 - osx_image: xcode6.4 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++11 - osx_image: xcode6.4 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++14 - osx_image: xcode6.4 - - - os: osx - env: TOOLSET=clang COMPILER=clang++ CXXSTD=c++1z + env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z osx_image: xcode6.4 install: + - BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true - cd .. - - git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root + - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - git submodule update --init tools/build - git submodule update --init libs/detail @@ -440,9 +203,11 @@ install: script: - |- - echo "using $TOOLSET : : $COMPILER : -std=$CXXSTD ;" > ~/user-config.jam - - (cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET && ./config_info_travis) - - ./b2 -j3 libs/config/test toolset=$TOOLSET + echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam + - IFS=',' + - for CXXLOCAL in $CXXSTD; do (cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET cxxstd=$CXXLOCAL $CXXSTD_DIALECT && echo With Standard Version $CXXLOCAL && ./config_info_travis && rm ./config_info_travis) done + - unset IFS + - ./b2 -j3 libs/config/test toolset=$TOOLSET cxxstd=$CXXSTD $CXXSTD_DIALECT notifications: email: diff --git a/appveyor.yml b/appveyor.yml index 190d6fa9..c41150ee 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,7 +21,7 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARGS: --toolset=msvc-14.1 address-model=32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest + ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest cxxflags=-permissive- - ARGS: --toolset=msvc-9.0 address-model=32 - ARGS: --toolset=msvc-10.0 address-model=32 - ARGS: --toolset=msvc-11.0 address-model=32 diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index 667484f9..bc8efb2d 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -939,7 +939,8 @@

The C++ implementation fails to provide the std::iterator - class. + class. Note that post C++17, this macro is re-purposed to indicate + that std::iterator has been removed or deprecated.

@@ -3829,6 +3830,18 @@

+ + +

+ BOOST_NO_CXX17_ITERATOR_TRAITS +

+ + +

+ The compiler does not support SFINAE-friendly std::iterator_traits. +

+ + @@ -3956,7 +3969,7 @@ that is not otherwise described by one of the other Boost.Config macros. To use the macro you must first

-
#include <boost/detail/workaround.hpp>
+
#include <boost/config/workaround.hpp>
 

usage is then: @@ -3987,7 +4000,7 @@

Note: the ultimate source of documentation - for this macro is in boost/detail/workaround.hpp. + for this macro is in boost/config/workaround.hpp.

@@ -4183,7 +4196,16 @@

- BOOST_EXPLICIT_TEMPLATE_TYPE(t) BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t,v) BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t,v) + BOOST_EXPLICIT_TEMPLATE_TYPE(t) +

+

+ BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t,v) +

+

+ BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) +

+

+ BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t,v)

@@ -4452,6 +4474,8 @@

BOOST_LIKELY(X) +

+

BOOST_UNLIKELY(X)

@@ -4520,6 +4544,23 @@

+ + +

+ BOOST_PRAGMA_MESSAGE(M) +

+ + +

+ Defined in header <boost/config/pragma_message.hpp>, + this macro expands to the equivalent of #pragma + message(M). + M must be a string + literal. Example: BOOST_PRAGMA_MESSAGE("This header + is deprecated."). +

+ + diff --git a/doc/html/index.html b/doc/html/index.html index 109e2013..185c0357 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -992,7 +992,7 @@ - +

Last revised: July 21, 2017 at 18:08:20 GMT

Last revised: December 12, 2017 at 18:14:39 GMT


diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index 94d0ca20..e89f6555 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -232,7 +232,8 @@ The C++ standard library does not provide a standards conforming The platform does not have a conforming version of `std::distance`. ]] [[`BOOST_NO_STD_ITERATOR`][Standard library][ -The C++ implementation fails to provide the `std::iterator` class. +The C++ implementation fails to provide the `std::iterator` class. +Note that post C++17, this macro is re-purposed to indicate that std::iterator has been removed or deprecated. ]] [[`BOOST_NO_STD_ITERATOR_TRAITS`][Standard library][ The compiler does not provide a standard compliant implementation of @@ -979,7 +980,7 @@ workarounds for compiler/standard library defects. This macro is used where a compiler specific workaround is required that is not otherwise described by one of the other Boost.Config macros. To use the macro you must first `` -#include +#include `` usage is then: `` @@ -1001,7 +1002,7 @@ For example of `__BORLANDC__` /unless/ the macro `BOOST_DETECT_OUTDATED_WORKAROUNDS` is defined, in which case evaluates to `(__BORLANDC__ <= 0x590)`. -[*Note]: the ultimate source of documentation for this macro is in [@../../../../boost/detail/workaround.hpp boost/detail/workaround.hpp]. +[*Note]: the ultimate source of documentation for this macro is in [@../../../../boost/config/workaround.hpp boost/config/workaround.hpp]. ]] [[`BOOST_PREVENT_MACRO_SUBSTITUTION`][ Sometimes you have a function name with the same name as a C macro, for example "min" and "max" @@ -1095,8 +1096,11 @@ In either case this macro has no effect on runtime behavior and performance of code. ]] [[`BOOST_EXPLICIT_TEMPLATE_TYPE(t)` + `BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t,v)` + `BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)` + `BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t,v)`][ Some compilers silently "fold" different function template instantiations if some of the template parameters don't appear in the function parameter list. @@ -1247,6 +1251,7 @@ If the compiler does not support this markup, `BOOST_NORETURN` is defined empty additional macro `BOOST_NO_NORETURN` is defined. ]] [[`BOOST_LIKELY(X)` + `BOOST_UNLIKELY(X)`][ These macros communicate to the compiler that the conditional expression `X` is likely or unlikely to yield a positive result. The expression should result in a boolean value. @@ -1275,6 +1280,9 @@ Usage example: typedef unsigned int BOOST_MAY_ALIAS aliasing_uint; `` ]] +[[`BOOST_PRAGMA_MESSAGE(M)`][Defined in header ``, +this macro expands to the equivalent of `#pragma message(M)`. `M` must be a string +literal. Example: `BOOST_PRAGMA_MESSAGE("This header is deprecated.")`.]] ] [endsect] diff --git a/include/boost/config/compiler/diab.hpp b/include/boost/config/compiler/diab.hpp index 0de72d06..943db83f 100644 --- a/include/boost/config/compiler/diab.hpp +++ b/include/boost/config/compiler/diab.hpp @@ -12,8 +12,15 @@ #include "boost/config/compiler/common_edg.hpp" -#define BOOST_HAS_LONG_LONG #define BOOST_NO_TWO_PHASE_NAME_LOOKUP +#define BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS + +#define BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE +#define BOOST_LOG_NO_MEMBER_TEMPLATE_FRIENDS +#define BOOST_REGEX_NO_EXTERNAL_TEMPLATES + #define BOOST_NO_CXX11_HDR_INITIALIZER_LIST #define BOOST_NO_CXX11_HDR_CODECVT +#define BOOST_NO_CXX11_NUMERIC_LIMITS + #define BOOST_COMPILER "Wind River Diab " BOOST_STRINGIZE(__VERSION_NUMBER__) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index d9465613..8b40c45b 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -217,17 +217,29 @@ // https://connect.microsoft.com/VisualStudio/feedback/details/1582233/c-subobjects-still-not-value-initialized-correctly // See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues // (Niels Dekker, LKEB, May 2010) +// Still present in VC15.5, Dec 2017. #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION // // C++ 11: // -#define BOOST_NO_TWO_PHASE_NAME_LOOKUP +// This is supported with /permissive- for 15.5 onwards, unfortunately we appear to have no way to tell +// if this is in effect or not, in any case nothing in Boost is currently using this, so we'll just go +// on defining it for now: +// +# define BOOST_NO_TWO_PHASE_NAME_LOOKUP + +#if (_MSC_VER < 1912) || (_MSVC_LANG < 201402) +// Supported from msvc-15.5 onwards: #define BOOST_NO_CXX11_SFINAE_EXPR +#endif // C++ 14: +// Still gives internal compiler error for msvc-15.5: # define BOOST_NO_CXX14_CONSTEXPR // C++ 17: +#if (_MSC_VER < 1912) || (_MSVC_LANG < 201703) #define BOOST_NO_CXX17_INLINE_VARIABLES #define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif // // Things that don't work in clr mode: @@ -325,12 +337,14 @@ # define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) #endif +#include + // -// last known and checked version is 19.11.25547 (VC++ 2017.4): -#if (_MSC_VER > 1911) +// last known and checked version is 19.12.25830.2 (VC++ 2017.3): +#if (_MSC_VER > 1912) # if defined(BOOST_ASSERT_CONFIG) # error "Boost.Config is older than your current compiler version." # elif !defined(BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE) -# pragma message("Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message.") + BOOST_PRAGMA_MESSAGE("Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an updated Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message.") # endif #endif diff --git a/include/boost/config/detail/suffix.hpp b/include/boost/config/detail/suffix.hpp index caa0b229..4aeac4c7 100644 --- a/include/boost/config/detail/suffix.hpp +++ b/include/boost/config/detail/suffix.hpp @@ -537,25 +537,10 @@ namespace std{ using ::type_info; } // ---------------------------------------------------------------------------// -// // Helper macro BOOST_STRINGIZE: -// Converts the parameter X to a string after macro replacement -// on X has been performed. -// -#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X) -#define BOOST_DO_STRINGIZE(X) #X - -// // Helper macro BOOST_JOIN: -// The following piece of macro magic joins the two -// arguments together, even when one of the arguments is -// itself a macro (see 16.3.1 in C++ standard). The key -// is that macro expansion of macro arguments does not -// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN. -// -#define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y ) -#define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y) -#define BOOST_DO_JOIN2( X, Y ) X##Y + +#include // // Set some default values for compiler/library/platform names. diff --git a/include/boost/config/helper_macros.hpp b/include/boost/config/helper_macros.hpp new file mode 100644 index 00000000..3e79526d --- /dev/null +++ b/include/boost/config/helper_macros.hpp @@ -0,0 +1,37 @@ +#ifndef BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED +#define BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED + +// Copyright 2001 John Maddock. +// Copyright 2017 Peter Dimov. +// +// 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 +// +// BOOST_STRINGIZE(X) +// BOOST_JOIN(X, Y) +// +// Note that this header is C compatible. + +// +// Helper macro BOOST_STRINGIZE: +// Converts the parameter X to a string after macro replacement +// on X has been performed. +// +#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X) +#define BOOST_DO_STRINGIZE(X) #X + +// +// Helper macro BOOST_JOIN: +// The following piece of macro magic joins the two +// arguments together, even when one of the arguments is +// itself a macro (see 16.3.1 in C++ standard). The key +// is that macro expansion of macro arguments does not +// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN. +// +#define BOOST_JOIN(X, Y) BOOST_DO_JOIN(X, Y) +#define BOOST_DO_JOIN(X, Y) BOOST_DO_JOIN2(X,Y) +#define BOOST_DO_JOIN2(X, Y) X##Y + +#endif // BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED diff --git a/include/boost/config/platform/vxworks.hpp b/include/boost/config/platform/vxworks.hpp index a7f571c4..a91e4ab4 100644 --- a/include/boost/config/platform/vxworks.hpp +++ b/include/boost/config/platform/vxworks.hpp @@ -1,30 +1,50 @@ // (C) Copyright Dustin Spicuzza 2009. // Adapted to vxWorks 6.9 by Peter Brockamp 2012. +// Updated for VxWorks 7 by Brian Kuhl 2016 // 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) // See http://www.boost.org for most recent version. -// Since WRS does not yet properly support boost under vxWorks -// and this file was badly outdated, but I was keen on using it, -// I patched boost myself to make things work. This has been tested -// and adapted by me for vxWorks 6.9 *only*, as I'm lacking access -// to earlier 6.X versions! The only thing I know for sure is that -// very old versions of vxWorks (namely everything below 6.x) are -// absolutely unable to use boost. This is mainly due to the completely -// outdated libraries and ancient compiler (GCC 2.96 or worse). Do -// not even think of getting this to work, a miserable failure will -// be guaranteed! +// Old versions of vxWorks (namely everything below 6.x) are +// absolutely unable to use boost. Old STLs and compilers +// like (GCC 2.96) . Do not even think of getting this to work, +// a miserable failure will be guaranteed! +// // Equally, this file has been tested for RTPs (Real Time Processes) // only, not for DKMs (Downloadable Kernel Modules). These two types // of executables differ largely in the available functionality of -// the C-library, STL, and so on. A DKM uses a library similar to those -// of vxWorks 5.X - with all its limitations and incompatibilities -// with respect to ANSI C++ and STL. So probably there might be problems -// with the usage of boost from DKMs. WRS or any voluteers are free to -// prove the opposite! - +// the C-library, STL, and so on. A DKM uses a C89 library with no +// wide character support and no guarantee of ANSI C. The same Dinkum +// STL library is used in both contexts. +// +// Similarly the Dinkum abridged STL that supports the loosely specified +// embedded C++ standard has not been tested and is unlikely to work +// on anything but the simplest library. +// ==================================================================== +// +// Additional Configuration +// ------------------------------------------------------------------- +// +// Because of the ordering of include files and other issues the following +// additional definitions worked better outside this file. +// +// When building the log library add the following to the b2 invocation +// define=BOOST_LOG_WITHOUT_IPC +// and +// -DBOOST_LOG_WITHOUT_DEFAULT_FACTORIES +// to your compile options. +// +// When building the test library add +// -DBOOST_TEST_LIMITED_SIGNAL_DETAILS +// to your compile options +// +// When building containers library add +// -DHAVE_MORECORE=0 +// to your c compile options so dlmalloc heap library is compiled +// without brk() calls +// // ==================================================================== // // Some important information regarding the usage of POSIX semaphores: @@ -38,29 +58,14 @@ // Now, VxWorks POSIX-semaphores for DKM's default to the usage of // priority inverting semaphores, which is fine. On the other hand, // for RTP's it defaults to using non priority inverting semaphores, -// which could easily pose a serious problem for a real time process, -// i.e. deadlocks! To overcome this two possibilities do exist: +// which could easily pose a serious problem for a real time process. // -// a) Patch every piece of boost that uses semaphores to instanciate -// the proper type of semaphores. This is non-intrusive with respect -// to the OS and could relatively easy been done by giving all -// semaphores attributes deviating from the default (for in-depth -// information see the POSIX functions pthread_mutexattr_init() -// and pthread_mutexattr_setprotocol()). However this breaks all -// too easily, as with every new version some boost library could -// all in a sudden start using semaphores, resurrecting the very -// same, hard to locate problem over and over again! -// -// b) We could change the default properties for POSIX-semaphores -// that VxWorks uses for RTP's and this is being suggested here, -// as it will more or less seamlessly integrate with boost. I got -// the following information from WRS how to do this, compare -// Wind River TSR# 1209768: -// -// Instructions for changing the default properties of POSIX- -// semaphores for RTP's in VxWorks 6.9: -// - Edit the file /vxworks-6.9/target/usr/src/posix/pthreadLib.c -// in the root of your Workbench-installation. +// To change the default properties for POSIX-semaphores in VxWorks 7 +// enable core > CORE_USER Menu > DEFAULT_PTHREAD_PRIO_INHERIT +// +// In VxWorks 6.x so as to integrate with boost. +// - Edit the file +// installDir/vxworks-6.x/target/usr/src/posix/pthreadLib.c // - Around line 917 there should be the definition of the default // mutex attributes: // @@ -81,30 +86,11 @@ // pAttr->mutexAttrType = PTHREAD_MUTEX_DEFAULT; // // Here again, replace PTHREAD_PRIO_NONE by PTHREAD_PRIO_INHERIT. -// - Finally, rebuild your VSB. This will create a new VxWorks kernel +// - Finally, rebuild your VSB. This will rebuild the libraries // with the changed properties. That's it! Now, using boost should // no longer cause any problems with task deadlocks! // -// And here's another useful piece of information concerning VxWorks' -// POSIX-functionality in general: -// VxWorks is not a genuine POSIX-OS in itself, rather it is using a -// kind of compatibility layer (sort of a wrapper) to emulate the -// POSIX-functionality by using its own resources and functions. -// At the time a task (thread) calls it's first POSIX-function during -// runtime it is being transformed by the OS into a POSIX-thread. -// This transformation does include a call to malloc() to allocate the -// memory required for the housekeeping of POSIX-threads. In a high -// priority RTP this malloc() call may be highly undesirable, as its -// timing is more or less unpredictable (depending on what your actual -// heap looks like). You can circumvent this problem by calling the -// function thread_self() at a well defined point in the code of the -// task, e.g. shortly after the task spawns up. Thereby you are able -// to define the time when the task-transformation will take place and -// you could shift it to an uncritical point where a malloc() call is -// tolerable. So, if this could pose a problem for your code, remember -// to call thread_self() from the affected task at an early stage. -// -// ==================================================================== +// ==================================================================== // Block out all versions before vxWorks 6.x, as these don't work: // Include header with the vxWorks version information and query them @@ -158,11 +144,6 @@ #define BOOST_HAS_CLOCK_GETTIME #define BOOST_HAS_MACRO_USE_FACET -// Generally unavailable functionality, delivered by boost's test function: -//#define BOOST_NO_DEDUCED_TYPENAME // Commented this out, boost's test gives an errorneous result! -#define BOOST_NO_CXX11_EXTERN_TEMPLATE -#define BOOST_NO_CXX11_VARIADIC_MACROS - // Generally available threading API's: #define BOOST_HAS_PTHREADS #define BOOST_HAS_SCHED_YIELD @@ -191,14 +172,7 @@ # endif #endif -// vxWorks doesn't work with asio serial ports: -#define BOOST_ASIO_DISABLE_SERIAL_PORT -// TODO: The problem here seems to bee that vxWorks uses its own, very specific -// ways to handle serial ports, incompatible with POSIX or anything... -// Maybe a specific implementation would be possible, but until the -// straight need arises... This implementation would presumably consist -// of some vxWorks specific ioctl-calls, etc. Any voluteers? - +#if (_WRS_VXWORKS_MAJOR < 7) // vxWorks-around: #defines CLOCKS_PER_SEC as sysClkRateGet() but // miserably fails to #include the required to make // sysClkRateGet() available! So we manually include it here. @@ -208,11 +182,12 @@ #endif // vxWorks-around: In the macros INT32_C(), UINT32_C(), INT64_C() and -// UINT64_C() are defined errorneously, yielding not a signed/ +// UINT64_C() are defined erroneously, yielding not a signed/ // unsigned long/long long type, but a signed/unsigned int/long // type. Eventually this leads to compile errors in ratio_fwd.hpp, // when trying to define several constants which do not fit into a // long type! We correct them here by redefining. + #include // Some macro-magic to do the job @@ -231,12 +206,16 @@ #define UINT64_C(x) VX_JOIN(x, ULL) // #include Libraries required for the following function adaption +#include +#endif // _WRS_VXWORKS_MAJOR < 7 + #include #include -#include // Use C-linkage for the following helper functions +#ifdef __cplusplus extern "C" { +#endif // vxWorks-around: The required functions getrlimit() and getrlimit() are missing. // But we have the similar functions getprlimit() and setprlimit(), @@ -248,7 +227,7 @@ extern "C" { // TODO: getprlimit() and setprlimit() do exist for RTPs only, for whatever reason. // Thus for DKMs there would have to be another implementation. -#ifdef __RTP__ +#if defined ( __RTP__) && (_WRS_VXWORKS_MAJOR < 7) inline int getrlimit(int resource, struct rlimit *rlp){ return getprlimit(0, 0, resource, rlp); } @@ -273,14 +252,20 @@ inline int truncate(const char *p, off_t l){ return close(fd); } +#ifdef __GNUC__ +#define ___unused __attribute__((unused)) +#else +#define ___unused +#endif + // Fake symlink handling by dummy functions: -inline int symlink(const char*, const char*){ +inline int symlink(const char* path1 ___unused, const char* path2 ___unused){ // vxWorks has no symlinks -> always return an error! errno = EACCES; return -1; } -inline ssize_t readlink(const char*, char*, size_t){ +inline ssize_t readlink(const char* path1 ___unused, char* path2 ___unused, size_t size ___unused){ // vxWorks has no symlinks -> always return an error! errno = EACCES; return -1; @@ -297,8 +282,18 @@ inline int gettimeofday(struct timeval *tv, void * /*tzv*/) { } #endif +#ifdef __cplusplus +} // extern "C" +#endif -// vxWorks does provide neither struct tms nor function times()! +/* + * moved to os/utils/unix/freind_h/times.h in VxWorks 7 + * to avoid conflict with MPL operator times + */ +#if (_WRS_VXWORKS_MAJOR < 7) +#ifdef __cplusplus + +// vxWorks provides neither struct tms nor function times()! // We implement an empty dummy-function, simply setting the user // and system time to the half of thew actual system ticks-value // and the child user and system time to 0. @@ -315,7 +310,8 @@ struct tms{ clock_t tms_cstime; // System CPU time of terminated child processes }; -inline clock_t times(struct tms *t){ + + inline clock_t times(struct tms *t){ struct timespec ts; clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); clock_t ticks(static_cast(static_cast(ts.tv_sec) * CLOCKS_PER_SEC + @@ -327,8 +323,16 @@ inline clock_t times(struct tms *t){ return ticks; } -extern void bzero (void *, size_t); // FD_ZERO uses bzero() but doesn't include strings.h -} // extern "C" + +namespace std { + using ::times; +} +#endif // __cplusplus +#endif // _WRS_VXWORKS_MAJOR < 7 + + +#ifdef __cplusplus +extern "C" void bzero (void *, size_t); // FD_ZERO uses bzero() but doesn't include strings.h // Put the selfmade functions into the std-namespace, just in case namespace std { @@ -339,9 +343,11 @@ namespace std { using ::truncate; using ::symlink; using ::readlink; - using ::times; - using ::gettimeofday; +#if (_WRS_VXWORKS_MAJOR < 7) + using ::gettimeofday; +#endif } +#endif // __cplusplus // Some more macro-magic: // vxWorks-around: Some functions are not present or broken in vxWorks @@ -349,12 +355,13 @@ namespace std { // Include signal.h which might contain a typo to be corrected here #include - -inline int getpagesize() { return sysconf(_SC_PAGESIZE); } // getpagesize is deprecated anyway! +#if (_WRS_VXWORKS_MAJOR < 7) +#define getpagesize() sysconf(_SC_PAGESIZE) // getpagesize is deprecated anyway! +inline int lstat(p, b) { return stat(p, b); } // lstat() == stat(), as vxWorks has no symlinks! +#endif #ifndef S_ISSOCK # define S_ISSOCK(mode) ((mode & S_IFMT) == S_IFSOCK) // Is file a socket? #endif -inline int lstat(p, b) { return stat(p, b); } // lstat() == stat(), as vxWorks has no symlinks! #ifndef FPE_FLTINV # define FPE_FLTINV (FPE_FLTSUB+1) // vxWorks has no FPE_FLTINV, so define one as a dummy #endif @@ -371,22 +378,56 @@ typedef int locale_t; // locale_t is a POSIX-ex // vxWorks 7 adds C++11 support // however it is optional, and does not match exactly the support determined -// by examining Dinkum STL version and GCC version (or ICC and DCC) - +// by examining the Dinkum STL version and GCC version (or ICC and DCC) #ifndef _WRS_CONFIG_LANG_LIB_CPLUS_CPLUS_USER_2011 +# define BOOST_NO_CXX11_ADDRESSOF // C11 addressof operator on memory location +# define BOOST_NO_CXX11_ALLOCATOR +# define BOOST_NO_CXX11_ATOMIC_SMART_PTR +# define BOOST_NO_CXX11_NUMERIC_LIMITS // max_digits10 in test/../print_helper.hpp +# define BOOST_NO_CXX11_SMART_PTR +# define BOOST_NO_CXX11_STD_ALIGN + + # define BOOST_NO_CXX11_HDR_ARRAY +# define BOOST_NO_CXX11_HDR_ATOMIC +# define BOOST_NO_CXX11_HDR_CHRONO +# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE +# define BOOST_NO_CXX11_HDR_FORWARD_LIST //serialization/test/test_list.cpp +# define BOOST_NO_CXX11_HDR_FUNCTIONAL +# define BOOST_NO_CXX11_HDR_FUTURE +# define BOOST_NO_CXX11_HDR_MUTEX +# define BOOST_NO_CXX11_HDR_RANDOM //math/../test_data.hpp +# define BOOST_NO_CXX11_HDR_RATIO +# define BOOST_NO_CXX11_HDR_REGEX +# define BOOST_NO_CXX14_HDR_SHARED_MUTEX +# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR +# define BOOST_NO_CXX11_HDR_THREAD # define BOOST_NO_CXX11_HDR_TYPEINDEX # define BOOST_NO_CXX11_HDR_TYPE_TRAITS # define BOOST_NO_CXX11_HDR_TUPLE -# define BOOST_NO_CXX11_ALLOCATOR -# define BOOST_NO_CXX11_SMART_PTR -# define BOOST_NO_CXX11_STD_ALIGN -# define BOOST_NO_CXX11_HDR_UNORDERED_SET -# define BOOST_NO_CXX11_HDR_TYPE_TRAITS # define BOOST_NO_CXX11_HDR_UNORDERED_MAP -# define BOOST_NO_CXX11_HDR_FUNCTIONAL -# define BOOST_NO_CXX11_HDR_ATOMIC +# define BOOST_NO_CXX11_HDR_UNORDERED_SET #else -# define BOOST_NO_CXX11_NULLPTR +#ifndef BOOST_SYSTEM_NO_DEPRECATED +# define BOOST_SYSTEM_NO_DEPRECATED // workaround link error in spirit +#endif #endif + +// NONE is used in enums in lamda and other libraries +#undef NONE +// restrict is an iostreams class +#undef restrict + +// use fake poll() from Unix layer in ASIO to get full functionality +// most libraries will use select() but this define allows 'iostream' functionality +// which is based on poll() only +#if (_WRS_VXWORKS_MAJOR > 6) +# ifndef BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR +# define BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR +# endif +#else +# define BOOST_ASIO_DISABLE_SERIAL_PORT +#endif + + diff --git a/include/boost/config/pragma_message.hpp b/include/boost/config/pragma_message.hpp new file mode 100644 index 00000000..d213f63c --- /dev/null +++ b/include/boost/config/pragma_message.hpp @@ -0,0 +1,29 @@ +#ifndef BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED +#define BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED + +// Copyright 2017 Peter Dimov. +// +// 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 +// +// BOOST_PRAGMA_MESSAGE("message") +// +// Expands to the equivalent of #pragma message("message") +// +// Note that this header is C compatible. + +#include + +#if defined(BOOST_DISABLE_PRAGMA_MESSAGE) +# define BOOST_PRAGMA_MESSAGE(x) +#elif defined(__GNUC__) +# define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x))) +#elif defined(_MSC_VER) +# define BOOST_PRAGMA_MESSAGE(x) __pragma(message(__FILE__ "(" BOOST_STRINGIZE(__LINE__) "): note: " x)) +#else +# define BOOST_PRAGMA_MESSAGE(x) +#endif + +#endif // BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index 0af104d0..641c2ae2 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -96,7 +96,8 @@ #include #endif #include -#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) && !defined(__TI_COMPILER_VERSION__) && !defined(__VISUALDSPVERSION__) +#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) && !defined(__TI_COMPILER_VERSION__) && !defined(__VISUALDSPVERSION__) \ + && !defined(__VXWORKS__) # define BOOST_NO_STD_TYPEINFO #endif @@ -172,10 +173,15 @@ // C++17 features #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1910) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0) # define BOOST_NO_CXX17_STD_APPLY +# define BOOST_NO_CXX17_ITERATOR_TRAITS #endif #if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) # define BOOST_NO_CXX17_STD_INVOKE -# define BOOST_NO_CXX17_ITERATOR_TRAITS +#endif + +#if !(!defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1912) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0)) +// Deprecated std::iterator: +# define BOOST_NO_STD_ITERATOR #endif #if defined(BOOST_INTEL) && (BOOST_INTEL <= 1400) diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index 6cd420a6..e99fe316 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -78,6 +78,7 @@ # include #endif +#ifndef __VXWORKS__ // VxWorks uses Dinkum, not GNU STL with GCC #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0 # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx # define BOOST_HAS_SLIST @@ -91,6 +92,7 @@ # define BOOST_HASH_MAP_HEADER # endif #endif +#endif // // Decide whether we have C++11 support turned on: diff --git a/include/boost/config/workaround.hpp b/include/boost/config/workaround.hpp index 0ce8108c..fca8f3ab 100644 --- a/include/boost/config/workaround.hpp +++ b/include/boost/config/workaround.hpp @@ -87,8 +87,10 @@ #endif #ifndef BOOST_GCC #define BOOST_GCC_WORKAROUND_GUARD 1 +#define BOOST_GCC_VERSION_WORKAROUND_GUARD 1 #else #define BOOST_GCC_WORKAROUND_GUARD 0 +#define BOOST_GCC_VERSION_WORKAROUND_GUARD 0 #endif #ifndef BOOST_XLCPP_ZOS #define BOOST_XLCPP_ZOS_WORKAROUND_GUARD 1 diff --git a/include/boost/version.hpp b/include/boost/version.hpp index d8f2132a..e96f3432 100644 --- a/include/boost/version.hpp +++ b/include/boost/version.hpp @@ -19,7 +19,7 @@ // BOOST_VERSION / 100 % 1000 is the minor version // BOOST_VERSION / 100000 is the major version -#define BOOST_VERSION 106600 +#define BOOST_VERSION 106700 // // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION @@ -27,6 +27,6 @@ // number, y is the minor version number, and z is the patch level if not 0. // This is used by to select which library version to link to. -#define BOOST_LIB_VERSION "1_66" +#define BOOST_LIB_VERSION "1_67" #endif diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 29d52e4d..9f1e4ea4 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -69,6 +69,7 @@ test-suite config : #input-files : #requirements off + vxworks:no # vx requires complete library rebuild to turn off exceptions [ check-target-builds has_atomic_lib : atomic ] [ check-target-builds has_pthread_lib : pthread ] [ check-target-builds has_rt_lib : rt ] @@ -77,7 +78,9 @@ test-suite config [ run config_info.cpp : : : always_show_run_output single msvc:static msvc:static ] [ run config_info.cpp : : : always_show_run_output multi : config_info_threaded ] [ run config_info.cpp : : : always_show_run_output off : config_info_no_rtti ] - [ run config_info.cpp : : : always_show_run_output off : config_info_no_except ] + [ run config_info.cpp : : : always_show_run_output off + vxworks:no + : config_info_no_except ] [ run math_info.cpp : : : always_show_run_output borland:static borland:static ] [ run abi/abi_test.cpp abi/main.cpp ] [ run limits_test.cpp ] @@ -88,6 +91,7 @@ test-suite config shared BOOST_DYN_LINK=1 BOOST_CONFIG_NO_LIB=1 + vxworks:shared : config_link_test ] @@ -99,6 +103,8 @@ test-suite config [ run cstdint_test2.cpp : : : all gcc:"-Wno-long-long -Wextra" darwin:-Wno-long-long ] [ compile cstdint_include_test.cpp : all gcc:-Wextra ] [ run config_build_check.cpp : : : [ requires int128 cxx11_constexpr cxx11_user_defined_literals ] ] + [ run helper_macros_test.cpp ] + [ compile pragma_message_test.cpp ] ; obj has_clang_implicit_fallthrough : cmd_line_check.cpp : diff --git a/test/boost_has_part_alloc.ipp b/test/boost_has_part_alloc.ipp index fb4bf516..3e4c2cb8 100644 --- a/test/boost_has_part_alloc.ipp +++ b/test/boost_has_part_alloc.ipp @@ -28,6 +28,7 @@ template int test_allocator(const T& i) { typedef std::allocator alloc1_t; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) typedef typename alloc1_t::size_type size_type; typedef typename alloc1_t::difference_type difference_type BOOST_UNUSED_ATTRIBUTE; typedef typename alloc1_t::pointer pointer; @@ -35,9 +36,10 @@ int test_allocator(const T& i) typedef typename alloc1_t::reference reference; typedef typename alloc1_t::const_reference const_reference; typedef typename alloc1_t::value_type value_type BOOST_UNUSED_ATTRIBUTE; - +#endif alloc1_t a1; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) pointer p = a1.allocate(1); const_pointer cp = p; a1.construct(p,i); @@ -49,7 +51,7 @@ int test_allocator(const T& i) if(cp != a1.address(cr)) return -1; a1.destroy(p); a1.deallocate(p,1); - +#endif return 0; } diff --git a/test/boost_no_cxx11_hdr_type_traits.ipp b/test/boost_no_cxx11_hdr_type_traits.ipp index cf6cdd70..d4862a0c 100644 --- a/test/boost_no_cxx11_hdr_type_traits.ipp +++ b/test/boost_no_cxx11_hdr_type_traits.ipp @@ -45,7 +45,11 @@ int test() using std::is_trivially_copyable; using std::is_standard_layout; using std::is_pod; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) + // deprecated in C++ 17: using std::is_literal_type; + using std::result_of; +#endif using std::is_empty; using std::is_polymorphic; using std::is_abstract; @@ -99,7 +103,6 @@ int test() using std::conditional; using std::common_type; using std::underlying_type; - using std::result_of; return 0; } diff --git a/test/boost_no_cxx17_iterator_traits.ipp b/test/boost_no_cxx17_iterator_traits.ipp index ea75f232..cef88c05 100644 --- a/test/boost_no_cxx17_iterator_traits.ipp +++ b/test/boost_no_cxx17_iterator_traits.ipp @@ -13,9 +13,16 @@ namespace boost_no_cxx17_iterator_traits { -struct iterator : - public std::iterator< std::random_access_iterator_tag, char > +struct iterator { + typedef std::random_access_iterator_tag iterator_category; + typedef char value_type; + typedef std::ptrdiff_t difference_type; + typedef char* pointer; + typedef char& reference; + + reference operator*()const; + iterator operator++(); }; struct non_iterator {}; @@ -37,11 +44,9 @@ struct has_iterator_category< Traits, typename void_type< typename Traits::itera int test() { - if (!has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::iterator > >::value) - return 1; + static_assert(has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::iterator > >::value, "has_iterator_category failed"); - if (has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::non_iterator > >::value) - return 2; + static_assert(!has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::non_iterator > >::value, "has_iterator_category negative check failed"); return 0; } diff --git a/test/boost_no_std_allocator.ipp b/test/boost_no_std_allocator.ipp index d3badbd5..80e048e4 100644 --- a/test/boost_no_std_allocator.ipp +++ b/test/boost_no_std_allocator.ipp @@ -28,20 +28,33 @@ template int test_allocator(const T& i) { typedef std::allocator alloc1_t; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) + // stuff deprecated in C++17: typedef typename alloc1_t::size_type size_type; typedef typename alloc1_t::difference_type difference_type BOOST_UNUSED_ATTRIBUTE; typedef typename alloc1_t::pointer pointer; typedef typename alloc1_t::const_pointer const_pointer; typedef typename alloc1_t::reference reference; typedef typename alloc1_t::const_reference const_reference; + #endif typedef typename alloc1_t::value_type value_type BOOST_UNUSED_ATTRIBUTE; - typedef typename alloc1_t::BOOST_NESTED_TEMPLATE rebind binder_t; - typedef typename binder_t::other alloc2_t; - alloc1_t a1; alloc1_t a2(a1); +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) + // stuff deprecated in C++17: + typedef typename alloc1_t::BOOST_NESTED_TEMPLATE rebind binder_t; + typedef typename binder_t::other alloc2_t; + alloc2_t a3(a1); + // this chokes early versions of the MSL library + // and isn't currently required by anything in boost + // so don't test for now... + // a3 = a2; + (void)a2; +#endif + +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) pointer p = a1.allocate(1); const_pointer cp = p; a1.construct(p,i); @@ -52,15 +65,11 @@ int test_allocator(const T& i) if(p != a1.address(r)) return -1; if(cp != a1.address(cr)) return -1; a1.destroy(p); +#else + auto p = a1.allocate(1); +#endif a1.deallocate(p,1); - alloc2_t a3(a1); - // this chokes early versions of the MSL library - // and isn't currently required by anything in boost - // so don't test for now... - // a3 = a2; - - (void)a2; return 0; } diff --git a/test/config_info.cpp b/test/config_info.cpp index 89f6b07b..520aa8bc 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -143,19 +143,53 @@ void print_compiler_macros() PRINT_MACRO(_WCHAR_T_DEFINED); #endif // MSVC macros: + PRINT_MACRO(_ALIGNED_NEW_SUPPORTED); + PRINT_MACRO(__ATOM__); + PRINT_MACRO(__AVX__); + PRINT_MACRO(__AVX2__); + PRINT_MACRO(_CHAR_UNSIGNED); + PRINT_MACRO(_CLR_VER); + PRINT_MACRO(_CONTROL_FLOW_GUARD); + PRINT_MACRO(__cplusplus_cli); + PRINT_MACRO(__cplusplus_winrt); PRINT_MACRO(_CPPRTTI); + PRINT_MACRO(_CPPUNWIND); PRINT_MACRO(_DLL); + PRINT_MACRO(_INLINE_VARIABLES_SUPPORTED); + PRINT_MACRO(_ISO_VOLATILE); + PRINT_MACRO(_M_AMD64); + PRINT_MACRO(_M_ARM); + PRINT_MACRO(_M_ARM_ARMV7VE); + PRINT_MACRO(_M_ARM_FP); + PRINT_MACRO(_M_ARM64); + PRINT_MACRO(_M_CEE); + PRINT_MACRO(_M_CEE_PURE); + PRINT_MACRO(_M_CEE_SAFE); + PRINT_MACRO(_M_FP_EXCEPT); + PRINT_MACRO(_M_FP_FAST); + PRINT_MACRO(_M_FP_PRECISE); + PRINT_MACRO(_M_FP_STRICT); + PRINT_MACRO(_M_IX86); + PRINT_MACRO(_M_IX86_FP); + PRINT_MACRO(_M_X64); PRINT_MACRO(_M_ALPHA); PRINT_MACRO(_M_MPPC); PRINT_MACRO(_M_MRX000); PRINT_MACRO(_M_PPC); + PRINT_MACRO(_MANAGED); + PRINT_MACRO(_MSC_BUILD); PRINT_MACRO(_MFC_VER); PRINT_MACRO(_MSC_EXTENSIONS); PRINT_MACRO(_MSC_VER); PRINT_MACRO(_MSC_FULL_VER); PRINT_MACRO(_MSVC_LANG); + PRINT_MACRO(_MSVC_WARNING_LEVEL); + PRINT_MACRO(__MSVC_RUNTIME_CHECKS); PRINT_MACRO(_MT); PRINT_MACRO(_NATIVE_WCHAR_T_DEFINED); + PRINT_MACRO(_NOEXCEPT_TYPES_SUPPORTED); + PRINT_MACRO(_OPENMP); + PRINT_MACRO(_PREFAST_); // GNUC options: PRINT_MACRO(__GNUC__); PRINT_MACRO(__GNUC_MINOR__); @@ -581,10 +615,33 @@ void print_stdlib_macros() #endif // Dinkumware options: PRINT_MACRO(_CPPLIB_VER); + PRINT_MACRO(_MSVC_STL_VERSION); // VS2017 15.5+ + PRINT_MACRO(_MSVC_STL_UPDATE); // VS2017 15.5+ PRINT_MACRO(_GLOBAL_USING); PRINT_MACRO(_HAS_EXCEPTIONS); PRINT_MACRO(_HAS_MEMBER_TEMPLATES_REBIND); PRINT_MACRO(_HAS_TEMPLATE_PARTIAL_ORDERING); + // https://blogs.msdn.microsoft.com/vcblog/2016/08/12/stl-fixes-in-vs-2015-update-3/ + PRINT_MACRO(_HAS_CXX17); + PRINT_MACRO(_HAS_AUTO_PTR_ETC); + PRINT_MACRO(_HAS_OLD_IOSTREAMS_MEMBERS); + PRINT_MACRO(_HAS_FUNCTION_ASSIGN); + PRINT_MACRO(_HAS_TR1_NAMESPACE); + PRINT_MACRO(_HAS_IDENTITY_STRUCT); + // VS2017 15.5+ + PRINT_MACRO(_HAS_STATIC_RTTI); + PRINT_MACRO(_HAS_UNEXPECTED); + PRINT_MACRO(_HAS_STD_BYTE); + PRINT_MACRO(_HAS_FUNCTION_ALLOCATOR_SUPPORT); + PRINT_MACRO(_HAS_TR2_SYS_NAMESPACE); + PRINT_MACRO(_ENFORCE_MATCHING_ALLOCATORS); + PRINT_MACRO(_HAS_HAS_UNIQUE_OBJECT_REPRESENTATIONS); + PRINT_MACRO(_HAS_INLINE_VARIABLES); + PRINT_MACRO(_HAS_ALIGNED_NEW); + PRINT_MACRO(_HAS_NOEXCEPT_FUNCTION_TYPES); + PRINT_MACRO(_ITERATOR_DEBUG_LEVEL); + PRINT_MACRO(_HAS_ITERATOR_DEBUGGING); + PRINT_MACRO(_ITERATOR_DEBUG_ARRAY_OVERLOADS); // Libc++: PRINT_MACRO(_LIBCPP_VERSION); // STLPort and generic SGI STL options: @@ -764,6 +821,7 @@ void print_stdlib_macros() PRINT_MACRO(_GLIBCXX_MEM_LIMITS); PRINT_MACRO(_GLIBCXX_HOSTED); PRINT_MACRO(_GLIBCXX_SJLJ_EXCEPTIONS); + PRINT_MACRO(_GLIBCXX_RELEASE); // Modena C++ standard library PRINT_MACRO(MSIPL_ANSI_HEADER); @@ -1146,6 +1204,8 @@ void print_boost_macros() PRINT_MACRO(BOOST_INTEL); PRINT_MACRO(BOOST_MSVC); + PRINT_MACRO(BOOST_GCC); + PRINT_MACRO(BOOST_LIBSTDCXX_VERSION); PRINT_MACRO(BOOST_STD_EXTENSION_NAMESPACE); PRINT_MACRO(BOOST_UNREACHABLE_RETURN(0)); PRINT_MACRO(BOOST_CONSTEXPR); @@ -1159,6 +1219,65 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_MAY_ALIAS); } +void print_sd6_macros() +{ + // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0096r5.html + + // C++17: + PRINT_MACRO(__cpp_hex_float); + PRINT_MACRO(__cpp_inline_variables); + PRINT_MACRO(__cpp_aligned_new); + PRINT_MACRO(__cpp_guaranteed_copy_elision); + PRINT_MACRO(__cpp_noexcept_function_type); + PRINT_MACRO(__cpp_fold_expressions); + PRINT_MACRO(__cpp_capture_star_this); + PRINT_MACRO(__cpp_constexpr); + PRINT_MACRO(__cpp_if_constexpr); + PRINT_MACRO(__cpp_range_based_for); + PRINT_MACRO(__cpp_static_assert); + PRINT_MACRO(__cpp_deduction_guides); + PRINT_MACRO(__cpp_nontype_template_parameter_auto); + PRINT_MACRO(__cpp_namespace_attributes); + PRINT_MACRO(__cpp_enumerator_attributes); + PRINT_MACRO(__cpp_inheriting_constructors); + PRINT_MACRO(__cpp_variadic_using); + PRINT_MACRO(__cpp_structured_bindings); + PRINT_MACRO(__cpp_aggregate_bases); + PRINT_MACRO(__cpp_nontype_template_args); + PRINT_MACRO(__cpp_template_template_args); + + // C++14: + PRINT_MACRO(__cpp_binary_literals); + PRINT_MACRO(__cpp_init_captures); + PRINT_MACRO(__cpp_generic_lambdas); + PRINT_MACRO(__cpp_sized_deallocation); + PRINT_MACRO(__cpp_decltype_auto); + PRINT_MACRO(__cpp_return_type_deduction); + PRINT_MACRO(__cpp_aggregate_nsdmi); + PRINT_MACRO(__cpp_variable_templates); + + // C++11: + PRINT_MACRO(__cpp_unicode_characters); + PRINT_MACRO(__cpp_raw_strings); + PRINT_MACRO(__cpp_unicode_literals); + PRINT_MACRO(__cpp_user_defined_literals); + PRINT_MACRO(__cpp_threadsafe_static_init); + PRINT_MACRO(__cpp_lambdas); + PRINT_MACRO(__cpp_decltype); + PRINT_MACRO(__cpp_attributes); + PRINT_MACRO(__cpp_rvalue_references); + PRINT_MACRO(__cpp_variadic_templates); + PRINT_MACRO(__cpp_initializer_lists); + PRINT_MACRO(__cpp_delegating_constructors); + PRINT_MACRO(__cpp_nsdmi); + PRINT_MACRO(__cpp_ref_qualifiers); + PRINT_MACRO(__cpp_alias_templates); + + // C++98: + PRINT_MACRO(__cpp_rtti); + PRINT_MACRO(__cpp_exceptions); +} + void print_separator() { std::cout << @@ -1176,6 +1295,8 @@ int main() print_platform_macros(); print_separator(); print_boost_macros(); + print_separator(); + print_sd6_macros(); return 0; } diff --git a/test/helper_macros_test.cpp b/test/helper_macros_test.cpp new file mode 100644 index 00000000..5bbea8dd --- /dev/null +++ b/test/helper_macros_test.cpp @@ -0,0 +1,30 @@ +// Copyright 2017 Peter Dimov. +// +// 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 + +int main() +{ +#define X pumpkin + + BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(X), "pumpkin" ); + BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(__LINE__), "16" ); + +#define Y 2 + + int BOOST_JOIN(X, Y) = 0; + (void)pumpkin2; + + int BOOST_JOIN(X, __LINE__) = 0; + (void)pumpkin23; + + BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(BOOST_JOIN(X, Y)), "pumpkin2" ); + BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(BOOST_JOIN(X, __LINE__)), "pumpkin27" ); + + return boost::report_errors(); +} diff --git a/test/pragma_message_test.cpp b/test/pragma_message_test.cpp new file mode 100644 index 00000000..9464897c --- /dev/null +++ b/test/pragma_message_test.cpp @@ -0,0 +1,18 @@ +// Copyright 2017 Peter Dimov. +// +// 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 + +BOOST_PRAGMA_MESSAGE("first message") + +#define MSG2 "second message" +BOOST_PRAGMA_MESSAGE(MSG2) + +#include // BOOST_STRINGIZE + +#define MSG3 third message +BOOST_PRAGMA_MESSAGE(BOOST_STRINGIZE(MSG3))