From f020bec68a1c2eadd2f8c45aba0d00da6965637a Mon Sep 17 00:00:00 2001 From: Joel Falcou Date: Wed, 4 Nov 2015 16:48:16 +0100 Subject: [PATCH 01/10] Provide BOOST_RESTRICT and BOOST_NO_RESTRICT_REFERENCES --- doc/macro_reference.qbk | 18 ++++++++++++++++++ include/boost/config/suffix.hpp | 21 ++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index 0973c365..46164770 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -209,6 +209,9 @@ Pointers to members don't work when used as template parameters. The compiler misreads 8.5.1, treating classes as non-aggregate if they contain private or protected member functions. ]] +[[`BOOST_NO_RESTRICT_REFERENCES`][Compiler][ +Compiler-specific `restrict` keyword can not be applied to references. +]] [[`BOOST_NO_RTTI`][Compiler][ The compiler may (or may not) have the typeid operator, but RTTI on the dynamic type of an object is not supported. @@ -1136,6 +1139,21 @@ the arguments is itself a macro (see 16.3.1 in C++ standard). This is normally used to create a mangled name in combination with a predefined macro such a \_\_LINE__. ]] +[[`BOOST_RESTRICT`][ +This macro can be used in place of the compiler specific variant of the C99 `restrict` keyword to +notify the compiler that, for the lifetime of the qualified pointer variable, only it and its +derivative value will be used to gain access to the object it references. This limits the effect of +pointer aliasing and helps the optimizers in generating better code. However, i this condition is +violated, undefined behavior may occurs. + +Usage example: +`` + void perform_computation( float* BOOST_RESTRICT in, float* BOOST_RESTRICT out ) + { + *out = *in * 0.5f; + } +`` +]] [[`BOOST_FORCEINLINE`][ This macro can be used in place of the `inline` keyword to instruct the compiler that the function should always be inlined. diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index 17bf1020..0ffbb29e 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -583,6 +583,25 @@ namespace std{ using ::type_info; } # define BOOST_GPU_ENABLED # endif +// BOOST_RESTRICT ---------------------------------------------// +// Macro to use in place of 'restrict' keyword variants +#if !defined(BOOST_RESTRICT) +# if defined(_MSC_VER) +# define BOOST_RESTRICT __restrict +# if !defined(BOOST_NO_RESTRICT_REFERENCES) +# define BOOST_NO_RESTRICT_REFERENCES +# endif +# elif defined(__GNUC__) && __GNUC__ > 3 + // Clang also defines __GNUC__ (as 4) +# define BOOST_RESTRICT __restrict__ +# else +# define BOOST_RESTRICT +# if !defined(BOOST_NO_RESTRICT_REFERENCES) +# define BOOST_NO_RESTRICT_REFERENCES +# endif +# endif +#endif + // BOOST_FORCEINLINE ---------------------------------------------// // Macro to use in place of 'inline' to force a function to be inline #if !defined(BOOST_FORCEINLINE) @@ -604,7 +623,7 @@ namespace std{ using ::type_info; } # elif defined(__GNUC__) && __GNUC__ > 3 // Clang also defines __GNUC__ (as 4) # if defined(__CUDACC__) - // nvcc doesn't always parse __noinline__, + // nvcc doesn't always parse __noinline__, // see: https://svn.boost.org/trac/boost/ticket/9392 # define BOOST_NOINLINE __attribute__ ((noinline)) # else From ded49a9d3229897731acf676c559693692416cb6 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Tue, 27 Dec 2016 20:38:05 +0400 Subject: [PATCH 02/10] Move BOOST_NO_CXX14_CONSTEXPR to the right section - Define BOOST_NO_CXX14_CONSTEXPR only for the gcc-compatible version of Intel compiler (other versions untested). The previous definition was not in the correct preprocessor branch and the macro was not defined when it should have been. - Increased the latest tested Intel compiler version to 17. - Added comments to the preprocessor directives to simplify navigation in the file. --- include/boost/config/compiler/intel.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/boost/config/compiler/intel.hpp b/include/boost/config/compiler/intel.hpp index 1885ea28..bf3f7d49 100644 --- a/include/boost/config/compiler/intel.hpp +++ b/include/boost/config/compiler/intel.hpp @@ -39,15 +39,20 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif -#else +#else // defined(_MSC_VER) #include #undef BOOST_GCC_VERSION #undef BOOST_GCC_CXX11 +// Broken in all versions up to 17 (newer versions not tested) +#if (__INTEL_COMPILER <= 1700) && !defined(BOOST_NO_CXX14_CONSTEXPR) +# define BOOST_NO_CXX14_CONSTEXPR #endif +#endif // defined(_MSC_VER) + #undef BOOST_COMPILER #if defined(__INTEL_COMPILER) @@ -92,7 +97,7 @@ # define BOOST_INTEL_LINUX BOOST_INTEL #endif -#else +#else // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) && (defined(_MSC_VER) || defined(__GNUC__)) #include @@ -483,7 +488,7 @@ template<> struct assert_intrinsic_wchar_t {}; # undef BOOST_NO_CXX11_FINAL #endif -#endif +#endif // defined(BOOST_INTEL_STDCXX0X) // // Broken in all versions up to 15: @@ -500,11 +505,6 @@ template<> struct assert_intrinsic_wchar_t {}; # define BOOST_NO_CXX11_HDR_TUPLE #endif -// Broken in all versions up to 17: -#if !defined(BOOST_NO_CXX14_CONSTEXPR) -#define BOOST_NO_CXX14_CONSTEXPR -#endif - #if (BOOST_INTEL_CXX_VERSION < 1200) // // fenv.h appears not to work with Intel prior to 12.0: @@ -535,10 +535,10 @@ template<> struct assert_intrinsic_wchar_t {}; # define BOOST_HAS_INT128 #endif -#endif +#endif // defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1500) && (defined(_MSC_VER) || defined(__GNUC__)) // // last known and checked version: -#if (BOOST_INTEL_CXX_VERSION > 1500) +#if (BOOST_INTEL_CXX_VERSION > 1700) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # elif defined(_MSC_VER) From ab0fa3b3d72d67c4589bca554525057189cf08ae Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 27 Dec 2016 19:34:05 +0000 Subject: [PATCH 03/10] Fix to get config_test passing with /clr or /clr pure and msvc. See https://svn.boost.org/trac/boost/ticket/12713. Note that /clr safe is still not supported - so much doesn't work it's hard to call it a C++ compiler in that case. --- include/boost/config/compiler/visualc.hpp | 20 +++++++++++++++ include/boost/config/stdlib/dinkumware.hpp | 30 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index cdbc9b67..78c50e51 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -218,6 +218,26 @@ // #define BOOST_NO_TWO_PHASE_NAME_LOOKUP +// +// Things that don't work in clr mode: +// +#ifdef _M_CEE +#ifndef BOOST_NO_CXX11_THREAD_LOCAL +# define BOOST_NO_CXX11_THREAD_LOCAL +#endif +#ifndef BOOST_NO_SFINAE_EXPR +# define BOOST_NO_SFINAE_EXPR +#endif +#ifndef BOOST_NO_CXX11_REF_QUALIFIERS +# define BOOST_NO_CXX11_REF_QUALIFIERS +#endif +#endif +#ifdef _M_CEE_PURE +#ifndef BOOST_NO_CXX11_CONSTEXPR +# define BOOST_NO_CXX11_CONSTEXPR +#endif +#endif + // // prefix and suffix headers: // diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index 8cf5d4dd..3b95dcf3 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -196,6 +196,36 @@ # endif #endif + +// +// Things not supported by the CLR: +#ifdef _M_CEE +#ifndef BOOST_NO_CXX11_HDR_MUTEX +# define BOOST_NO_CXX11_HDR_MUTEX +#endif +#ifndef BOOST_NO_CXX11_HDR_ATOMIC +# define BOOST_NO_CXX11_HDR_ATOMIC +#endif +#ifndef BOOST_NO_CXX11_HDR_FUTURE +# define BOOST_NO_CXX11_HDR_FUTURE +#endif +#ifndef BOOST_NO_CXX11_HDR_CONDITION_VARIABLE +# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE +#endif +#ifndef BOOST_NO_CXX11_HDR_THREAD +# define BOOST_NO_CXX11_HDR_THREAD +#endif +#ifndef BOOST_NO_CXX14_HDR_SHARED_MUTEX +# define BOOST_NO_CXX14_HDR_SHARED_MUTEX +#endif +#ifndef BOOST_NO_CXX14_STD_EXCHANGE +# define BOOST_NO_CXX14_STD_EXCHANGE +#endif +#ifndef BOOST_NO_FENV_H +# define BOOST_NO_FENV_H +#endif +#endif + #ifdef _CPPLIB_VER # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER #else From b49f6583321a930b91649fc14a87fed46ca24bbc Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 27 Dec 2016 18:10:58 -0800 Subject: [PATCH 04/10] Update version.hpp to 1.64 --- include/boost/version.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/version.hpp b/include/boost/version.hpp index 94c16c31..03b33f9a 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 106300 +#define BOOST_VERSION 106400 // // 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_63" +#define BOOST_LIB_VERSION "1_64" #endif From de5f166253bd6d671ebdd3f5b7ce1c79471c0789 Mon Sep 17 00:00:00 2001 From: O01eg Date: Thu, 5 Jan 2017 21:18:31 +0300 Subject: [PATCH 05/10] Use corrent name for libraries built with MS VS 2017 RC. --- include/boost/config/auto_link.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/boost/config/auto_link.hpp b/include/boost/config/auto_link.hpp index 56a16b0b..d4f3eabf 100644 --- a/include/boost/config/auto_link.hpp +++ b/include/boost/config/auto_link.hpp @@ -161,10 +161,15 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. // vc12: # define BOOST_LIB_TOOLSET "vc120" +# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1910) + + // vc14: +# define BOOST_LIB_TOOLSET "vc140" + # elif defined(BOOST_MSVC) - // vc14: -# define BOOST_LIB_TOOLSET "vc140" + // vc15: +# define BOOST_LIB_TOOLSET "vc150" # elif defined(__BORLANDC__) From e21b1729cb4fbc831ee15c09c1795735bf798045 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 17 Jan 2017 23:21:37 +0000 Subject: [PATCH 06/10] Fix name of the library --- include/boost/config/stdlib/libstdcpp3.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index 557767b1..205489a9 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -101,8 +101,8 @@ // // Decide which version of libstdc++ we have, normally -// stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly -// __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++ +// libstdc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly +// __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the libstdc++ // developers. He also commented: // // "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in @@ -110,7 +110,7 @@ // Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support // than any release in the 4.2 series." // -// Another resource for understanding stdlibc++ features is: +// Another resource for understanding libstdc++ features is: // http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x // // However, using the GCC version number fails when the compiler is clang since this @@ -222,7 +222,7 @@ // #if (BOOST_LIBSTDCXX_VERSION < 40700) || !defined(BOOST_LIBSTDCXX11) // Note that although existed prior to 4.7, "steady_clock" is spelled "monotonic_clock" -// so 4.7.0 is the first truely conforming one. +// so 4.7.0 is the first truly conforming one. # define BOOST_NO_CXX11_HDR_CHRONO # define BOOST_NO_CXX11_ALLOCATOR #endif From c85095cf3307e902335fd34cfc55643e4737aad1 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Thu, 2 Feb 2017 13:46:39 -0500 Subject: [PATCH 07/10] Support BOOST_GCC guards in BOOST_WORKAROUND --- include/boost/detail/workaround.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/detail/workaround.hpp b/include/boost/detail/workaround.hpp index 40b3423b..7727aaf1 100644 --- a/include/boost/detail/workaround.hpp +++ b/include/boost/detail/workaround.hpp @@ -85,6 +85,11 @@ #else #define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 0 #endif +#ifndef BOOST_GCC +#define BOOST_GCC_WORKAROUND_GUARD 1 +#else +#define BOOST_GCC_WORKAROUND_GUARD 0 +#endif #ifndef __IBMCPP__ #define __IBMCPP___WORKAROUND_GUARD 1 #else From 2c34894d488535fb299462eb7d30e48d47015d7f Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 5 Feb 2017 18:02:11 +0000 Subject: [PATCH 08/10] Merge branch 'restrict_support' of https://github.com/jfalcou/config into restrict_keyword # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit. --- doc/macro_reference.qbk | 18 ++++++++++++++++++ include/boost/config/suffix.hpp | 21 ++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index b1d30e4a..d745bfa2 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -209,6 +209,9 @@ Pointers to members don't work when used as template parameters. The compiler misreads 8.5.1, treating classes as non-aggregate if they contain private or protected member functions. ]] +[[`BOOST_NO_RESTRICT_REFERENCES`][Compiler][ +Compiler-specific `restrict` keyword can not be applied to references. +]] [[`BOOST_NO_RTTI`][Compiler][ The compiler may (or may not) have the typeid operator, but RTTI on the dynamic type of an object is not supported. @@ -1150,6 +1153,21 @@ the arguments is itself a macro (see 16.3.1 in C++ standard). This is normally used to create a mangled name in combination with a predefined macro such a \_\_LINE__. ]] +[[`BOOST_RESTRICT`][ +This macro can be used in place of the compiler specific variant of the C99 `restrict` keyword to +notify the compiler that, for the lifetime of the qualified pointer variable, only it and its +derivative value will be used to gain access to the object it references. This limits the effect of +pointer aliasing and helps the optimizers in generating better code. However, i this condition is +violated, undefined behavior may occurs. + +Usage example: +`` + void perform_computation( float* BOOST_RESTRICT in, float* BOOST_RESTRICT out ) + { + *out = *in * 0.5f; + } +`` +]] [[`BOOST_FORCEINLINE`][ This macro can be used in place of the `inline` keyword to instruct the compiler that the function should always be inlined. diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index eeaec2bf..13068e3d 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -583,6 +583,25 @@ namespace std{ using ::type_info; } # define BOOST_GPU_ENABLED # endif +// BOOST_RESTRICT ---------------------------------------------// +// Macro to use in place of 'restrict' keyword variants +#if !defined(BOOST_RESTRICT) +# if defined(_MSC_VER) +# define BOOST_RESTRICT __restrict +# if !defined(BOOST_NO_RESTRICT_REFERENCES) +# define BOOST_NO_RESTRICT_REFERENCES +# endif +# elif defined(__GNUC__) && __GNUC__ > 3 + // Clang also defines __GNUC__ (as 4) +# define BOOST_RESTRICT __restrict__ +# else +# define BOOST_RESTRICT +# if !defined(BOOST_NO_RESTRICT_REFERENCES) +# define BOOST_NO_RESTRICT_REFERENCES +# endif +# endif +#endif + // BOOST_FORCEINLINE ---------------------------------------------// // Macro to use in place of 'inline' to force a function to be inline #if !defined(BOOST_FORCEINLINE) @@ -604,7 +623,7 @@ namespace std{ using ::type_info; } # elif defined(__GNUC__) && __GNUC__ > 3 // Clang also defines __GNUC__ (as 4) # if defined(__CUDACC__) - // nvcc doesn't always parse __noinline__, + // nvcc doesn't always parse __noinline__, // see: https://svn.boost.org/trac/boost/ticket/9392 # define BOOST_NOINLINE __attribute__ ((noinline)) # else From 438520d1fdcab93b813a32e3b5d1fb406e3d28e9 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 5 Feb 2017 19:00:45 +0000 Subject: [PATCH 09/10] Cygwin appears not to have sigaction all the time after all. --- include/boost/config/platform/cygwin.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/boost/config/platform/cygwin.hpp b/include/boost/config/platform/cygwin.hpp index b7ef572f..53e23f7f 100644 --- a/include/boost/config/platform/cygwin.hpp +++ b/include/boost/config/platform/cygwin.hpp @@ -23,7 +23,7 @@ # define BOOST_HAS_SCHED_YIELD # define BOOST_HAS_GETTIMEOFDAY # define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE -# define BOOST_HAS_SIGACTION +//# define BOOST_HAS_SIGACTION #else # if !defined(BOOST_HAS_WINTHREADS) # define BOOST_HAS_WINTHREADS @@ -51,7 +51,6 @@ #ifdef BOOST_HAS_NL_TYPES_H # undef BOOST_HAS_NL_TYPES_H #endif - From fb87ea1cbe0bb03d8bb55f050c7915b96bf872fb Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 5 Feb 2017 19:01:24 +0000 Subject: [PATCH 10/10] Regenerate docs. --- .../boost_config/boost_macro_reference.html | 89 +++++++++++++++++++ doc/html/index.html | 4 +- 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index 691a11c5..c4eda791 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -41,6 +41,8 @@ that describe C++14 features not supported
Macros that allow use of C++14 features with C++11 or earlier compilers
+
Macros + that describe C++17 features not supported
Boost Helper Macros
Boost @@ -813,6 +815,24 @@ + +

+ BOOST_NO_RESTRICT_REFERENCES +

+ + +

+ Compiler +

+ + +

+ Compiler-specific restrict + keyword can not be applied to references. +

+ + +

BOOST_NO_RTTI @@ -3715,6 +3735,46 @@

+

+ The following macros describe features in the 2016 ISO C++ standard, formerly + known as C++1z, that are not yet supported by a particular compiler or library. +

+
++++ + + + + + + + + +
+

+ Macro +

+
+

+ Description +

+
+

+ BOOST_NO_CXX17_STD_INVOKE +

+
+

+ The compiler does not support std::invoke(). +

+
+
+
+ @@ -4121,6 +4181,35 @@ + +

+ BOOST_RESTRICT +

+ + +

+ This macro can be used in place of the compiler specific variant + of the C99 restrict + keyword to notify the compiler that, for the lifetime of the qualified + pointer variable, only it and its derivative value will be used + to gain access to the object it references. This limits the effect + of pointer aliasing and helps the optimizers in generating better + code. However, i this condition is violated, undefined behavior + may occurs. +

+

+ Usage example: +

+
void perform_computation( float* BOOST_RESTRICT in, float* BOOST_RESTRICT out )
+{
+  *out = *in * 0.5f;
+}
+
+

+

+ + +

BOOST_FORCEINLINE diff --git a/doc/html/index.html b/doc/html/index.html index 5ff77786..5c633285 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -72,6 +72,8 @@ that describe C++14 features not supported

Macros that allow use of C++14 features with C++11 or earlier compilers
+
Macros + that describe C++17 features not supported
Boost Helper Macros
Boost @@ -988,7 +990,7 @@ - +

Last revised: July 02, 2016 at 08:07:27 GMT

Last revised: February 05, 2017 at 19:01:00 GMT