From 5879c6d0952d489a5587c82441ad59981eb419e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81oskot?= Date: Fri, 28 Feb 2020 18:51:27 +0100 Subject: [PATCH 1/5] Document BOOST_LIBSTDCXX_VERSION macro --- doc/macro_reference.qbk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index e37efac1..394d5d04 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -1406,6 +1406,11 @@ library in use. Mainly for debugging the configuration. Defined as a string describing the name of the platform. Mainly for debugging the configuration. ]] +[[`BOOST_LIBSTDCXX_VERSION`][``][ +Defined if the libstdc++ standard library is in use. +Has the value of normalised 5 digit integer of the form VVMMM where +VV is the major version number, MM is the minor version number. +]] ] [endsect] From 0173564c24d2665429e6f766cfe456df97def441 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 1 Mar 2020 12:53:47 +0300 Subject: [PATCH 2/5] Added tests for alignas involving constant expressions. Some compilers (e.g. gcc 4.8) are known to require a literal constant in alignas and not supporting a constant expression. The test was modified to detect that. --- test/boost_no_cxx11_alignas.ipp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/boost_no_cxx11_alignas.ipp b/test/boost_no_cxx11_alignas.ipp index afd428f6..53342215 100644 --- a/test/boost_no_cxx11_alignas.ipp +++ b/test/boost_no_cxx11_alignas.ipp @@ -1,4 +1,4 @@ -// (C) Copyright Andrey Semashev 2013 +// (C) Copyright Andrey Semashev 2013, 2020 // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file @@ -12,6 +12,12 @@ namespace boost_no_cxx11_alignas { +template< unsigned int Alignment > +struct alignment +{ + static const unsigned int value = Alignment; +}; + struct alignas(16) my_data1 { char data[10]; @@ -22,10 +28,17 @@ struct alignas(double) my_data2 char data[16]; }; +struct alignas(alignment< 16u >::value) my_data3 +{ + char data[16]; +}; + my_data1 dummy1[2]; my_data2 dummy2; -alignas(16) char dummy3[10]; -alignas(double) char dummy4[32]; +my_data3 dummy3; +alignas(16) char dummy4[10]; +alignas(double) char dummy5[32]; +alignas(alignment< 16u >::value) char dummy6[32]; int test() { From c3f81f3c7024ab5428859b8fa9cdf256c73c93ee Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 1 Mar 2020 12:59:03 +0300 Subject: [PATCH 3/5] Increase gcc version to 4.9 for alignas. gcc 4.8 is known to not support alignas with constant expressions. --- include/boost/config/compiler/gcc.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index 78f1ae39..d6fbda0e 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -254,7 +254,6 @@ // C++0x features in 4.8.n and later // #if (BOOST_GCC_VERSION < 40800) || !defined(BOOST_GCC_CXX11) -# define BOOST_NO_CXX11_ALIGNAS # define BOOST_NO_CXX11_THREAD_LOCAL # define BOOST_NO_CXX11_SFINAE_EXPR #endif @@ -267,6 +266,14 @@ # define BOOST_NO_CXX14_BINARY_LITERALS #endif +// C++0x features in 4.9.n and later +// +#if (BOOST_GCC_VERSION < 40900) || !defined(BOOST_GCC_CXX11) +// Although alignas support is added in gcc 4.8, it does not accept +// constant expressions as an argument until gcc 4.9. +# define BOOST_NO_CXX11_ALIGNAS +#endif + // C++0x features in 5.1 and later // #if (BOOST_GCC_VERSION < 50100) || !defined(BOOST_GCC_CXX11) From 0e3b487200ad86edfa6237ed73d930d159c090ba Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Fri, 6 Mar 2020 09:01:32 +0100 Subject: [PATCH 4/5] Support auto-linking for non-Boost libraries Check for `BOOST_AUTO_LINK_NOMANGLE` before any other layouts. This way, `BOOST_AUTO_LINK_NOMANGLE` can be defined temporarily to link to non-Boost libraries even if `BOOST_AUTO_LINK_TAGGED` or `BOOST_AUTO_LINK_SYSTEM` are defined. Boost.UUID does this: https://github.com/boostorg/uuid/blob/24e3e0db36adfae963c9fc523d0d1e3b1f171950/include/boost/uuid/detail/random_provider_bcrypt.ipp#L20 https://github.com/boostorg/uuid/blob/24e3e0db36adfae963c9fc523d0d1e3b1f171950/include/boost/uuid/detail/random_provider_wincrypt.ipp#L24 --- include/boost/config/auto_link.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/config/auto_link.hpp b/include/boost/config/auto_link.hpp index e74f3c10..480232e2 100644 --- a/include/boost/config/auto_link.hpp +++ b/include/boost/config/auto_link.hpp @@ -415,7 +415,12 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. && defined(BOOST_LIB_ARCH_AND_MODEL_OPT) \ && defined(BOOST_LIB_VERSION) -#ifdef BOOST_AUTO_LINK_TAGGED +#ifdef BOOST_AUTO_LINK_NOMANGLE +# pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") +# ifdef BOOST_LIB_DIAGNOSTIC +# pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") +# endif +#elif defined(BOOST_AUTO_LINK_TAGGED) # pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_ARCH_AND_MODEL_OPT ".lib") # ifdef BOOST_LIB_DIAGNOSTIC # pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_ARCH_AND_MODEL_OPT ".lib") @@ -425,11 +430,6 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. # ifdef BOOST_LIB_DIAGNOSTIC # pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") # endif -#elif defined(BOOST_AUTO_LINK_NOMANGLE) -# pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") -# ifdef BOOST_LIB_DIAGNOSTIC -# pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") -# endif #elif defined(BOOST_LIB_BUILDID) # pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_ARCH_AND_MODEL_OPT "-" BOOST_LIB_VERSION "-" BOOST_STRINGIZE(BOOST_LIB_BUILDID) ".lib") # ifdef BOOST_LIB_DIAGNOSTIC From d11a6ebe0914fbc630932043ee459e08921fd963 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 23 Mar 2020 21:07:52 +0000 Subject: [PATCH 5/5] Regenerate docs. [CI SKIP] --- .../boost_config/boost_macro_reference.html | 47 ++++++++++++++++++- .../guidelines_for_boost_authors.html | 6 +-- doc/html/index.html | 2 +- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index 6c0cf00d..bd57de21 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -3250,6 +3250,20 @@ + +

+ BOOST_NO_CXX11_UNRESTRICTED_UNION +

+ + +

+ The compiler does not support an unrestricted union. This is a + union that may contain static data as well as user-defined member + data with non-trivial special member functions. +

+ + +

BOOST_NO_CXX11_USER_DEFINED_LITERALS @@ -3977,7 +3991,8 @@

- + +

BOOST_INLINE_VARIABLE @@ -3991,7 +4006,35 @@ for further adjustments to the code.

- + + + +

+ BOOST_IF_CONSTEXPR +

+ + +

+ Expands to if constexpr + when supported, or if + otherwise. +

+ + + + +

+ BOOST_INLINE_CONSTEXPR +

+ + +

+ This is a shortcut for BOOST_INLINE_VARIABLE + BOOST_CONSTEXPR_OR_CONST. +

+ + +
diff --git a/doc/html/boost_config/guidelines_for_boost_authors.html b/doc/html/boost_config/guidelines_for_boost_authors.html index f57e583e..b61ee694 100644 --- a/doc/html/boost_config/guidelines_for_boost_authors.html +++ b/doc/html/boost_config/guidelines_for_boost_authors.html @@ -297,9 +297,9 @@ and name the test file "boost_has_foo.ipp". Try not to add feature test macros unnecessarily, if there is a platform specific macro that can already be used (for example _WIN32, - __BEOS__, or __linux) to identify the feature then use - that. Try to keep the macro to a feature group, or header name, rather than - one specific API (for example BOOST_HAS_NL_TYPES_H + __BEOS__, or __linux__) to identify the feature then + use that. Try to keep the macro to a feature group, or header name, rather + than one specific API (for example BOOST_HAS_NL_TYPES_H rather than BOOST_HAS_CATOPEN). If the macro describes a POSIX feature group, then add boilerplate code to <boost/config/detail/suffix.hpp> diff --git a/doc/html/index.html b/doc/html/index.html index 88c3b169..27d9289b 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -990,7 +990,7 @@
- +

Last revised: October 29, 2019 at 16:54:06 GMT

Last revised: March 23, 2020 at 21:06:56 GMT