From 88e602c57797660ebe0f9e15dbd64c1ff16dead3 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Wed, 13 Sep 2017 11:26:20 +0900 Subject: Imported Upstream version 1.65.1 Change-Id: Ie4005d637141f8311f4b6d46b613478a2b3dae59 Signed-off-by: DongHun Kwak --- boost/config/compiler/nvcc.hpp | 13 +++++++-- boost/config/compiler/visualc.hpp | 11 ++++++-- boost/context/continuation_fcontext.hpp | 2 +- boost/context/continuation_ucontext.hpp | 40 +++++++++++++++++---------- boost/context/continuation_winfib.hpp | 32 +++++++++++++-------- boost/fiber/context.hpp | 4 +-- boost/smart_ptr/detail/local_counted_base.hpp | 2 ++ boost/stacktrace/detail/collect_unwind.ipp | 4 +++ boost/stacktrace/detail/frame_decl.hpp | 4 +-- boost/stacktrace/detail/frame_msvc.ipp | 2 +- boost/stacktrace/detail/pop_options.h | 12 ++++++++ boost/stacktrace/detail/pop_options.pp | 12 -------- boost/stacktrace/detail/push_options.h | 31 +++++++++++++++++++++ boost/stacktrace/detail/push_options.pp | 31 --------------------- boost/stacktrace/frame.hpp | 4 +-- boost/stacktrace/safe_dump_to.hpp | 4 +-- boost/thread/win32/condition_variable.hpp | 6 ++-- boost/version.hpp | 4 +-- 18 files changed, 128 insertions(+), 90 deletions(-) create mode 100644 boost/stacktrace/detail/pop_options.h delete mode 100644 boost/stacktrace/detail/pop_options.pp create mode 100644 boost/stacktrace/detail/push_options.h delete mode 100644 boost/stacktrace/detail/push_options.pp (limited to 'boost') diff --git a/boost/config/compiler/nvcc.hpp b/boost/config/compiler/nvcc.hpp index 43039b5c25..f21b9b54fe 100644 --- a/boost/config/compiler/nvcc.hpp +++ b/boost/config/compiler/nvcc.hpp @@ -11,6 +11,13 @@ # define BOOST_COMPILER "NVIDIA CUDA C++ Compiler" #endif +#if defined(__CUDACC_VER_MAJOR__) && defined(__CUDACC_VER_MINOR__) && defined(__CUDACC_VER_BUILD__) +# define BOOST_CUDA_VERSION __CUDACC_VER_MAJOR__ * 1000000 + __CUDACC_VER_MINOR__ * 10000 + __CUDACC_VER_BUILD__ +#else +// We don't really know what the CUDA version is, but it's definitely before 7.5: +# define BOOST_CUDA_VERSION 7000000 +#endif + // NVIDIA Specific support // BOOST_GPU_ENABLED : Flag a function or a method as being enabled on the host and device #define BOOST_GPU_ENABLED __host__ __device__ @@ -19,11 +26,11 @@ // https://svn.boost.org/trac/boost/ticket/11897 // This is fixed in 7.5. As the following version macro was introduced in 7.5 an existance // check is enough to detect versions < 7.5 -#if !defined(__CUDACC_VER__) || (__CUDACC_VER__ < 70500) +#if BOOST_CUDA_VERSION < 7050000 # define BOOST_NO_CXX11_VARIADIC_TEMPLATES #endif // The same bug is back again in 8.0: -#if (__CUDACC_VER__ > 80000) && (__CUDACC_VER__ < 80100) +#if (BOOST_CUDA_VERSION > 8000000) && (BOOST_CUDA_VERSION < 8010000) # define BOOST_NO_CXX11_VARIADIC_TEMPLATES #endif // Most recent CUDA (8.0) has no constexpr support in msvc mode: @@ -43,7 +50,7 @@ // And this one effects the NVCC front end, // See https://svn.boost.org/trac/boost/ticket/13049 // -#if (__CUDACC_VER__ >= 80000) && (__CUDACC_VER__ < 80100) +#if (BOOST_CUDA_VERSION >= 8000000) && (BOOST_CUDA_VERSION < 8010000) # define BOOST_NO_CXX11_NOEXCEPT #endif diff --git a/boost/config/compiler/visualc.hpp b/boost/config/compiler/visualc.hpp index c0557de712..7df92ba31b 100644 --- a/boost/config/compiler/visualc.hpp +++ b/boost/config/compiler/visualc.hpp @@ -196,6 +196,12 @@ # define BOOST_NO_CXX14_AGGREGATE_NSDMI #endif +// C++17 features supported by VC++ 14.1 (Visual Studio 2017) Update 3 +// +#if (_MSC_VER < 1911) || (_MSVC_LANG < 201703) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif + // MSVC including version 14 has not yet completely // implemented value-initialization, as is reported: // "VC++ does not value-initialize members of derived classes without @@ -220,7 +226,6 @@ // C++ 14: # define BOOST_NO_CXX14_CONSTEXPR // C++ 17: -#define BOOST_NO_CXX17_STRUCTURED_BINDINGS #define BOOST_NO_CXX17_INLINE_VARIABLES #define BOOST_NO_CXX17_FOLD_EXPRESSIONS @@ -321,8 +326,8 @@ #endif // -// last known and checked version is 19.10.25017 (VC++ 2017): -#if (_MSC_VER > 1910) +// last known and checked version is 19.11.25506 (VC++ 2017.3): +#if (_MSC_VER > 1911) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else diff --git a/boost/context/continuation_fcontext.hpp b/boost/context/continuation_fcontext.hpp index 5c309c3fed..e22c26865d 100644 --- a/boost/context/continuation_fcontext.hpp +++ b/boost/context/continuation_fcontext.hpp @@ -95,7 +95,7 @@ transfer_t context_ontop( transfer_t t) { t.data = nullptr; Ctx c{ t.fctx }; // execute function, pass continuation via reference - fn( std::move( c) ); + c = fn( std::move( c) ); #if defined(BOOST_NO_CXX14_STD_EXCHANGE) return { exchange( c.fctx_, nullptr), nullptr }; #else diff --git a/boost/context/continuation_ucontext.hpp b/boost/context/continuation_ucontext.hpp index 6f964dc6f6..94457f7e0f 100644 --- a/boost/context/continuation_ucontext.hpp +++ b/boost/context/continuation_ucontext.hpp @@ -84,18 +84,18 @@ static void entry_func( void * data) noexcept { struct BOOST_CONTEXT_DECL activation_record { thread_local static activation_record * current_rec; - ucontext_t uctx{}; - stack_context sctx{}; - bool main_ctx{ true }; - activation_record * from{ nullptr }; - std::function< void(activation_record*&) > ontop{}; - bool terminated{ false }; - bool force_unwind{ false }; + ucontext_t uctx{}; + stack_context sctx{}; + bool main_ctx{ true }; + activation_record * from{ nullptr }; + std::function< activation_record*(activation_record*&) > ontop{}; + bool terminated{ false }; + bool force_unwind{ false }; #if defined(BOOST_USE_ASAN) - void * fake_stack{ nullptr }; - void * stack_bottom{ nullptr }; - std::size_t stack_size{ 0 }; - bool started{ false }; + void * fake_stack{ nullptr }; + void * stack_bottom{ nullptr }; + std::size_t stack_size{ 0 }; + bool started{ false }; #endif static activation_record *& current() noexcept; @@ -168,20 +168,30 @@ struct BOOST_CONTEXT_DECL activation_record { current()->ontop = std::bind( [](typename std::decay< Fn >::type & fn, activation_record *& ptr){ Ctx c{ ptr }; - fn( std::move( c) ); + c = fn( std::move( c) ); if ( ! c) { ptr = nullptr; } +#if defined(BOOST_NO_CXX14_STD_EXCHANGE) + return exchange( c.ptr_, nullptr); +#else + return std::exchange( c.ptr_, nullptr); +#endif }, std::forward< Fn >( fn), std::placeholders::_1); #else current()->ontop = [fn=std::forward(fn)](activation_record *& ptr){ Ctx c{ ptr }; - fn( std::move( c) ); + c = fn( std::move( c) ); if ( ! c) { ptr = nullptr; } +#if defined(BOOST_NO_CXX14_STD_EXCHANGE) + return exchange( c.ptr_, nullptr); +#else + return std::exchange( c.ptr_, nullptr); +#endif }; #endif #if defined(BOOST_USE_SEGMENTED_STACKS) @@ -408,7 +418,7 @@ public: if ( BOOST_UNLIKELY( detail::activation_record::current()->force_unwind) ) { throw detail::forced_unwind{ ptr}; } else if ( BOOST_UNLIKELY( nullptr != detail::activation_record::current()->ontop) ) { - detail::activation_record::current()->ontop( ptr); + ptr = detail::activation_record::current()->ontop( ptr); detail::activation_record::current()->ontop = nullptr; } return continuation{ ptr }; @@ -426,7 +436,7 @@ public: if ( BOOST_UNLIKELY( detail::activation_record::current()->force_unwind) ) { throw detail::forced_unwind{ ptr}; } else if ( BOOST_UNLIKELY( nullptr != detail::activation_record::current()->ontop) ) { - detail::activation_record::current()->ontop( ptr); + ptr = detail::activation_record::current()->ontop( ptr); detail::activation_record::current()->ontop = nullptr; } return continuation{ ptr }; diff --git a/boost/context/continuation_winfib.hpp b/boost/context/continuation_winfib.hpp index 8a814b0bd8..c7f54eeebc 100644 --- a/boost/context/continuation_winfib.hpp +++ b/boost/context/continuation_winfib.hpp @@ -65,13 +65,13 @@ static VOID WINAPI entry_func( LPVOID data) noexcept { struct BOOST_CONTEXT_DECL activation_record { thread_local static activation_record * current_rec; - LPVOID fiber{ nullptr }; - stack_context sctx{}; - bool main_ctx{ true }; - activation_record * from{ nullptr }; - std::function< void(activation_record*&) > ontop{}; - bool terminated{ false }; - bool force_unwind{ false }; + LPVOID fiber{ nullptr }; + stack_context sctx{}; + bool main_ctx{ true }; + activation_record * from{ nullptr }; + std::function< activation_record*(activation_record*&) > ontop{}; + bool terminated{ false }; + bool force_unwind{ false }; static activation_record *& current() noexcept; @@ -142,20 +142,30 @@ struct BOOST_CONTEXT_DECL activation_record { current()->ontop = std::bind( [](typename std::decay< Fn >::type & fn, activation_record *& ptr){ Ctx c{ ptr }; - fn( std::move( c) ); + c = fn( std::move( c) ); if ( ! c) { ptr = nullptr; } +#if defined(BOOST_NO_CXX14_STD_EXCHANGE) + return exchange( c.ptr_, nullptr); +#else + return std::exchange( c.ptr_, nullptr); +#endif }, std::forward< Fn >( fn), std::placeholders::_1); #else current()->ontop = [fn=std::forward(fn)](activation_record *& ptr){ Ctx c{ ptr }; - fn( std::move( c) ); + c = fn( std::move( c) ); if ( ! c) { ptr = nullptr; } +#if defined(BOOST_NO_CXX14_STD_EXCHANGE) + return exchange( c.ptr_, nullptr); +#else + return std::exchange( c.ptr_, nullptr); +#endif }; #endif // context switch @@ -336,7 +346,7 @@ public: if ( BOOST_UNLIKELY( detail::activation_record::current()->force_unwind) ) { throw detail::forced_unwind{ ptr}; } else if ( BOOST_UNLIKELY( nullptr != detail::activation_record::current()->ontop) ) { - detail::activation_record::current()->ontop( ptr); + ptr = detail::activation_record::current()->ontop( ptr); detail::activation_record::current()->ontop = nullptr; } return continuation{ ptr }; @@ -354,7 +364,7 @@ public: if ( BOOST_UNLIKELY( detail::activation_record::current()->force_unwind) ) { throw detail::forced_unwind{ ptr}; } else if ( BOOST_UNLIKELY( nullptr != detail::activation_record::current()->ontop) ) { - detail::activation_record::current()->ontop( ptr); + ptr = detail::activation_record::current()->ontop( ptr); detail::activation_record::current()->ontop = nullptr; } return continuation{ ptr }; diff --git a/boost/fiber/context.hpp b/boost/fiber/context.hpp index e2d1aeff5f..ff6560ae9e 100644 --- a/boost/fiber/context.hpp +++ b/boost/fiber/context.hpp @@ -423,9 +423,9 @@ private: auto arg = std::move( arg_); c.resume(); #if defined(BOOST_NO_CXX17_STD_APPLY) - boost::context::detail::apply( std::move( fn_), std::move( arg_) ); + boost::context::detail::apply( std::move( fn), std::move( arg) ); #else - std::apply( std::move( fn_), std::move( arg_) ); + std::apply( std::move( fn), std::move( arg) ); #endif } // terminate context diff --git a/boost/smart_ptr/detail/local_counted_base.hpp b/boost/smart_ptr/detail/local_counted_base.hpp index 398b46dd1a..fdfe2c65cd 100644 --- a/boost/smart_ptr/detail/local_counted_base.hpp +++ b/boost/smart_ptr/detail/local_counted_base.hpp @@ -60,12 +60,14 @@ public: void add_ref() BOOST_SP_NOEXCEPT { +#if !defined(__NVCC__) #if defined( __has_builtin ) # if __has_builtin( __builtin_assume ) __builtin_assume( local_use_count_ >= 1 ); # endif +#endif #endif local_use_count_ = static_cast( local_use_count_ + 1 ); diff --git a/boost/stacktrace/detail/collect_unwind.ipp b/boost/stacktrace/detail/collect_unwind.ipp index 3ee4e8f61e..98d8fcb7f8 100644 --- a/boost/stacktrace/detail/collect_unwind.ipp +++ b/boost/stacktrace/detail/collect_unwind.ipp @@ -17,6 +17,10 @@ #include #include +#if !defined(_GNU_SOURCE) && !defined(BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED) && !defined(BOOST_WINDOWS) +#error "Boost.Stacktrace requires `_Unwind_Backtrace` function. Define `_GNU_SOURCE` macro or `BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED` if _Unwind_Backtrace is available without `_GNU_SOURCE`." +#endif + namespace boost { namespace stacktrace { namespace detail { struct unwind_state { diff --git a/boost/stacktrace/detail/frame_decl.hpp b/boost/stacktrace/detail/frame_decl.hpp index 10b912113f..1919f6a4e8 100644 --- a/boost/stacktrace/detail/frame_decl.hpp +++ b/boost/stacktrace/detail/frame_decl.hpp @@ -20,7 +20,7 @@ #include // boost::stacktrace::detail::native_frame_ptr_t #include -#include +#include /// @file boost/stacktrace/detail/frame_decl.hpp /// Use header instead of this one! @@ -154,6 +154,6 @@ namespace detail { }} // namespace boost::stacktrace -#include +#include #endif // BOOST_STACKTRACE_DETAIL_FRAME_DECL_HPP diff --git a/boost/stacktrace/detail/frame_msvc.ipp b/boost/stacktrace/detail/frame_msvc.ipp index 6719598b33..6110524568 100644 --- a/boost/stacktrace/detail/frame_msvc.ipp +++ b/boost/stacktrace/detail/frame_msvc.ipp @@ -164,7 +164,7 @@ public: #else #ifdef BOOST_NO_CXX11_THREAD_LOCAL -# error Your compiler does not support C++11 thread_local storage. It's impossible to build with BOOST_STACKTRACE_USE_WINDBG_CACHED. +# error Your compiler does not support C++11 thread_local storage. It`s impossible to build with BOOST_STACKTRACE_USE_WINDBG_CACHED. #endif static com_holder< ::IDebugSymbols>& get_thread_local_debug_inst() BOOST_NOEXCEPT { diff --git a/boost/stacktrace/detail/pop_options.h b/boost/stacktrace/detail/pop_options.h new file mode 100644 index 0000000000..8995b00ada --- /dev/null +++ b/boost/stacktrace/detail/pop_options.h @@ -0,0 +1,12 @@ +// Copyright Antony Polukhin, 2016-2017. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// No include guards! Intentionally. + +#ifdef BOOST_STACKTRACE_FUNCTION +# undef BOOST_STACKTRACE_FUNCTION +#endif + diff --git a/boost/stacktrace/detail/pop_options.pp b/boost/stacktrace/detail/pop_options.pp deleted file mode 100644 index 8995b00ada..0000000000 --- a/boost/stacktrace/detail/pop_options.pp +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright Antony Polukhin, 2016-2017. -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// No include guards! Intentionally. - -#ifdef BOOST_STACKTRACE_FUNCTION -# undef BOOST_STACKTRACE_FUNCTION -#endif - diff --git a/boost/stacktrace/detail/push_options.h b/boost/stacktrace/detail/push_options.h new file mode 100644 index 0000000000..3adb626121 --- /dev/null +++ b/boost/stacktrace/detail/push_options.h @@ -0,0 +1,31 @@ +// Copyright Antony Polukhin, 2016-2017. +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// No include guards! Intentionally. + +// Link or header only +#if !defined(BOOST_STACKTRACE_LINK) && defined(BOOST_STACKTRACE_DYN_LINK) +# define BOOST_STACKTRACE_LINK +#endif + +#if defined(BOOST_STACKTRACE_LINK) && !defined(BOOST_STACKTRACE_DYN_LINK) && defined(BOOST_ALL_DYN_LINK) +# define BOOST_STACKTRACE_DYN_LINK +#endif + +#ifdef BOOST_STACKTRACE_LINK +# if defined(BOOST_STACKTRACE_DYN_LINK) +# ifdef BOOST_STACKTRACE_INTERNAL_BUILD_LIBS +# define BOOST_STACKTRACE_FUNCTION BOOST_SYMBOL_EXPORT +# else +# define BOOST_STACKTRACE_FUNCTION BOOST_SYMBOL_IMPORT +# endif +# else +# define BOOST_STACKTRACE_FUNCTION +# endif +#elif !defined(BOOST_STACKTRACE_DOXYGEN_INVOKED) +# define BOOST_STACKTRACE_FUNCTION inline +#endif + diff --git a/boost/stacktrace/detail/push_options.pp b/boost/stacktrace/detail/push_options.pp deleted file mode 100644 index 3adb626121..0000000000 --- a/boost/stacktrace/detail/push_options.pp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright Antony Polukhin, 2016-2017. -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// No include guards! Intentionally. - -// Link or header only -#if !defined(BOOST_STACKTRACE_LINK) && defined(BOOST_STACKTRACE_DYN_LINK) -# define BOOST_STACKTRACE_LINK -#endif - -#if defined(BOOST_STACKTRACE_LINK) && !defined(BOOST_STACKTRACE_DYN_LINK) && defined(BOOST_ALL_DYN_LINK) -# define BOOST_STACKTRACE_DYN_LINK -#endif - -#ifdef BOOST_STACKTRACE_LINK -# if defined(BOOST_STACKTRACE_DYN_LINK) -# ifdef BOOST_STACKTRACE_INTERNAL_BUILD_LIBS -# define BOOST_STACKTRACE_FUNCTION BOOST_SYMBOL_EXPORT -# else -# define BOOST_STACKTRACE_FUNCTION BOOST_SYMBOL_IMPORT -# endif -# else -# define BOOST_STACKTRACE_FUNCTION -# endif -#elif !defined(BOOST_STACKTRACE_DOXYGEN_INVOKED) -# define BOOST_STACKTRACE_FUNCTION inline -#endif - diff --git a/boost/stacktrace/frame.hpp b/boost/stacktrace/frame.hpp index 4ad3c507f3..8a1b426d7a 100644 --- a/boost/stacktrace/frame.hpp +++ b/boost/stacktrace/frame.hpp @@ -20,7 +20,7 @@ #include // boost::stacktrace::detail::native_frame_ptr_t #include -#include +#include namespace boost { namespace stacktrace { @@ -50,7 +50,7 @@ std::basic_ostream& operator<<(std::basic_ostream +#include #ifndef BOOST_STACKTRACE_LINK # if defined(BOOST_STACKTRACE_USE_NOOP) diff --git a/boost/stacktrace/safe_dump_to.hpp b/boost/stacktrace/safe_dump_to.hpp index 79981dabea..65a5c9e424 100644 --- a/boost/stacktrace/safe_dump_to.hpp +++ b/boost/stacktrace/safe_dump_to.hpp @@ -12,7 +12,7 @@ # pragma once #endif -#include +#include #ifdef BOOST_INTEL # pragma warning(push) @@ -195,7 +195,7 @@ BOOST_FORCEINLINE std::size_t safe_dump_to(std::size_t skip, std::size_t max_dep # pragma warning(pop) #endif -#include +#include #if !defined(BOOST_STACKTRACE_LINK) || defined(BOOST_STACKTRACE_INTERNAL_BUILD_LIBS) # if defined(BOOST_STACKTRACE_USE_NOOP) diff --git a/boost/thread/win32/condition_variable.hpp b/boost/thread/win32/condition_variable.hpp index f4b535f74b..7f670bb990 100644 --- a/boost/thread/win32/condition_variable.hpp +++ b/boost/thread/win32/condition_variable.hpp @@ -211,7 +211,7 @@ namespace boost {} #endif - void remove_waiter() + void remove_waiter_and_reset() { if (entry) { boost::lock_guard internal_lock(internal_mutex); @@ -221,7 +221,7 @@ namespace boost } ~entry_manager() BOOST_NOEXCEPT_IF(false) { - remove_waiter(); + remove_waiter_and_reset(); } list_entry* operator->() @@ -250,7 +250,7 @@ namespace boost woken=entry->woken(); } // do it here to avoid throwing on the destructor - entry->remove_waiter(); + entry.remove_waiter_and_reset(); locker.lock(); return woken; } diff --git a/boost/version.hpp b/boost/version.hpp index 725165f44d..53de342e96 100644 --- a/boost/version.hpp +++ b/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 106500 +#define BOOST_VERSION 106501 // // 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_65" +#define BOOST_LIB_VERSION "1_65_1" #endif -- cgit v1.2.3