From 1a1d2f17ebb4f92b508d9acce4cf20ff5947cad5 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Mon, 28 Oct 2013 10:06:20 +0000 Subject: [PATCH 01/24] config: clang - detect support for int128 [SVN r86497] --- include/boost/config/compiler/clang.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index b57e26c5..64304bf6 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -39,6 +39,11 @@ // Clang supports "long long" in all compilation modes. #define BOOST_HAS_LONG_LONG +#if defined(__SIZEOF_INT128__) +# define BOOST_HAS_INT128 +#endif + + // // Dynamic shared object (DSO) and dynamic-link library (DLL) support // From deedcb848f434ee2964ca96694c7132fb3ee1061 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 13 Nov 2013 12:23:33 +0000 Subject: [PATCH 02/24] Clang using VC++ RTL currently does not support char16_t or char32_t [SVN r86675] --- include/boost/config/compiler/clang.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 64304bf6..c030ad71 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -68,7 +68,10 @@ # define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS #endif -#if !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) +// +// Currently clang on Windows using VC++ RTL does not support C++11's char16_t or char32_t +// +#if defined(_MSC_VER) || !(defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) # define BOOST_NO_CXX11_CHAR16_T # define BOOST_NO_CXX11_CHAR32_T #endif From 105b70ae25db54a2e8f48d17b0b74faad0a51836 Mon Sep 17 00:00:00 2001 From: Richard Dale Date: Fri, 6 Dec 2013 12:24:34 -0600 Subject: [PATCH 03/24] Suppress auto declarations for current Cray C++ --- include/boost/config/compiler/cray.hpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/boost/config/compiler/cray.hpp b/include/boost/config/compiler/cray.hpp index 3ce29f01..c2adff69 100644 --- a/include/boost/config/compiler/cray.hpp +++ b/include/boost/config/compiler/cray.hpp @@ -1,4 +1,5 @@ // (C) Copyright John Maddock 2011. +// (C) Copyright Cray, Inc. 2013 // 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) @@ -9,8 +10,8 @@ #define BOOST_COMPILER "Cray C version " BOOST_STRINGIZE(_RELEASE) -#if _RELEASE < 7 -# error "Boost is not configured for Cray compilers prior to version 7, please try the configure script." +#if _RELEASE < 8 +# error "Boost is not configured for Cray compilers prior to version 8, please try the configure script." #endif // @@ -22,11 +23,12 @@ #include "boost/config/compiler/common_edg.hpp" + // // Cray peculiarities, probably version 7 specific: // -#undef BOOST_NO_CXX11_AUTO_DECLARATIONS -#undef BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS +#define BOOST_NO_CXX11_AUTO_DECLARATIONS +#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS #define BOOST_HAS_NRVO #define BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX @@ -55,11 +57,11 @@ #define BOOST_NO_COMPLETE_VALUE_INITIALIZATION #define BOOST_NO_CXX11_CHAR32_T #define BOOST_NO_CXX11_CHAR16_T -#define BOOST_NO_CXX11_ALIGNAS //#define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG #define BOOST_MATH_DISABLE_STD_FPCLASSIFY //#define BOOST_HAS_FPCLASSIFY -#define BOOST_SP_USE_PTHREADS -#define BOOST_AC_USE_PTHREADS +#define BOOST_SP_USE_PTHREADS +#define BOOST_AC_USE_PTHREADS + From c4e0b79c9d9c1e660d66808b09a59d57729a517d Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 8 Dec 2013 12:53:57 +0000 Subject: [PATCH 04/24] Fix typo from https://github.com/boostorg/config/pull/2 --- include/boost/config/compiler/visualc.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 695fa943..cdb22362 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -120,7 +120,7 @@ # define BOOST_HAS_NRVO #endif // -// disable Win32 API's if compiler extentions are +// disable Win32 API's if compiler extensions are // turned off: // #if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32) From 9a1d43cbfcb76c2a36c9205f479a80cad69c6802 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 10 Dec 2013 18:21:37 +0000 Subject: [PATCH 05/24] Apply patch from https://github.com/ahmedcharles/config/commit/62c63fc58ff17d49b2a2373e98201046f239ebd0 --- include/boost/config/compiler/visualc.hpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index cdb22362..1fc41d1c 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -57,11 +57,6 @@ # define BOOST_NO_CXX11_VARIADIC_MACROS #endif -#if defined(UNDER_CE) -// Windows CE does not have a conforming signature for swprintf -# define BOOST_NO_SWPRINTF -#endif - #if _MSC_VER < 1500 // 140X == VC++ 8.0 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS #endif @@ -92,6 +87,7 @@ #endif #if defined(_WIN32_WCE) || defined(UNDER_CE) +// Windows CE does not have a conforming signature for swprintf # define BOOST_NO_SWPRINTF #endif From ceafb39c24ab2caebb60200204be9dc2bfabd6d4 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 11 Dec 2013 18:53:21 -0500 Subject: [PATCH 06/24] For VC++ and clang-cl if _HAS_EXCEPTIONS is 0, then the header must be manually included before the header to avoid compiler errors. --- include/boost/config/stdlib/dinkumware.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index a8b68be7..e2a01d91 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -86,9 +86,18 @@ # define BOOST_NO_STD_LOCALE #endif +// Fix for VC++ 8.0 on up ( I do not have a previous vesion to test ) +// or clang-cl. If exceptions are off you must manually include the +// header before including the header. Admittedly +// trying to use Boost libraries or the standard C++ libraries without +// exception support is not suggested but currently clang-cl ( v 3.4 ) +// does not support exceptions and must be compiled with exceptions off. +#if !_HAS_EXCEPTIONS && ((defined(BOOST_MSVC) && BOOST_MSVC >= 1400) || (defined(__clang__) && defined(_MSC_VER))) +#include +#endif #include #if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) && !defined(__TI_COMPILER_VERSION__) -# define BOOST_NO_STD_TYPEINFO +# define BOOST_NO_STD_TYPEINFO #endif // C++0x headers implemented in 520 (as shipped by Microsoft) @@ -146,12 +155,3 @@ #else # define BOOST_STDLIB "Dinkumware standard library version 1.x" #endif - - - - - - - - - From 30f4ab53e5623fcf1c0ede8d2d9536c42a5d6c8f Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 12 Dec 2013 19:32:06 +0000 Subject: [PATCH 07/24] Fix typo in macro name - should be BOOST_NO_ATOMIC_SMART_PTR. Add BOOST_NO_CXX11_HRD_ATOMIC. Regenerate docs. See https://svn.boost.org/trac/boost/ticket/8929. --- .../boost_config/boost_macro_reference.html | 14 ++- doc/html/index.html | 2 +- doc/macro_reference.qbk | 3 +- include/boost/config/stdlib/dinkumware.hpp | 4 + include/boost/config/stdlib/libcomo.hpp | 1 + include/boost/config/stdlib/libcpp.hpp | 1 + include/boost/config/stdlib/libstdcpp3.hpp | 1 + include/boost/config/stdlib/modena.hpp | 1 + include/boost/config/stdlib/msl.hpp | 1 + include/boost/config/stdlib/roguewave.hpp | 1 + include/boost/config/stdlib/sgi.hpp | 1 + include/boost/config/stdlib/stlport.hpp | 1 + include/boost/config/stdlib/vacpp.hpp | 1 + test/all/Jamfile.v2 | 15 ++-- test/boost_no_cxx11_hdr_atomic.ipp | 89 +++++++++++++++++++ test/config_info.cpp | 3 + test/config_test.cpp | 22 +++-- test/no_cxx11_hdr_atomic_fail.cpp | 37 ++++++++ test/no_cxx11_hdr_atomic_pass.cpp | 37 ++++++++ 19 files changed, 220 insertions(+), 15 deletions(-) create mode 100644 test/boost_no_cxx11_hdr_atomic.ipp create mode 100644 test/no_cxx11_hdr_atomic_fail.cpp create mode 100644 test/no_cxx11_hdr_atomic_pass.cpp diff --git a/doc/html/boost_config/boost_macro_reference.html b/doc/html/boost_config/boost_macro_reference.html index cd60c7f7..21c225ee 100644 --- a/doc/html/boost_config/boost_macro_reference.html +++ b/doc/html/boost_config/boost_macro_reference.html @@ -2404,7 +2404,7 @@

- BOOST_NO_CXX11_ATOMIC_SP + BOOST_NO_CXX11_ATOMIC_SMART_PTR

@@ -2415,6 +2415,18 @@ + +

+ BOOST_NO_CXX11_HDR_ATOMIC +

+ + +

+ The standard library does not provide header <atomic>. +

+ + +

BOOST_NO_CXX11_HDR_ARRAY diff --git a/doc/html/index.html b/doc/html/index.html index 273c21cf..cf18f912 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -951,7 +951,7 @@ - +

Last revised: September 08, 2013 at 08:51:17 GMT

Last revised: December 12, 2013 at 19:29:48 GMT


diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index 40123e63..f223e8bd 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -580,7 +580,8 @@ that are not yet supported by a particular compiler or library. [[`BOOST_NO_CXX11_ALIGNAS`][The compiler does not support the `alignas` keyword.]] [[`BOOST_NO_CXX11_ALLOCATOR`][The standard library does not provide a C++11 version of `std::allocator` in .]] -[[`BOOST_NO_CXX11_ATOMIC_SP`][The standard library does not support atomic smart pointer operations.]] +[[`BOOST_NO_CXX11_ATOMIC_SMART_PTR`][The standard library does not support atomic smart pointer operations.]] +[[`BOOST_NO_CXX11_HDR_ATOMIC`][The standard library does not provide header .]] [[`BOOST_NO_CXX11_HDR_ARRAY`][The standard library does not provide header .]] [[`BOOST_NO_CXX11_HDR_CHRONO`][The standard library does not provide header .]] [[`BOOST_NO_CXX11_HDR_CODECVT`][The standard library does not provide header .]] diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index a8b68be7..86e46718 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -135,6 +135,10 @@ # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST #endif +// Not present in any version: +// +#define BOOST_NO_CXX11_HDR_ATOMIC + #ifdef _CPPLIB_VER # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER #else diff --git a/include/boost/config/stdlib/libcomo.hpp b/include/boost/config/stdlib/libcomo.hpp index 29490f1b..d02e9e07 100644 --- a/include/boost/config/stdlib/libcomo.hpp +++ b/include/boost/config/stdlib/libcomo.hpp @@ -58,6 +58,7 @@ # define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_SMART_PTR # define BOOST_NO_CXX11_HDR_FUNCTIONAL +# define BOOST_NO_CXX11_HDR_ATOMIC // // Intrinsic type_traits support. diff --git a/include/boost/config/stdlib/libcpp.hpp b/include/boost/config/stdlib/libcpp.hpp index 3d574407..761017f2 100644 --- a/include/boost/config/stdlib/libcpp.hpp +++ b/include/boost/config/stdlib/libcpp.hpp @@ -30,6 +30,7 @@ # define BOOST_NO_CXX11_HDR_FUTURE # define BOOST_NO_CXX11_HDR_TYPE_TRAITS # define BOOST_NO_CXX11_ATOMIC_SMART_PTR +# define BOOST_NO_CXX11_HDR_ATOMIC // libc++ uses a non-standard messages_base #define BOOST_NO_STD_MESSAGES diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index 976ab76b..496e8d1b 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -155,6 +155,7 @@ // so 4.7.0 is the first truely conforming one. # define BOOST_NO_CXX11_HDR_CHRONO # define BOOST_NO_CXX11_ALLOCATOR +# define BOOST_NO_CXX11_HDR_ATOMIC #endif // C++0x headers not yet (fully!) implemented // diff --git a/include/boost/config/stdlib/modena.hpp b/include/boost/config/stdlib/modena.hpp index b483b6e0..956bffce 100644 --- a/include/boost/config/stdlib/modena.hpp +++ b/include/boost/config/stdlib/modena.hpp @@ -47,6 +47,7 @@ # define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_SMART_PTR # define BOOST_NO_CXX11_HDR_FUNCTIONAL +# define BOOST_NO_CXX11_HDR_ATOMIC #define BOOST_STDLIB "Modena C++ standard library" diff --git a/include/boost/config/stdlib/msl.hpp b/include/boost/config/stdlib/msl.hpp index 4f9a2da6..05e2582d 100644 --- a/include/boost/config/stdlib/msl.hpp +++ b/include/boost/config/stdlib/msl.hpp @@ -71,6 +71,7 @@ # define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_SMART_PTR # define BOOST_NO_CXX11_HDR_FUNCTIONAL +# define BOOST_NO_CXX11_HDR_ATOMIC #define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__) diff --git a/include/boost/config/stdlib/roguewave.hpp b/include/boost/config/stdlib/roguewave.hpp index cb80f570..72823d5d 100644 --- a/include/boost/config/stdlib/roguewave.hpp +++ b/include/boost/config/stdlib/roguewave.hpp @@ -183,4 +183,5 @@ # define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_SMART_PTR # define BOOST_NO_CXX11_HDR_FUNCTIONAL +# define BOOST_NO_CXX11_HDR_ATOMIC diff --git a/include/boost/config/stdlib/sgi.hpp b/include/boost/config/stdlib/sgi.hpp index ae9b6ad9..ed7ea613 100644 --- a/include/boost/config/stdlib/sgi.hpp +++ b/include/boost/config/stdlib/sgi.hpp @@ -141,6 +141,7 @@ # define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_SMART_PTR # define BOOST_NO_CXX11_HDR_FUNCTIONAL +# define BOOST_NO_CXX11_HDR_ATOMIC #define BOOST_STDLIB "SGI standard library" diff --git a/include/boost/config/stdlib/stlport.hpp b/include/boost/config/stdlib/stlport.hpp index bcc30b99..1b7beeb9 100644 --- a/include/boost/config/stdlib/stlport.hpp +++ b/include/boost/config/stdlib/stlport.hpp @@ -231,6 +231,7 @@ namespace boost { using std::min; using std::max; } # define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_SMART_PTR # define BOOST_NO_CXX11_HDR_FUNCTIONAL +# define BOOST_NO_CXX11_HDR_ATOMIC #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT) diff --git a/include/boost/config/stdlib/vacpp.hpp b/include/boost/config/stdlib/vacpp.hpp index 9d169465..08268249 100644 --- a/include/boost/config/stdlib/vacpp.hpp +++ b/include/boost/config/stdlib/vacpp.hpp @@ -47,6 +47,7 @@ # define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_SMART_PTR # define BOOST_NO_CXX11_HDR_FUNCTIONAL +# define BOOST_NO_CXX11_HDR_ATOMIC #define BOOST_STDLIB "Visual Age default standard library" diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index 262d79db..ba09a333 100644 --- a/test/all/Jamfile.v2 +++ b/test/all/Jamfile.v2 @@ -1,7 +1,7 @@ # # Regression test Jamfile for boost configuration setup. # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Sun Apr 28 18:36:49 2013 +# This file was automatically generated on Thu Dec 12 19:09:40 2013 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -226,9 +226,6 @@ test-suite "BOOST_NO_CWCHAR" : test-suite "BOOST_NO_CWCTYPE" : [ run ../no_cwctype_pass.cpp ] [ compile-fail ../no_cwctype_fail.cpp ] ; -test-suite "BOOST_NO_CXX11_RAW_LITERALS" : -[ run ../no_raw_literals_pass.cpp ] -[ compile-fail ../no_raw_literals_fail.cpp ] ; test-suite "BOOST_NO_CXX11_ALIGNAS" : [ run ../no_cxx11_alignas_pass.cpp ] [ compile-fail ../no_cxx11_alignas_fail.cpp ] ; @@ -241,6 +238,9 @@ test-suite "BOOST_NO_CXX11_ATOMIC_SMART_PTR" : test-suite "BOOST_NO_CXX11_HDR_ARRAY" : [ run ../no_cxx11_hdr_array_pass.cpp ] [ compile-fail ../no_cxx11_hdr_array_fail.cpp ] ; +test-suite "BOOST_NO_CXX11_HDR_ATOMIC" : +[ run ../no_cxx11_hdr_atomic_pass.cpp ] +[ compile-fail ../no_cxx11_hdr_atomic_fail.cpp ] ; test-suite "BOOST_NO_CXX11_HDR_CHRONO" : [ run ../no_cxx11_hdr_chrono_pass.cpp ] [ compile-fail ../no_cxx11_hdr_chrono_fail.cpp ] ; @@ -292,7 +292,7 @@ test-suite "BOOST_NO_CXX11_HDR_UNORDERED_MAP" : test-suite "BOOST_NO_CXX11_HDR_UNORDERED_SET" : [ run ../no_cxx11_hdr_unordered_set_pass.cpp ] [ compile-fail ../no_cxx11_hdr_unordered_set_fail.cpp ] ; -test-suite "BOOST_NO_CXX11_INLINE_NAMESPACES" : +test-suite "BOOST_NO_CXX11_INLINE_NAMESPACES" : [ run ../no_cxx11_inline_namespaces_pass.cpp ] [ compile-fail ../no_cxx11_inline_namespaces_fail.cpp ] ; test-suite "BOOST_NO_CXX11_NUMERIC_LIMITS" : @@ -301,7 +301,7 @@ test-suite "BOOST_NO_CXX11_NUMERIC_LIMITS" : test-suite "BOOST_NO_CXX11_SMART_PTR" : [ run ../no_cxx11_smart_ptr_pass.cpp ] [ compile-fail ../no_cxx11_smart_ptr_fail.cpp ] ; -test-suite "BOOST_NO_CXX11_TRAILING_RESULT_TYPES" : +test-suite "BOOST_NO_CXX11_TRAILING_RESULT_TYPES" : [ run ../no_cxx11_trailing_result_types_pass.cpp ] [ compile-fail ../no_cxx11_trailing_result_types_fail.cpp ] ; test-suite "BOOST_NO_CXX11_USER_DEFINED_LITERALS" : @@ -436,6 +436,9 @@ test-suite "BOOST_NO_POINTER_TO_MEMBER_CONST" : test-suite "BOOST_NO_CXX11_RANGE_BASED_FOR" : [ run ../no_range_based_for_pass.cpp ] [ compile-fail ../no_range_based_for_fail.cpp ] ; +test-suite "BOOST_NO_CXX11_RAW_LITERALS" : +[ run ../no_raw_literals_pass.cpp ] +[ compile-fail ../no_raw_literals_fail.cpp ] ; test-suite "BOOST_NO_UNREACHABLE_RETURN_DETECTION" : [ run ../no_ret_det_pass.cpp ] [ compile-fail ../no_ret_det_fail.cpp ] ; diff --git a/test/boost_no_cxx11_hdr_atomic.ipp b/test/boost_no_cxx11_hdr_atomic.ipp new file mode 100644 index 00000000..7378e8cb --- /dev/null +++ b/test/boost_no_cxx11_hdr_atomic.ipp @@ -0,0 +1,89 @@ +// (C) Copyright John Maddock 2013 + +// 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/libs/config for more information. + +// MACRO: BOOST_NO_CXX11_HDR_ATOMIC +// TITLE: C++11 header is either not present or too broken to be used +// DESCRIPTION: The compiler does not support the C++11 header + +#include + +#if !defined(ATOMIC_BOOL_LOCK_FREE) || !defined(ATOMIC_CHAR_LOCK_FREE) || !defined(ATOMIC_CHAR16_T_LOCK_FREE) \ + || !defined(ATOMIC_CHAR32_T_LOCK_FREE) || !defined(ATOMIC_WCHAR_T_LOCK_FREE) || !defined(ATOMIC_SHORT_LOCK_FREE)\ + || !defined(ATOMIC_INT_LOCK_FREE) || !defined(ATOMIC_LONG_LOCK_FREE) || !defined(ATOMIC_LLONG_LOCK_FREE)\ + || !defined(ATOMIC_POINTER_LOCK_FREE) +# error "required macros not defined" +#endif + +namespace boost_no_cxx11_hdr_atomic { + +int test() +{ + std::memory_order m = static_cast(std::memory_order_relaxed | std::memory_order_consume | std::memory_order_acquire | std::memory_order_release + | std::memory_order_acq_rel | std::memory_order_seq_cst); + + std::atomic a1; + std::atomic a2; + std::atomic a3; + a1.is_lock_free(); + a1.store(1); + a1.load(); + a1.exchange(2); + int v; + a1.compare_exchange_weak(v, 2, std::memory_order_relaxed, std::memory_order_relaxed); + a1.compare_exchange_strong(v, 2, std::memory_order_relaxed, std::memory_order_relaxed); + a1.fetch_add(2); + a1.fetch_sub(3); + a1.fetch_and(3); + a1.fetch_or(1); + a1.fetch_xor(1); + a1++; + ++a1; + a1--; + --a1; + a1 += 2; + a1 -= 2; + a1 &= 1; + a1 |= 2; + a1 ^= 3; + + a3.store(&v); + a3.fetch_add(1); + a3.fetch_sub(1); + ++a3; + --a3; + a3++; + a3--; + a3 += 1; + a3 -= 1; + + std::atomic_is_lock_free(&a1); + // This produces linker errors on Mingw32 for some reason, probably not required anyway for most uses?? + //std::atomic_init(&a1, 2); + std::atomic_store(&a1, 3); + std::atomic_store_explicit(&a1, 3, std::memory_order_relaxed); + std::atomic_load(&a1); + std::atomic_load_explicit(&a1, std::memory_order_relaxed); + std::atomic_exchange(&a1, 3); + std::atomic_compare_exchange_weak(&a1, &v, 2); + std::atomic_compare_exchange_strong(&a1, &v, 2); + std::atomic_compare_exchange_weak_explicit(&a1, &v, 2, std::memory_order_relaxed, std::memory_order_relaxed); + std::atomic_compare_exchange_strong_explicit(&a1, &v, 2, std::memory_order_relaxed, std::memory_order_relaxed); + + std::atomic_flag f = ATOMIC_FLAG_INIT; + f.test_and_set(std::memory_order_relaxed); + f.test_and_set(); + f.clear(std::memory_order_relaxed); + f.clear(); + + std::atomic_thread_fence(std::memory_order_relaxed); + std::atomic_signal_fence(std::memory_order_relaxed); + + return 0; +} + +} diff --git a/test/config_info.cpp b/test/config_info.cpp index 8b82e81b..edef9653 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1008,6 +1008,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_CXX11_EXTERN_TEMPLATE); PRINT_MACRO(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS); PRINT_MACRO(BOOST_NO_CXX11_HDR_ARRAY); + PRINT_MACRO(BOOST_NO_CXX11_HDR_ATOMIC); PRINT_MACRO(BOOST_NO_CXX11_HDR_CHRONO); PRINT_MACRO(BOOST_NO_CXX11_HDR_CODECVT); PRINT_MACRO(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE); @@ -1106,6 +1107,8 @@ void print_boost_macros() + + // END GENERATED BLOCK PRINT_MACRO(BOOST_INTEL); diff --git a/test/config_test.cpp b/test/config_test.cpp index bc19400a..b06114f4 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Sun Apr 28 18:36:49 2013 +// This file was automatically generated on Thu Dec 12 19:09:40 2013 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -122,6 +122,11 @@ namespace boost_no_cxx11_atomic_smart_ptr = empty_boost; #else namespace boost_no_cxx11_hdr_array = empty_boost; #endif +#ifndef BOOST_NO_CXX11_HDR_ATOMIC +#include "boost_no_cxx11_hdr_atomic.ipp" +#else +namespace boost_no_cxx11_hdr_atomic = empty_boost; +#endif #ifndef BOOST_NO_CXX11_HDR_CHRONO #include "boost_no_cxx11_hdr_chrono.ipp" #else @@ -212,11 +217,6 @@ namespace boost_no_cxx11_hdr_unordered_set = empty_boost; #else namespace boost_no_cxx11_inline_namespaces = empty_boost; #endif -#ifndef BOOST_NO_CXX11_TRAILING_RESULT_TYPES -#include "boost_no_cxx11_trailing_result_types.ipp" -#else -namespace boost_no_cxx11_trailing_result_types = empty_boost; -#endif #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS #include "boost_no_cxx11_numeric_limits.ipp" #else @@ -227,6 +227,11 @@ namespace boost_no_cxx11_numeric_limits = empty_boost; #else namespace boost_no_cxx11_smart_ptr = empty_boost; #endif +#ifndef BOOST_NO_CXX11_TRAILING_RESULT_TYPES +#include "boost_no_cxx11_trailing_result_types.ipp" +#else +namespace boost_no_cxx11_trailing_result_types = empty_boost; +#endif #ifndef BOOST_NO_CXX11_USER_DEFINED_LITERALS #include "boost_no_cxx11_user_lit.ipp" #else @@ -1266,6 +1271,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX11_HDR_ARRAY at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_cxx11_hdr_atomic::test()) + { + std::cerr << "Failed test for BOOST_NO_CXX11_HDR_ATOMIC at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_cxx11_hdr_chrono::test()) { std::cerr << "Failed test for BOOST_NO_CXX11_HDR_CHRONO at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/no_cxx11_hdr_atomic_fail.cpp b/test/no_cxx11_hdr_atomic_fail.cpp new file mode 100644 index 00000000..9aa880f9 --- /dev/null +++ b/test/no_cxx11_hdr_atomic_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Thu Dec 12 19:07:12 2013 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// 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/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_ATOMIC_SMART_PTR +// This file should not compile, if it does then +// BOOST_NO_CXX11_ATOMIC_SMART_PTR should not be defined. +// See file boost_no_cxx11_hdr_atomic.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifdef BOOST_NO_CXX11_ATOMIC_SMART_PTR +#include "boost_no_cxx11_hdr_atomic.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_atomic_smart_ptr::test(); +} + diff --git a/test/no_cxx11_hdr_atomic_pass.cpp b/test/no_cxx11_hdr_atomic_pass.cpp new file mode 100644 index 00000000..f82eddef --- /dev/null +++ b/test/no_cxx11_hdr_atomic_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Thu Dec 12 19:07:12 2013 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// 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/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_ATOMIC_SMART_PTR +// This file should compile, if it does not then +// BOOST_NO_CXX11_ATOMIC_SMART_PTR should be defined. +// See file boost_no_cxx11_hdr_atomic.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifndef BOOST_NO_CXX11_ATOMIC_SMART_PTR +#include "boost_no_cxx11_hdr_atomic.ipp" +#else +namespace boost_no_cxx11_atomic_smart_ptr = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_atomic_smart_ptr::test(); +} + From 50c736c9ab7c38378aa61c830c6242d9b32fb736 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 13 Dec 2013 09:53:06 +0000 Subject: [PATCH 08/24] GCC-4.7x at least on Mingw does not have a conforming header - at least not that you can link to. --- include/boost/config/stdlib/libstdcpp3.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index 496e8d1b..d1322027 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -155,6 +155,11 @@ // so 4.7.0 is the first truely conforming one. # define BOOST_NO_CXX11_HDR_CHRONO # define BOOST_NO_CXX11_ALLOCATOR +#endif +// C++0x features in GCC 4.7.0 and later +// +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +// Note that although existed prior to gcc 4.8 it was largely unimplemented for many types: # define BOOST_NO_CXX11_HDR_ATOMIC #endif // C++0x headers not yet (fully!) implemented From 650c926c48b4fb25715f4474c9ad3fc4878f0ad8 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 13 Dec 2013 09:54:35 +0000 Subject: [PATCH 09/24] Reorganize WinCE config based on https://svn.boost.org/trac/boost/ticket/9095. --- include/boost/config/compiler/visualc.hpp | 11 ----------- include/boost/config/platform/win32.hpp | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 1fc41d1c..9249e8a6 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -86,17 +86,6 @@ # define BOOST_NO_INTRINSIC_WCHAR_T #endif -#if defined(_WIN32_WCE) || defined(UNDER_CE) -// Windows CE does not have a conforming signature for swprintf -# define BOOST_NO_SWPRINTF -#endif - -// we have ThreadEx or GetSystemTimeAsFileTime unless we're running WindowsCE -#if !defined(_WIN32_WCE) && !defined(UNDER_CE) -# define BOOST_HAS_THREADEX -# define BOOST_HAS_GETSYSTEMTIMEASFILETIME -#endif - // // check for exception handling support: #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS) diff --git a/include/boost/config/platform/win32.hpp b/include/boost/config/platform/win32.hpp index 6ab59f4e..2a91519e 100644 --- a/include/boost/config/platform/win32.hpp +++ b/include/boost/config/platform/win32.hpp @@ -55,16 +55,23 @@ // all translation units (needed for shared_ptr etc). // -#ifdef _WIN32_WCE -# define BOOST_NO_ANSI_APIS -#else -# define BOOST_HAS_GETSYSTEMTIMEASFILETIME -#endif - #ifndef BOOST_HAS_PTHREADS # define BOOST_HAS_WINTHREADS #endif +// +// WinCE configuration: +// +#if defined(_WIN32_WCE) || defined(UNDER_CE) +# define BOOST_NO_ANSI_APIS +// Windows CE does not have a conforming signature for swprintf +# define BOOST_NO_SWPRINTF +#else +# define BOOST_HAS_GETSYSTEMTIMEASFILETIME +# define BOOST_HAS_THREADEX +# define BOOST_HAS_GETSYSTEMTIMEASFILETIME +#endif + #ifndef BOOST_DISABLE_WIN32 // WEK: Added #define BOOST_HAS_FTIME From b0ed886eaaf62a1668c374d8362f9979184f66b6 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 13 Dec 2013 13:27:51 +0000 Subject: [PATCH 10/24] Fix for nvcc, see https://svn.boost.org/trac/boost/ticket/9392 --- include/boost/config/suffix.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index 485a5bc5..25b0508f 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -558,7 +558,13 @@ namespace std{ using ::type_info; } # define BOOST_NOINLINE __declspec(noinline) # elif defined(__GNUC__) && __GNUC__ > 3 // Clang also defines __GNUC__ (as 4) -# define BOOST_NOINLINE __attribute__ ((__noinline__)) +# if defined(__CUDACC__) + // nvcc doesn't always parse __noinline__, + // see: https://svn.boost.org/trac/boost/ticket/9392 +# define BOOST_NOINLINE __attribute__ ((noinline)) +# else +# define BOOST_NOINLINE __attribute__ ((__noinline__)) +# endif # else # define BOOST_NOINLINE # endif From 62b1bb07d26e6fa4e3bf512280726bcd638b00eb Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 13 Dec 2013 13:47:50 +0000 Subject: [PATCH 11/24] Apply patch from https://svn.boost.org/trac/boost/ticket/9410 --- include/boost/config/compiler/visualc.hpp | 2 +- test/no_decltype_n3276_fail.cpp | 2 +- test/no_decltype_n3276_pass.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 9249e8a6..fb30fc12 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -165,13 +165,13 @@ # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES # define BOOST_NO_CXX11_VARIADIC_TEMPLATES # define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +# define BOOST_NO_CXX11_DECLTYPE_N3276 #endif // C++11 features not supported by any versions #define BOOST_NO_CXX11_CHAR16_T #define BOOST_NO_CXX11_CHAR32_T #define BOOST_NO_CXX11_CONSTEXPR -#define BOOST_NO_CXX11_DECLTYPE_N3276 #define BOOST_NO_CXX11_NOEXCEPT #define BOOST_NO_CXX11_UNICODE_LITERALS #define BOOST_NO_SFINAE_EXPR diff --git a/test/no_decltype_n3276_fail.cpp b/test/no_decltype_n3276_fail.cpp index 35a6d123..1e86fb6f 100644 --- a/test/no_decltype_n3276_fail.cpp +++ b/test/no_decltype_n3276_fail.cpp @@ -32,6 +32,6 @@ int main( int, char *[] ) { - return boost_no_decltype_n3276::test(); + return boost_no_cxx11_decltype_n3276::test(); } diff --git a/test/no_decltype_n3276_pass.cpp b/test/no_decltype_n3276_pass.cpp index b1b8c0a6..0eb3a21f 100644 --- a/test/no_decltype_n3276_pass.cpp +++ b/test/no_decltype_n3276_pass.cpp @@ -27,11 +27,11 @@ #ifndef BOOST_NO_CXX11_DECLTYPE_N3276 #include "boost_no_decltype_n3276.ipp" #else -namespace boost_no_decltype_n3276 = empty_boost; +namespace boost_no_cxx11_decltype_n3276 = empty_boost; #endif int main( int, char *[] ) { - return boost_no_decltype_n3276::test(); + return boost_no_cxx11_decltype_n3276::test(); } From 1c3cec7a158324cd27c41e8cef568c2e60a56b00 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 13 Dec 2013 18:51:32 +0000 Subject: [PATCH 12/24] Fix buggy test cases. VC++ has in recent versions. --- include/boost/config/stdlib/dinkumware.hpp | 5 +---- test/no_cxx11_hdr_atomic_fail.cpp | 4 ++-- test/no_cxx11_hdr_atomic_pass.cpp | 6 +++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index b3a92a37..a0ed8702 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -142,12 +142,9 @@ // #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 610 # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST +# define BOOST_NO_CXX11_HDR_ATOMIC #endif -// Not present in any version: -// -#define BOOST_NO_CXX11_HDR_ATOMIC - #ifdef _CPPLIB_VER # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER #else diff --git a/test/no_cxx11_hdr_atomic_fail.cpp b/test/no_cxx11_hdr_atomic_fail.cpp index 9aa880f9..196f47cf 100644 --- a/test/no_cxx11_hdr_atomic_fail.cpp +++ b/test/no_cxx11_hdr_atomic_fail.cpp @@ -24,7 +24,7 @@ #include #include "test.hpp" -#ifdef BOOST_NO_CXX11_ATOMIC_SMART_PTR +#ifdef BOOST_NO_CXX11_HDR_ATOMIC #include "boost_no_cxx11_hdr_atomic.ipp" #else #error "this file should not compile" @@ -32,6 +32,6 @@ int main( int, char *[] ) { - return boost_no_cxx11_atomic_smart_ptr::test(); + return boost_no_cxx11_hdr_atomic::test(); } diff --git a/test/no_cxx11_hdr_atomic_pass.cpp b/test/no_cxx11_hdr_atomic_pass.cpp index f82eddef..31f7ed96 100644 --- a/test/no_cxx11_hdr_atomic_pass.cpp +++ b/test/no_cxx11_hdr_atomic_pass.cpp @@ -24,14 +24,14 @@ #include #include "test.hpp" -#ifndef BOOST_NO_CXX11_ATOMIC_SMART_PTR +#ifndef BOOST_NO_CXX11_HDR_ATOMIC #include "boost_no_cxx11_hdr_atomic.ipp" #else -namespace boost_no_cxx11_atomic_smart_ptr = empty_boost; +namespace boost_no_cxx11_hdr_atomic = empty_boost; #endif int main( int, char *[] ) { - return boost_no_cxx11_atomic_smart_ptr::test(); + return boost_no_cxx11_hdr_atomic::test(); } From 958c9f8a5154f7236f5d1549ab9326cb6a174922 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 13 Dec 2013 19:13:48 +0000 Subject: [PATCH 13/24] Add some const qualifiers in the hopes it will fix clang C++14 mode failures. --- test/boost_no_constexpr.ipp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/boost_no_constexpr.ipp b/test/boost_no_constexpr.ipp index 82de2e2d..563bdb20 100644 --- a/test/boost_no_constexpr.ipp +++ b/test/boost_no_constexpr.ipp @@ -24,15 +24,15 @@ constexpr const int* xp = addr(x); struct A { constexpr A(int i) : val(i) { } - constexpr operator int() { return val; } - constexpr operator long() { return 43; } + constexpr operator int()const { return val; } + constexpr operator long()const { return 43; } private: int val; }; template struct X { }; -constexpr A a = 42; +constexpr const A a = 42; X xx; // OK: unique conversion to int From 743fa7e1293f9131c5545bf078642a9dccdd8a69 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 13 Dec 2013 19:39:42 +0000 Subject: [PATCH 14/24] Fix two more typos. --- test/no_cxx11_hdr_atomic_fail.cpp | 4 ++-- test/no_cxx11_hdr_atomic_pass.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/no_cxx11_hdr_atomic_fail.cpp b/test/no_cxx11_hdr_atomic_fail.cpp index 196f47cf..cb6bd124 100644 --- a/test/no_cxx11_hdr_atomic_fail.cpp +++ b/test/no_cxx11_hdr_atomic_fail.cpp @@ -10,9 +10,9 @@ // -// Test file for macro BOOST_NO_CXX11_ATOMIC_SMART_PTR +// Test file for macro BOOST_NO_CXX11_HDR_ATOMIC // This file should not compile, if it does then -// BOOST_NO_CXX11_ATOMIC_SMART_PTR should not be defined. +// BOOST_NO_CXX11_HDR_ATOMIC should not be defined. // See file boost_no_cxx11_hdr_atomic.ipp for details // Must not have BOOST_ASSERT_CONFIG set; it defeats diff --git a/test/no_cxx11_hdr_atomic_pass.cpp b/test/no_cxx11_hdr_atomic_pass.cpp index 31f7ed96..7258f646 100644 --- a/test/no_cxx11_hdr_atomic_pass.cpp +++ b/test/no_cxx11_hdr_atomic_pass.cpp @@ -10,9 +10,9 @@ // -// Test file for macro BOOST_NO_CXX11_ATOMIC_SMART_PTR +// Test file for macro BOOST_NO_CXX11_HDR_ATOMIC // This file should compile, if it does not then -// BOOST_NO_CXX11_ATOMIC_SMART_PTR should be defined. +// BOOST_NO_CXX11_HDR_ATOMIC should be defined. // See file boost_no_cxx11_hdr_atomic.ipp for details // Must not have BOOST_ASSERT_CONFIG set; it defeats From 0762a554c697d4cf4452e129f17d7d96945c06f2 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Sat, 14 Dec 2013 15:06:08 -0500 Subject: [PATCH 15/24] Corrected spelling change in comment --- include/boost/config/stdlib/dinkumware.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index e2a01d91..96e2b6aa 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -86,7 +86,7 @@ # define BOOST_NO_STD_LOCALE #endif -// Fix for VC++ 8.0 on up ( I do not have a previous vesion to test ) +// Fix for VC++ 8.0 on up ( I do not have a previous version to test ) // or clang-cl. If exceptions are off you must manually include the // header before including the header. Admittedly // trying to use Boost libraries or the standard C++ libraries without From 86ca46f142636edc7af2c186028b3a32b4af1e6a Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Mon, 16 Dec 2013 08:08:53 -0500 Subject: [PATCH 16/24] Workaround for older versions of clang. --- include/boost/config/compiler/clang.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index c030ad71..c2a735f5 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -10,6 +10,14 @@ #define BOOST_HAS_PRAGMA_ONCE +// When compiling with clang before __has_extension was defined, +// even if one writes 'defined(__has_extension) && __has_extension(xxx)', +// clang reports a compiler error. So the only workaround found is: + +#ifndef __has_extension +#define __has_extension __has_feature +#endif + #if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS) # define BOOST_NO_EXCEPTIONS #endif From 800d3d54168973eff6d98a3d74e710c327e888b9 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Tue, 14 Jan 2014 22:17:54 -0500 Subject: [PATCH 17/24] Add specific 'const' for member function declared as a 'constexpr' in order to conform to C++14. --- test/boost_no_cxx11_user_lit.ipp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/boost_no_cxx11_user_lit.ipp b/test/boost_no_cxx11_user_lit.ipp index 375902f7..d1c2054a 100644 --- a/test/boost_no_cxx11_user_lit.ipp +++ b/test/boost_no_cxx11_user_lit.ipp @@ -19,7 +19,7 @@ struct my_literal constexpr my_literal() : val(0) {} constexpr my_literal(int i) : val(i) {} constexpr my_literal(const my_literal& a) : val(a.val) {} - constexpr bool operator==(const my_literal& a) { return val == a.val; } + constexpr bool operator==(const my_literal& a) const { return val == a.val; } int val; }; From fbbb46a5f3f759c1225d33febad7776ad45f4995 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 26 Jan 2014 10:03:40 +0000 Subject: [PATCH 18/24] Revert "Remove remaining occurances of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION" This reverts commit 0e563f0db8f1b73a1d8b70c07ea3861a4d2eff5f. --- include/boost/config/suffix.hpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index 25b0508f..337100a1 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -121,6 +121,39 @@ # define BOOST_MSVC6_MEMBER_TEMPLATES # endif +// +// Without partial specialization, can't test for partial specialisation bugs: +// +# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) +# define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG +# endif + +// +// Without partial specialization, we can't have array-type partial specialisations: +// +# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) +# define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS +# endif + +// +// Without partial specialization, std::iterator_traits can't work: +// +# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_NO_STD_ITERATOR_TRAITS) +# define BOOST_NO_STD_ITERATOR_TRAITS +# endif + +// +// Without partial specialization, partial +// specialization with default args won't work either: +// +# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) +# define BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS +# endif + // // Without member template support, we can't have template constructors // in the standard library either: From 497902613740d8676a19e4aab5d0e9ba5174c08a Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 26 Jan 2014 10:04:00 +0000 Subject: [PATCH 19/24] Revert "Require compiler support for partial template specialization." This reverts commit c26a532032074dc7585d95a8367c9aec6309cfc3. --- include/boost/config/compiler/mpw.hpp | 90 +++++++++++++++++++ include/boost/config/compiler/sunpro_cc.hpp | 59 ++++++++++-- .../boost/config/select_compiler_config.hpp | 3 +- 3 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 include/boost/config/compiler/mpw.hpp diff --git a/include/boost/config/compiler/mpw.hpp b/include/boost/config/compiler/mpw.hpp new file mode 100644 index 00000000..69104674 --- /dev/null +++ b/include/boost/config/compiler/mpw.hpp @@ -0,0 +1,90 @@ +// (C) Copyright John Maddock 2001 - 2002. +// (C) Copyright Aleksey Gurtovoy 2002. +// 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. + +// MPW C++ compilers setup: + +# if defined(__SC__) +# define BOOST_COMPILER "MPW SCpp version " BOOST_STRINGIZE(__SC__) +# elif defined(__MRC__) +# define BOOST_COMPILER "MPW MrCpp version " BOOST_STRINGIZE(__MRC__) +# else +# error "Using MPW compiler configuration by mistake. Please update." +# endif + +// +// MPW 8.90: +// +#if (MPW_CPLUS <= 0x890) || !defined(BOOST_STRICT_CONFIG) +# define BOOST_NO_CV_SPECIALIZATIONS +# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS +# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS +# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION +# define BOOST_NO_INTRINSIC_WCHAR_T +# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# define BOOST_NO_USING_TEMPLATE + +# define BOOST_NO_CWCHAR +# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + +# define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */ + +#endif + +// +// C++0x features +// +// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG +// +#define BOOST_NO_CXX11_AUTO_DECLARATIONS +#define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS +#define BOOST_NO_CXX11_CHAR16_T +#define BOOST_NO_CXX11_CHAR32_T +#define BOOST_NO_CXX11_CONSTEXPR +#define BOOST_NO_CXX11_DECLTYPE +#define BOOST_NO_CXX11_DECLTYPE_N3276 +#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS +#define BOOST_NO_CXX11_DELETED_FUNCTIONS +#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS +#define BOOST_NO_CXX11_EXTERN_TEMPLATE +#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST +#define BOOST_NO_CXX11_LAMBDAS +#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS +#define BOOST_NO_CXX11_NOEXCEPT +#define BOOST_NO_CXX11_NULLPTR +#define BOOST_NO_CXX11_RANGE_BASED_FOR +#define BOOST_NO_CXX11_RAW_LITERALS +#define BOOST_NO_CXX11_RVALUE_REFERENCES +#define BOOST_NO_CXX11_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_STATIC_ASSERT +#define BOOST_NO_CXX11_TEMPLATE_ALIASES +#define BOOST_NO_CXX11_UNICODE_LITERALS +#define BOOST_NO_CXX11_VARIADIC_TEMPLATES +#define BOOST_NO_CXX11_VARIADIC_MACROS +#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX +#define BOOST_NO_CXX11_USER_DEFINED_LITERALS +#define BOOST_NO_CXX11_ALIGNAS +#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES +#define BOOST_NO_CXX11_INLINE_NAMESPACES + +// +// versions check: +// we don't support MPW prior to version 8.9: +#if MPW_CPLUS < 0x890 +# error "Compiler not supported or configured - please reconfigure" +#endif +// +// last known and checked version is 0x890: +#if (MPW_CPLUS > 0x890) +# if defined(BOOST_ASSERT_CONFIG) +# error "Unknown compiler version - please run the configure tests and report the results" +# endif +#endif + + diff --git a/include/boost/config/compiler/sunpro_cc.hpp b/include/boost/config/compiler/sunpro_cc.hpp index 73cff7de..486d5c43 100644 --- a/include/boost/config/compiler/sunpro_cc.hpp +++ b/include/boost/config/compiler/sunpro_cc.hpp @@ -11,6 +11,52 @@ // Sun C++ compiler setup: +# if __SUNPRO_CC <= 0x500 +# define BOOST_NO_MEMBER_TEMPLATES +# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING +# endif + +# if (__SUNPRO_CC <= 0x520) + // + // Sunpro 5.2 and earler: + // + // although sunpro 5.2 supports the syntax for + // inline initialization it often gets the value + // wrong, especially where the value is computed + // from other constants (J Maddock 6th May 2001) +# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION + + // Although sunpro 5.2 supports the syntax for + // partial specialization, it often seems to + // bind to the wrong specialization. Better + // to disable it until suppport becomes more stable + // (J Maddock 6th May 2001). +# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# endif + +# if (__SUNPRO_CC <= 0x530) + // Requesting debug info (-g) with Boost.Python results + // in an internal compiler error for "static const" + // initialized in-class. + // >> Assertion: (../links/dbg_cstabs.cc, line 611) + // while processing ../test.cpp at line 0. + // (Jens Maurer according to Gottfried Ganssauge 04 Mar 2002) +# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION + + // SunPro 5.3 has better support for partial specialization, + // but breaks when compiling std::less > + // (Jens Maurer 4 Nov 2001). + + // std::less specialization fixed as reported by George + // Heintzelman; partial specialization re-enabled + // (Peter Dimov 17 Jan 2002) + +//# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + + // integral constant expressions with 64 bit numbers fail +# define BOOST_NO_INTEGRAL_INT64_T +# endif + # if (__SUNPRO_CC < 0x570) # define BOOST_NO_TEMPLATE_TEMPLATES // see http://lists.boost.org/MailArchives/boost/msg47184.php @@ -34,9 +80,12 @@ // // Dynamic shared object (DSO) and dynamic-link library (DLL) support // -#define BOOST_SYMBOL_EXPORT __global -#define BOOST_SYMBOL_IMPORT __global -#define BOOST_SYMBOL_VISIBLE __global +#if __SUNPRO_CC > 0x500 +# define BOOST_SYMBOL_EXPORT __global +# define BOOST_SYMBOL_IMPORT __global +# define BOOST_SYMBOL_VISIBLE __global +#endif + // @@ -91,8 +140,8 @@ // // versions check: -// we don't support sunpro prior to version 5.4. -#if __SUNPRO_CC < 0x540 +// we don't support sunpro prior to version 4: +#if __SUNPRO_CC < 0x400 #error "Compiler not supported or configured - please reconfigure" #endif // diff --git a/include/boost/config/select_compiler_config.hpp b/include/boost/config/select_compiler_config.hpp index 1d3a7d52..0eeb7ad3 100644 --- a/include/boost/config/select_compiler_config.hpp +++ b/include/boost/config/select_compiler_config.hpp @@ -89,7 +89,8 @@ #elif defined(__MRC__) || defined(__SC__) // MPW MrCpp or SCpp -# error "This compiler is not supported." +# define BOOST_COMPILER_CONFIG "boost/config/compiler/mpw.hpp" + #elif defined(__IBMCPP__) // IBM Visual Age # define BOOST_COMPILER_CONFIG "boost/config/compiler/vacpp.hpp" From 60684bfc2e7b1f2a5690a9bcb6636b170632fc71 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 26 Jan 2014 10:04:22 +0000 Subject: [PATCH 20/24] Revert "Remove obsolete MSVC check from pragma guard" This reverts commit 54353a7d8924bc58bfc0176339dad0895450790c. --- include/boost/config/compiler/comeau.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/config/compiler/comeau.hpp b/include/boost/config/compiler/comeau.hpp index 50edb4d2..278222dc 100644 --- a/include/boost/config/compiler/comeau.hpp +++ b/include/boost/config/compiler/comeau.hpp @@ -34,7 +34,7 @@ // // enable __int64 support in VC emulation mode // -# if defined(_MSC_VER) +# if defined(_MSC_VER) && (_MSC_VER >= 1200) # define BOOST_HAS_MS_INT64 # endif From 9647c8ddb463060c675b5e2343e7930d12e6c407 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 26 Jan 2014 10:04:44 +0000 Subject: [PATCH 21/24] Revert "Config: Remove obsolete MSVC version check" This reverts commit 9334a55617b2aedb7cc2813e7fd5f721db8f143c. --- include/boost/config/auto_link.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/config/auto_link.hpp b/include/boost/config/auto_link.hpp index d0cdb9f5..13cbad43 100644 --- a/include/boost/config/auto_link.hpp +++ b/include/boost/config/auto_link.hpp @@ -92,7 +92,7 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. #if defined(BOOST_MSVC) \ || defined(__BORLANDC__) \ || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \ - || (defined(__ICL) && defined(_MSC_EXTENSIONS)) + || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200)) #ifndef BOOST_VERSION_HPP # include From 902102ee6949129c387a23b00b5c06ba5fddf869 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 26 Jan 2014 10:16:19 +0000 Subject: [PATCH 22/24] Add error message when attempting to use a deprecated compiler. --- include/boost/config/suffix.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index 337100a1..3bb325ed 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -943,5 +943,14 @@ namespace std{ using ::type_info; } #define BOOST_HAS_VARIADIC_TMPL #endif +// +// Finish off with checks for macros that are depricated / no longer supported, +// if any of these are set then it's very likely that much of Boost will no +// longer work. So stop with a #error for now, but give the user a chance +// to continue at their own risk if they really want to: +// +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_CONFIG_ALLOW_DEPRECATED) +# error "You are using a compiler which lacks features which are now a minimum requirement in order to use Boost, define BOOST_CONFIG_ALLOW_DEPRECATED if you want to continue at your own risk!!!" +#endif #endif From f27ef7207aec91d55d87bb13d0fdcbd1bc1edb46 Mon Sep 17 00:00:00 2001 From: "K. Noel Belcourt" Date: Tue, 4 Feb 2014 17:32:06 -0700 Subject: [PATCH 23/24] Add check that BOOST_HAS_LONG_LONG is supported on Darwin before enabling the macro. Apple helpfully supplies this macro (__DARWIN_NO_LONG_LONG) if long long type is supported. This to handle case where compiling with -pedantic causes compiler errors because it enforces ISO compliance (c++98 in this case). --- include/boost/config/compiler/gcc.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index aa628e5a..c560d6ae 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -74,8 +74,12 @@ // // gcc has "long long" +// Except on Darwin with standard compliance enabled (-pedantic) +// Apple gcc helpfully defines this macro we can query // -#define BOOST_HAS_LONG_LONG +#if !defined(__DARWIN_NO_LONG_LONG) +# define BOOST_HAS_LONG_LONG +#endif // // gcc implements the named return value optimization since version 3.1 From 08392fd952d8627565f8217f8955832b481adfac Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 6 Feb 2014 13:29:59 +0000 Subject: [PATCH 24/24] Update test for C++11 std::allocator to check that member rebind is a template alias. Update config headers to match. --- include/boost/config/stdlib/dinkumware.hpp | 2 +- test/boost_no_cxx11_allocator.ipp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/boost/config/stdlib/dinkumware.hpp b/include/boost/config/stdlib/dinkumware.hpp index f31a0cdd..96bc6dd0 100644 --- a/include/boost/config/stdlib/dinkumware.hpp +++ b/include/boost/config/stdlib/dinkumware.hpp @@ -134,7 +134,6 @@ # define BOOST_NO_CXX11_HDR_MUTEX # define BOOST_NO_CXX11_HDR_RATIO # define BOOST_NO_CXX11_HDR_THREAD -# define BOOST_NO_CXX11_ALLOCATOR # define BOOST_NO_CXX11_ATOMIC_SMART_PTR #endif @@ -143,6 +142,7 @@ #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 610 # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST # define BOOST_NO_CXX11_HDR_ATOMIC +# define BOOST_NO_CXX11_ALLOCATOR #endif #ifdef _CPPLIB_VER diff --git a/test/boost_no_cxx11_allocator.ipp b/test/boost_no_cxx11_allocator.ipp index ad14bdef..07eb35e0 100644 --- a/test/boost_no_cxx11_allocator.ipp +++ b/test/boost_no_cxx11_allocator.ipp @@ -28,10 +28,14 @@ int test() std::allocator_arg_t aat; std::uses_allocator > ua; std::allocator_traits > at; + std::allocator ia; + std::allocator_traits >::rebind_alloc ra(ia); + std::allocator* pva = &ra; (void)aat; (void)ua; (void)at; + (void)pva; return 0; }