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(); +} +