From b1ad9a7c03febdebd50fdaedc42c08d114432e6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Mon, 25 Oct 2010 19:16:53 +0000 Subject: [PATCH] update boost to 1.43: remove obsolete files, update .cpp git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35838 a592a061-630c-0410-9148-cb99ea01b6c8 --- boost/boost/detail/atomic_count_gcc.hpp | 68 --- boost/boost/detail/atomic_count_gcc_x86.hpp | 84 ---- boost/boost/detail/atomic_count_pthreads.hpp | 96 ---- boost/boost/detail/atomic_count_solaris.hpp | 59 --- boost/boost/detail/atomic_count_sync.hpp | 57 --- boost/boost/detail/atomic_count_win32.hpp | 63 --- boost/boost/detail/bad_weak_ptr.hpp | 59 --- boost/boost/detail/lwm_nop.hpp | 37 -- boost/boost/detail/lwm_pthreads.hpp | 86 ---- boost/boost/detail/lwm_win32_cs.hpp | 108 ----- boost/boost/detail/shared_array_nmt.hpp | 151 ------- boost/boost/detail/shared_count.hpp | 412 ------------------ boost/boost/detail/shared_ptr_nmt.hpp | 182 -------- boost/boost/detail/sp_convertible.hpp | 76 ---- boost/boost/detail/sp_counted_base.hpp | 66 --- .../boost/detail/sp_counted_base_acc_ia64.hpp | 150 ------- boost/boost/detail/sp_counted_base_cw_ppc.hpp | 170 -------- boost/boost/detail/sp_counted_base_cw_x86.hpp | 158 ------- .../boost/detail/sp_counted_base_gcc_ia64.hpp | 157 ------- .../boost/detail/sp_counted_base_gcc_ppc.hpp | 181 -------- .../detail/sp_counted_base_gcc_sparc.hpp | 166 ------- .../boost/detail/sp_counted_base_gcc_x86.hpp | 173 -------- boost/boost/detail/sp_counted_base_nt.hpp | 107 ----- boost/boost/detail/sp_counted_base_pt.hpp | 135 ------ .../boost/detail/sp_counted_base_solaris.hpp | 113 ----- boost/boost/detail/sp_counted_base_spin.hpp | 131 ------ boost/boost/detail/sp_counted_base_sync.hpp | 155 ------- boost/boost/detail/sp_counted_base_w32.hpp | 130 ------ boost/boost/detail/sp_counted_impl.hpp | 231 ---------- boost/boost/detail/spinlock.hpp | 47 -- boost/boost/detail/spinlock_gcc_arm.hpp | 85 ---- boost/boost/detail/spinlock_nt.hpp | 89 ---- boost/boost/detail/spinlock_pool.hpp | 87 ---- boost/boost/detail/spinlock_pt.hpp | 79 ---- boost/boost/detail/spinlock_sync.hpp | 87 ---- boost/boost/detail/spinlock_w32.hpp | 113 ----- boost/boost/detail/yield_k.hpp | 149 ------- boost/boost/exception/detail/cloning_base.hpp | 38 -- boost/boost/exception/detail/counted_base.hpp | 49 --- .../exception/detail/exception_ptr_base.hpp | 33 -- boost/boost/property_map.hpp | 19 - boost/boost/property_map_iterator.hpp | 19 - boost/boost/regex/v4/regex_cstring.hpp | 123 ------ boost/boost/regex/v4/regex_kmp.hpp | 108 ----- boost/boost/regex/v4/regex_stack.hpp | 225 ---------- boost/libs/regex/src/c_regex_traits.cpp | 10 +- boost/libs/regex/src/icu.cpp | 18 +- boost/libs/regex/src/w32_regex_traits.cpp | 108 ++--- boost/libs/regex/src/wc_regex_traits.cpp | 10 +- 49 files changed, 73 insertions(+), 5184 deletions(-) delete mode 100644 boost/boost/detail/atomic_count_gcc.hpp delete mode 100755 boost/boost/detail/atomic_count_gcc_x86.hpp delete mode 100644 boost/boost/detail/atomic_count_pthreads.hpp delete mode 100755 boost/boost/detail/atomic_count_solaris.hpp delete mode 100755 boost/boost/detail/atomic_count_sync.hpp delete mode 100644 boost/boost/detail/atomic_count_win32.hpp delete mode 100644 boost/boost/detail/bad_weak_ptr.hpp delete mode 100644 boost/boost/detail/lwm_nop.hpp delete mode 100644 boost/boost/detail/lwm_pthreads.hpp delete mode 100644 boost/boost/detail/lwm_win32_cs.hpp delete mode 100644 boost/boost/detail/shared_array_nmt.hpp delete mode 100644 boost/boost/detail/shared_count.hpp delete mode 100644 boost/boost/detail/shared_ptr_nmt.hpp delete mode 100755 boost/boost/detail/sp_convertible.hpp delete mode 100644 boost/boost/detail/sp_counted_base.hpp delete mode 100755 boost/boost/detail/sp_counted_base_acc_ia64.hpp delete mode 100644 boost/boost/detail/sp_counted_base_cw_ppc.hpp delete mode 100755 boost/boost/detail/sp_counted_base_cw_x86.hpp delete mode 100644 boost/boost/detail/sp_counted_base_gcc_ia64.hpp delete mode 100644 boost/boost/detail/sp_counted_base_gcc_ppc.hpp delete mode 100755 boost/boost/detail/sp_counted_base_gcc_sparc.hpp delete mode 100644 boost/boost/detail/sp_counted_base_gcc_x86.hpp delete mode 100644 boost/boost/detail/sp_counted_base_nt.hpp delete mode 100644 boost/boost/detail/sp_counted_base_pt.hpp delete mode 100755 boost/boost/detail/sp_counted_base_solaris.hpp delete mode 100755 boost/boost/detail/sp_counted_base_spin.hpp delete mode 100755 boost/boost/detail/sp_counted_base_sync.hpp delete mode 100644 boost/boost/detail/sp_counted_base_w32.hpp delete mode 100644 boost/boost/detail/sp_counted_impl.hpp delete mode 100755 boost/boost/detail/spinlock.hpp delete mode 100755 boost/boost/detail/spinlock_gcc_arm.hpp delete mode 100755 boost/boost/detail/spinlock_nt.hpp delete mode 100755 boost/boost/detail/spinlock_pool.hpp delete mode 100755 boost/boost/detail/spinlock_pt.hpp delete mode 100755 boost/boost/detail/spinlock_sync.hpp delete mode 100755 boost/boost/detail/spinlock_w32.hpp delete mode 100755 boost/boost/detail/yield_k.hpp delete mode 100755 boost/boost/exception/detail/cloning_base.hpp delete mode 100755 boost/boost/exception/detail/counted_base.hpp delete mode 100644 boost/boost/exception/detail/exception_ptr_base.hpp delete mode 100644 boost/boost/property_map.hpp delete mode 100644 boost/boost/property_map_iterator.hpp delete mode 100644 boost/boost/regex/v4/regex_cstring.hpp delete mode 100644 boost/boost/regex/v4/regex_kmp.hpp delete mode 100644 boost/boost/regex/v4/regex_stack.hpp diff --git a/boost/boost/detail/atomic_count_gcc.hpp b/boost/boost/detail/atomic_count_gcc.hpp deleted file mode 100644 index 1160e44dff..0000000000 --- a/boost/boost/detail/atomic_count_gcc.hpp +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED -#define BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED - -// -// boost/detail/atomic_count_gcc.hpp -// -// atomic_count for GNU libstdc++ v3 -// -// http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html -// -// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. -// Copyright (c) 2002 Lars Gullik Bjønnes -// Copyright 2003-2005 Peter Dimov -// -// 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) -// - -#include - -namespace boost -{ - -namespace detail -{ - -#if defined(__GLIBCXX__) // g++ 3.4+ - -using __gnu_cxx::__atomic_add; -using __gnu_cxx::__exchange_and_add; - -#endif - -class atomic_count -{ -public: - - explicit atomic_count(long v) : value_(v) {} - - void operator++() - { - __atomic_add(&value_, 1); - } - - long operator--() - { - return __exchange_and_add(&value_, -1) - 1; - } - - operator long() const - { - return __exchange_and_add(&value_, 0); - } - -private: - - atomic_count(atomic_count const &); - atomic_count & operator=(atomic_count const &); - - mutable _Atomic_word value_; -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED diff --git a/boost/boost/detail/atomic_count_gcc_x86.hpp b/boost/boost/detail/atomic_count_gcc_x86.hpp deleted file mode 100755 index 1312e8ce8f..0000000000 --- a/boost/boost/detail/atomic_count_gcc_x86.hpp +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef BOOST_DETAIL_ATOMIC_COUNT_GCC_X86_HPP_INCLUDED -#define BOOST_DETAIL_ATOMIC_COUNT_GCC_X86_HPP_INCLUDED - -// -// boost/detail/atomic_count_gcc_x86.hpp -// -// atomic_count for g++ on 486+/AMD64 -// -// Copyright 2007 Peter Dimov -// -// 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) -// - -namespace boost -{ - -namespace detail -{ - -class atomic_count -{ -public: - - explicit atomic_count( long v ) : value_( static_cast< int >( v ) ) {} - - void operator++() - { - __asm__ - ( - "lock\n\t" - "incl %0": - "+m"( value_ ): // output (%0) - : // inputs - "cc" // clobbers - ); - } - - long operator--() - { - return atomic_exchange_and_add( &value_, -1 ) - 1; - } - - operator long() const - { - return atomic_exchange_and_add( &value_, 0 ); - } - -private: - - atomic_count(atomic_count const &); - atomic_count & operator=(atomic_count const &); - - mutable int value_; - -private: - - static int atomic_exchange_and_add( int * pw, int dv ) - { - // int r = *pw; - // *pw += dv; - // return r; - - int r; - - __asm__ __volatile__ - ( - "lock\n\t" - "xadd %1, %0": - "+m"( *pw ), "=r"( r ): // outputs (%0, %1) - "1"( dv ): // inputs (%2 == %1) - "memory", "cc" // clobbers - ); - - return r; - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_SYNC_HPP_INCLUDED diff --git a/boost/boost/detail/atomic_count_pthreads.hpp b/boost/boost/detail/atomic_count_pthreads.hpp deleted file mode 100644 index 7ed055f7d6..0000000000 --- a/boost/boost/detail/atomic_count_pthreads.hpp +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED -#define BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED - -// -// boost/detail/atomic_count_pthreads.hpp -// -// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. -// -// 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) -// - -#include - -// -// The generic pthread_mutex-based implementation sometimes leads to -// inefficiencies. Example: a class with two atomic_count members -// can get away with a single mutex. -// -// Users can detect this situation by checking BOOST_AC_USE_PTHREADS. -// - -namespace boost -{ - -namespace detail -{ - -class atomic_count -{ -private: - - class scoped_lock - { - public: - - scoped_lock(pthread_mutex_t & m): m_(m) - { - pthread_mutex_lock(&m_); - } - - ~scoped_lock() - { - pthread_mutex_unlock(&m_); - } - - private: - - pthread_mutex_t & m_; - }; - -public: - - explicit atomic_count(long v): value_(v) - { - pthread_mutex_init(&mutex_, 0); - } - - ~atomic_count() - { - pthread_mutex_destroy(&mutex_); - } - - void operator++() - { - scoped_lock lock(mutex_); - ++value_; - } - - long operator--() - { - scoped_lock lock(mutex_); - return --value_; - } - - operator long() const - { - scoped_lock lock(mutex_); - return value_; - } - -private: - - atomic_count(atomic_count const &); - atomic_count & operator=(atomic_count const &); - - mutable pthread_mutex_t mutex_; - long value_; -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED diff --git a/boost/boost/detail/atomic_count_solaris.hpp b/boost/boost/detail/atomic_count_solaris.hpp deleted file mode 100755 index 8e2907fc76..0000000000 --- a/boost/boost/detail/atomic_count_solaris.hpp +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef BOOST_DETAIL_ATOMIC_COUNT_SOLARIS_HPP_INCLUDED -#define BOOST_DETAIL_ATOMIC_COUNT_SOLARIS_HPP_INCLUDED - -// -// boost/detail/atomic_count_solaris.hpp -// based on: boost/detail/atomic_count_win32.hpp -// -// Copyright (c) 2001-2005 Peter Dimov -// Copyright (c) 2006 Michael van der Westhuizen -// -// 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) -// - -#include - -namespace boost -{ - -namespace detail -{ - -class atomic_count -{ -public: - - explicit atomic_count( uint32_t v ): value_( v ) - { - } - - long operator++() - { - return atomic_inc_32_nv( &value_ ); - } - - long operator--() - { - return atomic_dec_32_nv( &value_ ); - } - - operator uint32_t() const - { - return static_cast( value_ ); - } - -private: - - atomic_count( atomic_count const & ); - atomic_count & operator=( atomic_count const & ); - - uint32_t value_; -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_SOLARIS_HPP_INCLUDED diff --git a/boost/boost/detail/atomic_count_sync.hpp b/boost/boost/detail/atomic_count_sync.hpp deleted file mode 100755 index e973fb7255..0000000000 --- a/boost/boost/detail/atomic_count_sync.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef BOOST_DETAIL_ATOMIC_COUNT_SYNC_HPP_INCLUDED -#define BOOST_DETAIL_ATOMIC_COUNT_SYNC_HPP_INCLUDED - -// -// boost/detail/atomic_count_sync.hpp -// -// atomic_count for g++ 4.1+ -// -// http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html -// -// Copyright 2007 Peter Dimov -// -// 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) -// - -namespace boost -{ - -namespace detail -{ - -class atomic_count -{ -public: - - explicit atomic_count( long v ) : value_( v ) {} - - void operator++() - { - __sync_add_and_fetch( &value_, 1 ); - } - - long operator--() - { - return __sync_add_and_fetch( &value_, -1 ); - } - - operator long() const - { - return __sync_fetch_and_add( &value_, 0 ); - } - -private: - - atomic_count(atomic_count const &); - atomic_count & operator=(atomic_count const &); - - mutable long value_; -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_SYNC_HPP_INCLUDED diff --git a/boost/boost/detail/atomic_count_win32.hpp b/boost/boost/detail/atomic_count_win32.hpp deleted file mode 100644 index 0de25377fa..0000000000 --- a/boost/boost/detail/atomic_count_win32.hpp +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED -#define BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// boost/detail/atomic_count_win32.hpp -// -// Copyright (c) 2001-2005 Peter Dimov -// -// 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) -// - -#include - -namespace boost -{ - -namespace detail -{ - -class atomic_count -{ -public: - - explicit atomic_count( long v ): value_( v ) - { - } - - long operator++() - { - return BOOST_INTERLOCKED_INCREMENT( &value_ ); - } - - long operator--() - { - return BOOST_INTERLOCKED_DECREMENT( &value_ ); - } - - operator long() const - { - return static_cast( value_ ); - } - -private: - - atomic_count( atomic_count const & ); - atomic_count & operator=( atomic_count const & ); - - long value_; -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED diff --git a/boost/boost/detail/bad_weak_ptr.hpp b/boost/boost/detail/bad_weak_ptr.hpp deleted file mode 100644 index 93ecec9b69..0000000000 --- a/boost/boost/detail/bad_weak_ptr.hpp +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef BOOST_BAD_WEAK_PTR_HPP_INCLUDED -#define BOOST_BAD_WEAK_PTR_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/bad_weak_ptr.hpp -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// -// 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) -// - -#include - -#ifdef __BORLANDC__ -# pragma warn -8026 // Functions with excep. spec. are not expanded inline -#endif - -namespace boost -{ - -// The standard library that comes with Borland C++ 5.5.1, 5.6.4 -// defines std::exception and its members as having C calling -// convention (-pc). When the definition of bad_weak_ptr -// is compiled with -ps, the compiler issues an error. -// Hence, the temporary #pragma option -pc below. - -#if defined(__BORLANDC__) && __BORLANDC__ <= 0x564 -# pragma option push -pc -#endif - -class bad_weak_ptr: public std::exception -{ -public: - - virtual char const * what() const throw() - { - return "tr1::bad_weak_ptr"; - } -}; - -#if defined(__BORLANDC__) && __BORLANDC__ <= 0x564 -# pragma option pop -#endif - -} // namespace boost - -#ifdef __BORLANDC__ -# pragma warn .8026 // Functions with excep. spec. are not expanded inline -#endif - -#endif // #ifndef BOOST_BAD_WEAK_PTR_HPP_INCLUDED diff --git a/boost/boost/detail/lwm_nop.hpp b/boost/boost/detail/lwm_nop.hpp deleted file mode 100644 index c73ab68f5e..0000000000 --- a/boost/boost/detail/lwm_nop.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef BOOST_DETAIL_LWM_NOP_HPP_INCLUDED -#define BOOST_DETAIL_LWM_NOP_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// boost/detail/lwm_nop.hpp -// -// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. -// -// 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) -// - -namespace boost -{ - -namespace detail -{ - -class lightweight_mutex -{ -public: - - typedef lightweight_mutex scoped_lock; -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_LWM_NOP_HPP_INCLUDED diff --git a/boost/boost/detail/lwm_pthreads.hpp b/boost/boost/detail/lwm_pthreads.hpp deleted file mode 100644 index a5bf75bde7..0000000000 --- a/boost/boost/detail/lwm_pthreads.hpp +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED -#define BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// boost/detail/lwm_pthreads.hpp -// -// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. -// -// 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) -// - -#include - -namespace boost -{ - -namespace detail -{ - -class lightweight_mutex -{ -private: - - pthread_mutex_t m_; - - lightweight_mutex(lightweight_mutex const &); - lightweight_mutex & operator=(lightweight_mutex const &); - -public: - - lightweight_mutex() - { - -// HPUX 10.20 / DCE has a nonstandard pthread_mutex_init - -#if defined(__hpux) && defined(_DECTHREADS_) - pthread_mutex_init(&m_, pthread_mutexattr_default); -#else - pthread_mutex_init(&m_, 0); -#endif - } - - ~lightweight_mutex() - { - pthread_mutex_destroy(&m_); - } - - class scoped_lock; - friend class scoped_lock; - - class scoped_lock - { - private: - - pthread_mutex_t & m_; - - scoped_lock(scoped_lock const &); - scoped_lock & operator=(scoped_lock const &); - - public: - - scoped_lock(lightweight_mutex & m): m_(m.m_) - { - pthread_mutex_lock(&m_); - } - - ~scoped_lock() - { - pthread_mutex_unlock(&m_); - } - }; -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED diff --git a/boost/boost/detail/lwm_win32_cs.hpp b/boost/boost/detail/lwm_win32_cs.hpp deleted file mode 100644 index 8142069e67..0000000000 --- a/boost/boost/detail/lwm_win32_cs.hpp +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED -#define BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// boost/detail/lwm_win32_cs.hpp -// -// Copyright (c) 2002, 2003 Peter Dimov -// -// 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) -// - -#ifdef BOOST_USE_WINDOWS_H -# include -#endif - -namespace boost -{ - -namespace detail -{ - -#ifndef BOOST_USE_WINDOWS_H - -struct critical_section -{ - struct critical_section_debug * DebugInfo; - long LockCount; - long RecursionCount; - void * OwningThread; - void * LockSemaphore; -#if defined(_WIN64) - unsigned __int64 SpinCount; -#else - unsigned long SpinCount; -#endif -}; - -extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(critical_section *); -extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(critical_section *); -extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(critical_section *); -extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(critical_section *); - -#else - -typedef ::CRITICAL_SECTION critical_section; - -#endif // #ifndef BOOST_USE_WINDOWS_H - -class lightweight_mutex -{ -private: - - critical_section cs_; - - lightweight_mutex(lightweight_mutex const &); - lightweight_mutex & operator=(lightweight_mutex const &); - -public: - - lightweight_mutex() - { - InitializeCriticalSection(&cs_); - } - - ~lightweight_mutex() - { - DeleteCriticalSection(&cs_); - } - - class scoped_lock; - friend class scoped_lock; - - class scoped_lock - { - private: - - lightweight_mutex & m_; - - scoped_lock(scoped_lock const &); - scoped_lock & operator=(scoped_lock const &); - - public: - - explicit scoped_lock(lightweight_mutex & m): m_(m) - { - EnterCriticalSection(&m_.cs_); - } - - ~scoped_lock() - { - LeaveCriticalSection(&m_.cs_); - } - }; -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED diff --git a/boost/boost/detail/shared_array_nmt.hpp b/boost/boost/detail/shared_array_nmt.hpp deleted file mode 100644 index 13ca6aca15..0000000000 --- a/boost/boost/detail/shared_array_nmt.hpp +++ /dev/null @@ -1,151 +0,0 @@ -#ifndef BOOST_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED -#define BOOST_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED - -// -// detail/shared_array_nmt.hpp - shared_array.hpp without member templates -// -// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. -// Copyright (c) 2001, 2002 Peter Dimov -// -// 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) -// -// See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation. -// - -#include -#include -#include -#include - -#include // for std::ptrdiff_t -#include // for std::swap -#include // for std::less -#include // for std::bad_alloc - -namespace boost -{ - -template class shared_array -{ -private: - - typedef detail::atomic_count count_type; - -public: - - typedef T element_type; - - explicit shared_array(T * p = 0): px(p) - { -#ifndef BOOST_NO_EXCEPTIONS - - try // prevent leak if new throws - { - pn = new count_type(1); - } - catch(...) - { - boost::checked_array_delete(p); - throw; - } - -#else - - pn = new count_type(1); - - if(pn == 0) - { - boost::checked_array_delete(p); - boost::throw_exception(std::bad_alloc()); - } - -#endif - } - - ~shared_array() - { - if(--*pn == 0) - { - boost::checked_array_delete(px); - delete pn; - } - } - - shared_array(shared_array const & r) : px(r.px) // never throws - { - pn = r.pn; - ++*pn; - } - - shared_array & operator=(shared_array const & r) - { - shared_array(r).swap(*this); - return *this; - } - - void reset(T * p = 0) - { - BOOST_ASSERT(p == 0 || p != px); - shared_array(p).swap(*this); - } - - T * get() const // never throws - { - return px; - } - - T & operator[](std::ptrdiff_t i) const // never throws - { - BOOST_ASSERT(px != 0); - BOOST_ASSERT(i >= 0); - return px[i]; - } - - long use_count() const // never throws - { - return *pn; - } - - bool unique() const // never throws - { - return *pn == 1; - } - - void swap(shared_array & other) // never throws - { - std::swap(px, other.px); - std::swap(pn, other.pn); - } - -private: - - T * px; // contained pointer - count_type * pn; // ptr to reference counter - -}; // shared_array - -template inline bool operator==(shared_array const & a, shared_array const & b) -{ - return a.get() == b.get(); -} - -template inline bool operator!=(shared_array const & a, shared_array const & b) -{ - return a.get() != b.get(); -} - -template inline bool operator<(shared_array const & a, shared_array const & b) -{ - return std::less()(a.get(), b.get()); -} - -template void swap(shared_array & a, shared_array & b) -{ - a.swap(b); -} - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED diff --git a/boost/boost/detail/shared_count.hpp b/boost/boost/detail/shared_count.hpp deleted file mode 100644 index 8f1377701e..0000000000 --- a/boost/boost/detail/shared_count.hpp +++ /dev/null @@ -1,412 +0,0 @@ -#ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED -#define BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/shared_count.hpp -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// -// 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) -// - -#ifdef __BORLANDC__ -# pragma warn -8027 // Functions containing try are not expanded inline -#endif - -#include -#include -#include -#include -#include -#include -// In order to avoid circular dependencies with Boost.TR1 -// we make sure that our include of doesn't try to -// pull in the TR1 headers: that's why we use this header -// rather than including directly: -#include // std::auto_ptr -#include // std::less -#include // std::bad_alloc - -namespace boost -{ - -namespace detail -{ - -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - -int const shared_count_id = 0x2C35F101; -int const weak_count_id = 0x298C38A4; - -#endif - -struct sp_nothrow_tag {}; - -class weak_count; - -class shared_count -{ -private: - - sp_counted_base * pi_; - -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - int id_; -#endif - - friend class weak_count; - -public: - - shared_count(): pi_(0) // nothrow -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif - { - } - - template explicit shared_count( Y * p ): pi_( 0 ) -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif - { -#ifndef BOOST_NO_EXCEPTIONS - - try - { - pi_ = new sp_counted_impl_p( p ); - } - catch(...) - { - boost::checked_delete( p ); - throw; - } - -#else - - pi_ = new sp_counted_impl_p( p ); - - if( pi_ == 0 ) - { - boost::checked_delete( p ); - boost::throw_exception( std::bad_alloc() ); - } - -#endif - } - -#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) - template shared_count( Y * p, D d ): pi_(0) -#else - template shared_count( P p, D d ): pi_(0) -#endif -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif - { -#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) - typedef Y* P; -#endif -#ifndef BOOST_NO_EXCEPTIONS - - try - { - pi_ = new sp_counted_impl_pd(p, d); - } - catch(...) - { - d(p); // delete p - throw; - } - -#else - - pi_ = new sp_counted_impl_pd(p, d); - - if(pi_ == 0) - { - d(p); // delete p - boost::throw_exception(std::bad_alloc()); - } - -#endif - } - - template shared_count( P p, D d, A a ): pi_( 0 ) -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif - { - typedef sp_counted_impl_pda impl_type; - typedef typename A::template rebind< impl_type >::other A2; - - A2 a2( a ); - -#ifndef BOOST_NO_EXCEPTIONS - - try - { - pi_ = a2.allocate( 1, static_cast< impl_type* >( 0 ) ); - new( static_cast< void* >( pi_ ) ) impl_type( p, d, a ); - } - catch(...) - { - d( p ); - - if( pi_ != 0 ) - { - a2.deallocate( static_cast< impl_type* >( pi_ ), 1 ); - } - - throw; - } - -#else - - pi_ = a2.allocate( 1, static_cast< impl_type* >( 0 ) ); - - if( pi_ != 0 ) - { - new( static_cast< void* >( pi_ ) ) impl_type( p, d, a ); - } - else - { - d( p ); - boost::throw_exception( std::bad_alloc() ); - } - -#endif - } - -#ifndef BOOST_NO_AUTO_PTR - - // auto_ptr is special cased to provide the strong guarantee - - template - explicit shared_count( std::auto_ptr & r ): pi_( new sp_counted_impl_p( r.get() ) ) -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif - { -#ifdef BOOST_NO_EXCEPTIONS - - if( pi_ == 0 ) - { - boost::throw_exception(std::bad_alloc()); - } - -#endif - - r.release(); - } - -#endif - - ~shared_count() // nothrow - { - if( pi_ != 0 ) pi_->release(); -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - id_ = 0; -#endif - } - - shared_count(shared_count const & r): pi_(r.pi_) // nothrow -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif - { - if( pi_ != 0 ) pi_->add_ref_copy(); - } - - explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0 - shared_count( weak_count const & r, sp_nothrow_tag ); // constructs an empty *this when r.use_count() == 0 - - shared_count & operator= (shared_count const & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - - if( tmp != pi_ ) - { - if( tmp != 0 ) tmp->add_ref_copy(); - if( pi_ != 0 ) pi_->release(); - pi_ = tmp; - } - - return *this; - } - - void swap(shared_count & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - r.pi_ = pi_; - pi_ = tmp; - } - - long use_count() const // nothrow - { - return pi_ != 0? pi_->use_count(): 0; - } - - bool unique() const // nothrow - { - return use_count() == 1; - } - - bool empty() const // nothrow - { - return pi_ == 0; - } - - friend inline bool operator==(shared_count const & a, shared_count const & b) - { - return a.pi_ == b.pi_; - } - - friend inline bool operator<(shared_count const & a, shared_count const & b) - { - return std::less()( a.pi_, b.pi_ ); - } - - void * get_deleter( sp_typeinfo const & ti ) const - { - return pi_? pi_->get_deleter( ti ): 0; - } -}; - - -class weak_count -{ -private: - - sp_counted_base * pi_; - -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - int id_; -#endif - - friend class shared_count; - -public: - - weak_count(): pi_(0) // nothrow -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(weak_count_id) -#endif - { - } - - weak_count(shared_count const & r): pi_(r.pi_) // nothrow -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif - { - if(pi_ != 0) pi_->weak_add_ref(); - } - - weak_count(weak_count const & r): pi_(r.pi_) // nothrow -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif - { - if(pi_ != 0) pi_->weak_add_ref(); - } - - ~weak_count() // nothrow - { - if(pi_ != 0) pi_->weak_release(); -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - id_ = 0; -#endif - } - - weak_count & operator= (shared_count const & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - - if( tmp != pi_ ) - { - if(tmp != 0) tmp->weak_add_ref(); - if(pi_ != 0) pi_->weak_release(); - pi_ = tmp; - } - - return *this; - } - - weak_count & operator= (weak_count const & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - - if( tmp != pi_ ) - { - if(tmp != 0) tmp->weak_add_ref(); - if(pi_ != 0) pi_->weak_release(); - pi_ = tmp; - } - - return *this; - } - - void swap(weak_count & r) // nothrow - { - sp_counted_base * tmp = r.pi_; - r.pi_ = pi_; - pi_ = tmp; - } - - long use_count() const // nothrow - { - return pi_ != 0? pi_->use_count(): 0; - } - - friend inline bool operator==(weak_count const & a, weak_count const & b) - { - return a.pi_ == b.pi_; - } - - friend inline bool operator<(weak_count const & a, weak_count const & b) - { - return std::less()(a.pi_, b.pi_); - } -}; - -inline shared_count::shared_count( weak_count const & r ): pi_( r.pi_ ) -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif -{ - if( pi_ == 0 || !pi_->add_ref_lock() ) - { - boost::throw_exception( boost::bad_weak_ptr() ); - } -} - -inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ): pi_( r.pi_ ) -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - , id_(shared_count_id) -#endif -{ - if( pi_ != 0 && !pi_->add_ref_lock() ) - { - pi_ = 0; - } -} - -} // namespace detail - -} // namespace boost - -#ifdef __BORLANDC__ -# pragma warn .8027 // Functions containing try are not expanded inline -#endif - -#endif // #ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED diff --git a/boost/boost/detail/shared_ptr_nmt.hpp b/boost/boost/detail/shared_ptr_nmt.hpp deleted file mode 100644 index 0780e305b5..0000000000 --- a/boost/boost/detail/shared_ptr_nmt.hpp +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED -#define BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED - -// -// detail/shared_ptr_nmt.hpp - shared_ptr.hpp without member templates -// -// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. -// Copyright (c) 2001, 2002 Peter Dimov -// -// 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) -// -// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. -// - -#include -#include -#include -#include - -#ifndef BOOST_NO_AUTO_PTR -# include // for std::auto_ptr -#endif - -#include // for std::swap -#include // for std::less -#include // for std::bad_alloc - -namespace boost -{ - -template class shared_ptr -{ -private: - - typedef detail::atomic_count count_type; - -public: - - typedef T element_type; - typedef T value_type; - - explicit shared_ptr(T * p = 0): px(p) - { -#ifndef BOOST_NO_EXCEPTIONS - - try // prevent leak if new throws - { - pn = new count_type(1); - } - catch(...) - { - boost::checked_delete(p); - throw; - } - -#else - - pn = new count_type(1); - - if(pn == 0) - { - boost::checked_delete(p); - boost::throw_exception(std::bad_alloc()); - } - -#endif - } - - ~shared_ptr() - { - if(--*pn == 0) - { - boost::checked_delete(px); - delete pn; - } - } - - shared_ptr(shared_ptr const & r): px(r.px) // never throws - { - pn = r.pn; - ++*pn; - } - - shared_ptr & operator=(shared_ptr const & r) - { - shared_ptr(r).swap(*this); - return *this; - } - -#ifndef BOOST_NO_AUTO_PTR - - explicit shared_ptr(std::auto_ptr & r) - { - pn = new count_type(1); // may throw - px = r.release(); // fix: moved here to stop leak if new throws - } - - shared_ptr & operator=(std::auto_ptr & r) - { - shared_ptr(r).swap(*this); - return *this; - } - -#endif - - void reset(T * p = 0) - { - BOOST_ASSERT(p == 0 || p != px); - shared_ptr(p).swap(*this); - } - - T & operator*() const // never throws - { - BOOST_ASSERT(px != 0); - return *px; - } - - T * operator->() const // never throws - { - BOOST_ASSERT(px != 0); - return px; - } - - T * get() const // never throws - { - return px; - } - - long use_count() const // never throws - { - return *pn; - } - - bool unique() const // never throws - { - return *pn == 1; - } - - void swap(shared_ptr & other) // never throws - { - std::swap(px, other.px); - std::swap(pn, other.pn); - } - -private: - - T * px; // contained pointer - count_type * pn; // ptr to reference counter -}; - -template inline bool operator==(shared_ptr const & a, shared_ptr const & b) -{ - return a.get() == b.get(); -} - -template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) -{ - return a.get() != b.get(); -} - -template inline bool operator<(shared_ptr const & a, shared_ptr const & b) -{ - return std::less()(a.get(), b.get()); -} - -template void swap(shared_ptr & a, shared_ptr & b) -{ - a.swap(b); -} - -// get_pointer() enables boost::mem_fn to recognize shared_ptr - -template inline T * get_pointer(shared_ptr const & p) -{ - return p.get(); -} - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED diff --git a/boost/boost/detail/sp_convertible.hpp b/boost/boost/detail/sp_convertible.hpp deleted file mode 100755 index 017217bc1c..0000000000 --- a/boost/boost/detail/sp_convertible.hpp +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef BOOST_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED -#define BOOST_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// detail/sp_convertible.hpp -// -// Copyright 2008 Peter Dimov -// -// 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 - -#include - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_NO_SFINAE ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ < 303 ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x600 ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - -namespace boost -{ - -namespace detail -{ - -template< class Y, class T > struct sp_convertible -{ - typedef char (&yes) [1]; - typedef char (&no) [2]; - - static yes f( T* ); - static no f( ... ); - - enum _vt { value = sizeof( f( (Y*)0 ) ) == sizeof(yes) }; -}; - -struct sp_empty -{ -}; - -template< bool > struct sp_enable_if_convertible_impl; - -template<> struct sp_enable_if_convertible_impl -{ - typedef sp_empty type; -}; - -template<> struct sp_enable_if_convertible_impl -{ -}; - -template< class Y, class T > struct sp_enable_if_convertible: public sp_enable_if_convertible_impl< sp_convertible< Y, T >::value > -{ -}; - -} // namespace detail - -} // namespace boost - -#endif // !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - -#endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base.hpp b/boost/boost/detail/sp_counted_base.hpp deleted file mode 100644 index 6d733d0c19..0000000000 --- a/boost/boost/detail/sp_counted_base.hpp +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_base.hpp -// -// Copyright 2005, 2006 Peter Dimov -// -// 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) -// - -#include - -#if defined( BOOST_SP_DISABLE_THREADS ) -# include - -#elif defined( BOOST_SP_USE_SPINLOCK ) -# include - -#elif defined( BOOST_SP_USE_PTHREADS ) -# include - -#elif defined( BOOST_DISABLE_THREADS ) && !defined( BOOST_SP_ENABLE_THREADS ) && !defined( BOOST_DISABLE_WIN32 ) -# include - -#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) -# include - -#elif defined( __GNUC__ ) && defined( __ia64__ ) && !defined( __INTEL_COMPILER ) -# include - -#elif defined(__HP_aCC) && defined(__ia64) -# include - -#elif defined( __MWERKS__ ) && defined( __POWERPC__ ) -# include - -#elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) ) -# include - -#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) && !defined( __arm__ ) && !defined( __hppa ) -# include - -#elif defined(__GNUC__) && ( defined( __sparcv8 ) || defined( __sparcv9 ) ) -# include - -#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) -# include - -#elif !defined( BOOST_HAS_THREADS ) -# include - -#else -# include - -#endif - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_acc_ia64.hpp b/boost/boost/detail/sp_counted_base_acc_ia64.hpp deleted file mode 100755 index c956b8e01d..0000000000 --- a/boost/boost/detail/sp_counted_base_acc_ia64.hpp +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_ACC_IA64_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_ACC_IA64_HPP_INCLUDED - -// -// detail/sp_counted_base_acc_ia64.hpp - aC++ on HP-UX IA64 -// -// Copyright 2007 Baruch Zilber -// Copyright 2007 Boris Gubenko -// -// 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) -// -// -// Lock-free algorithm by Alexander Terekhov -// - -#include -#include - -namespace boost -{ - -namespace detail -{ - -inline void atomic_increment( int * pw ) -{ - // ++*pw; - - _Asm_fetchadd(_FASZ_W, _SEM_REL, pw, +1, _LDHINT_NONE); -} - -inline int atomic_decrement( int * pw ) -{ - // return --*pw; - - int r = static_cast(_Asm_fetchadd(_FASZ_W, _SEM_REL, pw, -1, _LDHINT_NONE)); - if (1 == r) - { - _Asm_mf(); - } - - return r - 1; -} - -inline int atomic_conditional_increment( int * pw ) -{ - // if( *pw != 0 ) ++*pw; - // return *pw; - - int v = *pw; - - for (;;) - { - if (0 == v) - { - return 0; - } - - _Asm_mov_to_ar(_AREG_CCV, - v, - (_UP_CALL_FENCE | _UP_SYS_FENCE | _DOWN_CALL_FENCE | _DOWN_SYS_FENCE)); - int r = static_cast(_Asm_cmpxchg(_SZ_W, _SEM_ACQ, pw, v + 1, _LDHINT_NONE)); - if (r == v) - { - return r + 1; - } - - v = r; - } -} - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - int use_count_; // #shared - int weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_increment( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - return atomic_conditional_increment( &use_count_ ) != 0; - } - - void release() // nothrow - { - if( atomic_decrement( &use_count_ ) == 0 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_increment( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_decrement( &weak_count_ ) == 0 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return static_cast( use_count_ ); // TODO use ld.acq here - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_ACC_IA64_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_cw_ppc.hpp b/boost/boost/detail/sp_counted_base_cw_ppc.hpp deleted file mode 100644 index 3f43252863..0000000000 --- a/boost/boost/detail/sp_counted_base_cw_ppc.hpp +++ /dev/null @@ -1,170 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_CW_PPC_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_CW_PPC_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_base_cw_ppc.hpp - CodeWarrior on PowerPC -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// -// 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) -// -// -// Lock-free algorithm by Alexander Terekhov -// -// Thanks to Ben Hitchings for the #weak + (#shared != 0) -// formulation -// - -#include - -namespace boost -{ - -namespace detail -{ - -inline void atomic_increment( register long * pw ) -{ - register int a; - - asm - { -loop: - - lwarx a, 0, pw - addi a, a, 1 - stwcx. a, 0, pw - bne- loop - } -} - -inline long atomic_decrement( register long * pw ) -{ - register int a; - - asm - { - sync - -loop: - - lwarx a, 0, pw - addi a, a, -1 - stwcx. a, 0, pw - bne- loop - - isync - } - - return a; -} - -inline long atomic_conditional_increment( register long * pw ) -{ - register int a; - - asm - { -loop: - - lwarx a, 0, pw - cmpwi a, 0 - beq store - - addi a, a, 1 - -store: - - stwcx. a, 0, pw - bne- loop - } - - return a; -} - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - long use_count_; // #shared - long weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_increment( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - return atomic_conditional_increment( &use_count_ ) != 0; - } - - void release() // nothrow - { - if( atomic_decrement( &use_count_ ) == 0 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_increment( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_decrement( &weak_count_ ) == 0 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return static_cast( use_count_ ); - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_CW_PPC_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_cw_x86.hpp b/boost/boost/detail/sp_counted_base_cw_x86.hpp deleted file mode 100755 index b2e3f9bbd1..0000000000 --- a/boost/boost/detail/sp_counted_base_cw_x86.hpp +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_CW_X86_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_CW_X86_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_base_cw_x86.hpp - CodeWarrion on 486+ -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// Copyright 2005 Rene Rivera -// -// 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) -// -// -// Lock-free algorithm by Alexander Terekhov -// -// Thanks to Ben Hitchings for the #weak + (#shared != 0) -// formulation -// - -#include - -namespace boost -{ - -namespace detail -{ - -inline int atomic_exchange_and_add( int * pw, int dv ) -{ - // int r = *pw; - // *pw += dv; - // return r; - - asm - { - mov esi, [pw] - mov eax, dv - lock xadd dword ptr [esi], eax - } -} - -inline void atomic_increment( int * pw ) -{ - //atomic_exchange_and_add( pw, 1 ); - - asm - { - mov esi, [pw] - lock inc dword ptr [esi] - } -} - -inline int atomic_conditional_increment( int * pw ) -{ - // int rv = *pw; - // if( rv != 0 ) ++*pw; - // return rv; - - asm - { - mov esi, [pw] - mov eax, dword ptr [esi] - L0: - test eax, eax - je L1 - mov ebx, eax - inc ebx - lock cmpxchg dword ptr [esi], ebx - jne L0 - L1: - } -} - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - int use_count_; // #shared - int weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_increment( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - return atomic_conditional_increment( &use_count_ ) != 0; - } - - void release() // nothrow - { - if( atomic_exchange_and_add( &use_count_, -1 ) == 1 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_increment( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_exchange_and_add( &weak_count_, -1 ) == 1 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return static_cast( use_count_ ); - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_gcc_ia64.hpp b/boost/boost/detail/sp_counted_base_gcc_ia64.hpp deleted file mode 100644 index 7535295d2b..0000000000 --- a/boost/boost/detail/sp_counted_base_gcc_ia64.hpp +++ /dev/null @@ -1,157 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_IA64_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_GCC_IA64_HPP_INCLUDED - -// -// detail/sp_counted_base_gcc_ia64.hpp - g++ on IA64 -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2006 Peter Dimov -// Copyright 2005 Ben Hutchings -// -// 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) -// -// -// Lock-free algorithm by Alexander Terekhov -// - -#include - -namespace boost -{ - -namespace detail -{ - -inline void atomic_increment( int * pw ) -{ - // ++*pw; - - int tmp; - - // No barrier is required here but fetchadd always has an acquire or - // release barrier associated with it. We choose release as it should be - // cheaper. - __asm__ ("fetchadd4.rel %0=%1,1" : - "=r"(tmp), "=m"(*pw) : - "m"( *pw )); -} - -inline int atomic_decrement( int * pw ) -{ - // return --*pw; - - int rv; - - __asm__ (" fetchadd4.rel %0=%1,-1 ;; \n" - " cmp.eq p7,p0=1,%0 ;; \n" - "(p7) ld4.acq %0=%1 " : - "=&r"(rv), "=m"(*pw) : - "m"( *pw ) : - "p7"); - - return rv; -} - -inline int atomic_conditional_increment( int * pw ) -{ - // if( *pw != 0 ) ++*pw; - // return *pw; - - int rv, tmp, tmp2; - - __asm__ ("0: ld4 %0=%3 ;; \n" - " cmp.eq p7,p0=0,%0 ;; \n" - "(p7) br.cond.spnt 1f \n" - " mov ar.ccv=%0 \n" - " add %1=1,%0 ;; \n" - " cmpxchg4.acq %2=%3,%1,ar.ccv ;; \n" - " cmp.ne p7,p0=%0,%2 ;; \n" - "(p7) br.cond.spnt 0b \n" - " mov %0=%1 ;; \n" - "1:" : - "=&r"(rv), "=&r"(tmp), "=&r"(tmp2), "=m"(*pw) : - "m"( *pw ) : - "ar.ccv", "p7"); - - return rv; -} - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - int use_count_; // #shared - int weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_increment( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - return atomic_conditional_increment( &use_count_ ) != 0; - } - - void release() // nothrow - { - if( atomic_decrement( &use_count_ ) == 0 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_increment( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_decrement( &weak_count_ ) == 0 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return static_cast( use_count_ ); // TODO use ld.acq here - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_IA64_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_gcc_ppc.hpp b/boost/boost/detail/sp_counted_base_gcc_ppc.hpp deleted file mode 100644 index cea2740bca..0000000000 --- a/boost/boost/detail/sp_counted_base_gcc_ppc.hpp +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_PPC_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_GCC_PPC_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_base_gcc_ppc.hpp - g++ on PowerPC -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// -// 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) -// -// -// Lock-free algorithm by Alexander Terekhov -// -// Thanks to Ben Hitchings for the #weak + (#shared != 0) -// formulation -// - -#include - -namespace boost -{ - -namespace detail -{ - -inline void atomic_increment( int * pw ) -{ - // ++*pw; - - int tmp; - - __asm__ - ( - "0:\n\t" - "lwarx %1, 0, %2\n\t" - "addi %1, %1, 1\n\t" - "stwcx. %1, 0, %2\n\t" - "bne- 0b": - - "=m"( *pw ), "=&b"( tmp ): - "r"( pw ), "m"( *pw ): - "cc" - ); -} - -inline int atomic_decrement( int * pw ) -{ - // return --*pw; - - int rv; - - __asm__ __volatile__ - ( - "sync\n\t" - "0:\n\t" - "lwarx %1, 0, %2\n\t" - "addi %1, %1, -1\n\t" - "stwcx. %1, 0, %2\n\t" - "bne- 0b\n\t" - "isync": - - "=m"( *pw ), "=&b"( rv ): - "r"( pw ), "m"( *pw ): - "memory", "cc" - ); - - return rv; -} - -inline int atomic_conditional_increment( int * pw ) -{ - // if( *pw != 0 ) ++*pw; - // return *pw; - - int rv; - - __asm__ - ( - "0:\n\t" - "lwarx %1, 0, %2\n\t" - "cmpwi %1, 0\n\t" - "beq 1f\n\t" - "addi %1, %1, 1\n\t" - "1:\n\t" - "stwcx. %1, 0, %2\n\t" - "bne- 0b": - - "=m"( *pw ), "=&b"( rv ): - "r"( pw ), "m"( *pw ): - "cc" - ); - - return rv; -} - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - int use_count_; // #shared - int weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_increment( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - return atomic_conditional_increment( &use_count_ ) != 0; - } - - void release() // nothrow - { - if( atomic_decrement( &use_count_ ) == 0 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_increment( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_decrement( &weak_count_ ) == 0 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return static_cast( use_count_ ); - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_PPC_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_gcc_sparc.hpp b/boost/boost/detail/sp_counted_base_gcc_sparc.hpp deleted file mode 100755 index 2afca168d4..0000000000 --- a/boost/boost/detail/sp_counted_base_gcc_sparc.hpp +++ /dev/null @@ -1,166 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_SPARC_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_GCC_SPARC_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// detail/sp_counted_base_gcc_sparc.hpp - g++ on Sparc V8+ -// -// Copyright (c) 2006 Piotr Wyderski -// Copyright (c) 2006 Tomas Puverle -// Copyright (c) 2006 Peter Dimov -// -// 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 -// -// Thanks to Michael van der Westhuizen - -#include -#include // int32_t - -namespace boost -{ - -namespace detail -{ - -inline int32_t compare_and_swap( int32_t * dest_, int32_t compare_, int32_t swap_ ) -{ - __asm__ __volatile__( "cas %0, %2, %1" - : "+m" (*dest_), "+r" (swap_) - : "r" (compare_) - : "memory" ); - - return swap_; -} - -inline int32_t atomic_fetch_and_add( int32_t * pw, int32_t dv ) -{ - // long r = *pw; - // *pw += dv; - // return r; - - for( ;; ) - { - int32_t r = *pw; - - if( __builtin_expect((compare_and_swap(pw, r, r + dv) == r), 1) ) - { - return r; - } - } -} - -inline void atomic_increment( int32_t * pw ) -{ - atomic_fetch_and_add( pw, 1 ); -} - -inline int32_t atomic_decrement( int32_t * pw ) -{ - return atomic_fetch_and_add( pw, -1 ); -} - -inline int32_t atomic_conditional_increment( int32_t * pw ) -{ - // long r = *pw; - // if( r != 0 ) ++*pw; - // return r; - - for( ;; ) - { - int32_t r = *pw; - - if( r == 0 ) - { - return r; - } - - if( __builtin_expect( ( compare_and_swap( pw, r, r + 1 ) == r ), 1 ) ) - { - return r; - } - } -} - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - int32_t use_count_; // #shared - int32_t weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_increment( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - return atomic_conditional_increment( &use_count_ ) != 0; - } - - void release() // nothrow - { - if( atomic_decrement( &use_count_ ) == 1 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_increment( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_decrement( &weak_count_ ) == 1 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return const_cast< int32_t const volatile & >( use_count_ ); - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_SPARC_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_gcc_x86.hpp b/boost/boost/detail/sp_counted_base_gcc_x86.hpp deleted file mode 100644 index 8bf3171f33..0000000000 --- a/boost/boost/detail/sp_counted_base_gcc_x86.hpp +++ /dev/null @@ -1,173 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_base_gcc_x86.hpp - g++ on 486+ or AMD64 -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// -// 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) -// -// -// Lock-free algorithm by Alexander Terekhov -// -// Thanks to Ben Hitchings for the #weak + (#shared != 0) -// formulation -// - -#include - -namespace boost -{ - -namespace detail -{ - -inline int atomic_exchange_and_add( int * pw, int dv ) -{ - // int r = *pw; - // *pw += dv; - // return r; - - int r; - - __asm__ __volatile__ - ( - "lock\n\t" - "xadd %1, %0": - "=m"( *pw ), "=r"( r ): // outputs (%0, %1) - "m"( *pw ), "1"( dv ): // inputs (%2, %3 == %1) - "memory", "cc" // clobbers - ); - - return r; -} - -inline void atomic_increment( int * pw ) -{ - //atomic_exchange_and_add( pw, 1 ); - - __asm__ - ( - "lock\n\t" - "incl %0": - "=m"( *pw ): // output (%0) - "m"( *pw ): // input (%1) - "cc" // clobbers - ); -} - -inline int atomic_conditional_increment( int * pw ) -{ - // int rv = *pw; - // if( rv != 0 ) ++*pw; - // return rv; - - int rv, tmp; - - __asm__ - ( - "movl %0, %%eax\n\t" - "0:\n\t" - "test %%eax, %%eax\n\t" - "je 1f\n\t" - "movl %%eax, %2\n\t" - "incl %2\n\t" - "lock\n\t" - "cmpxchgl %2, %0\n\t" - "jne 0b\n\t" - "1:": - "=m"( *pw ), "=&a"( rv ), "=&r"( tmp ): // outputs (%0, %1, %2) - "m"( *pw ): // input (%3) - "cc" // clobbers - ); - - return rv; -} - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - int use_count_; // #shared - int weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_increment( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - return atomic_conditional_increment( &use_count_ ) != 0; - } - - void release() // nothrow - { - if( atomic_exchange_and_add( &use_count_, -1 ) == 1 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_increment( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_exchange_and_add( &weak_count_, -1 ) == 1 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return static_cast( use_count_ ); - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_GCC_X86_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_nt.hpp b/boost/boost/detail/sp_counted_base_nt.hpp deleted file mode 100644 index dc7a04231b..0000000000 --- a/boost/boost/detail/sp_counted_base_nt.hpp +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_NT_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_NT_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_base_nt.hpp -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// -// 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) -// - -#include - -namespace boost -{ - -namespace detail -{ - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - long use_count_; // #shared - long weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - ++use_count_; - } - - bool add_ref_lock() // true on success - { - if( use_count_ == 0 ) return false; - ++use_count_; - return true; - } - - void release() // nothrow - { - if( --use_count_ == 0 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - ++weak_count_; - } - - void weak_release() // nothrow - { - if( --weak_count_ == 0 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return use_count_; - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_NT_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_pt.hpp b/boost/boost/detail/sp_counted_base_pt.hpp deleted file mode 100644 index cd30de950d..0000000000 --- a/boost/boost/detail/sp_counted_base_pt.hpp +++ /dev/null @@ -1,135 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_PT_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_PT_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_base_pt.hpp -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// -// 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) -// - -#include -#include - -namespace boost -{ - -namespace detail -{ - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - long use_count_; // #shared - long weak_count_; // #weak + (#shared != 0) - - mutable pthread_mutex_t m_; - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { -// HPUX 10.20 / DCE has a nonstandard pthread_mutex_init - -#if defined(__hpux) && defined(_DECTHREADS_) - pthread_mutex_init( &m_, pthread_mutexattr_default ); -#else - pthread_mutex_init( &m_, 0 ); -#endif - } - - virtual ~sp_counted_base() // nothrow - { - pthread_mutex_destroy( &m_ ); - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - pthread_mutex_lock( &m_ ); - ++use_count_; - pthread_mutex_unlock( &m_ ); - } - - bool add_ref_lock() // true on success - { - pthread_mutex_lock( &m_ ); - bool r = use_count_ == 0? false: ( ++use_count_, true ); - pthread_mutex_unlock( &m_ ); - return r; - } - - void release() // nothrow - { - pthread_mutex_lock( &m_ ); - long new_use_count = --use_count_; - pthread_mutex_unlock( &m_ ); - - if( new_use_count == 0 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - pthread_mutex_lock( &m_ ); - ++weak_count_; - pthread_mutex_unlock( &m_ ); - } - - void weak_release() // nothrow - { - pthread_mutex_lock( &m_ ); - long new_weak_count = --weak_count_; - pthread_mutex_unlock( &m_ ); - - if( new_weak_count == 0 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - pthread_mutex_lock( &m_ ); - long r = use_count_; - pthread_mutex_unlock( &m_ ); - - return r; - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_PT_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_solaris.hpp b/boost/boost/detail/sp_counted_base_solaris.hpp deleted file mode 100755 index a747b391e8..0000000000 --- a/boost/boost/detail/sp_counted_base_solaris.hpp +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_SOLARIS_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_SOLARIS_HPP_INCLUDED - -// -// detail/sp_counted_base_solaris.hpp -// based on: detail/sp_counted_base_w32.hpp -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// Copyright 2006 Michael van der Westhuizen -// -// 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) -// -// -// Lock-free algorithm by Alexander Terekhov -// -// Thanks to Ben Hitchings for the #weak + (#shared != 0) -// formulation -// - -#include -#include - -namespace boost -{ - -namespace detail -{ - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - uint32_t use_count_; // #shared - uint32_t weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_inc_32( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - for( ;; ) - { - uint32_t tmp = static_cast< uint32_t const volatile& >( use_count_ ); - if( tmp == 0 ) return false; - if( atomic_cas_32( &use_count_, tmp, tmp + 1 ) == tmp ) return true; - } - } - - void release() // nothrow - { - if( atomic_dec_32_nv( &use_count_ ) == 0 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_inc_32( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_dec_32_nv( &weak_count_ ) == 0 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return static_cast( use_count_ ); - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_SOLARIS_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_spin.hpp b/boost/boost/detail/sp_counted_base_spin.hpp deleted file mode 100755 index 610a468c7e..0000000000 --- a/boost/boost/detail/sp_counted_base_spin.hpp +++ /dev/null @@ -1,131 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_SPIN_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_SPIN_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_base_spin.hpp - spinlock pool atomic emulation -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2008 Peter Dimov -// -// 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) -// - -#include -#include - -namespace boost -{ - -namespace detail -{ - -inline int atomic_exchange_and_add( int * pw, int dv ) -{ - spinlock_pool<1>::scoped_lock lock( pw ); - - int r = *pw; - *pw += dv; - return r; -} - -inline void atomic_increment( int * pw ) -{ - spinlock_pool<1>::scoped_lock lock( pw ); - ++*pw; -} - -inline int atomic_conditional_increment( int * pw ) -{ - spinlock_pool<1>::scoped_lock lock( pw ); - - int rv = *pw; - if( rv != 0 ) ++*pw; - return rv; -} - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - int use_count_; // #shared - int weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_increment( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - return atomic_conditional_increment( &use_count_ ) != 0; - } - - void release() // nothrow - { - if( atomic_exchange_and_add( &use_count_, -1 ) == 1 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_increment( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_exchange_and_add( &weak_count_, -1 ) == 1 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - spinlock_pool<1>::scoped_lock lock( &use_count_ ); - return use_count_; - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_SPIN_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_sync.hpp b/boost/boost/detail/sp_counted_base_sync.hpp deleted file mode 100755 index d72dac2bc5..0000000000 --- a/boost/boost/detail/sp_counted_base_sync.hpp +++ /dev/null @@ -1,155 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_SYNC_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_SYNC_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// detail/sp_counted_base_sync.hpp - g++ 4.1+ __sync intrinsics -// -// Copyright (c) 2007 Peter Dimov -// -// 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 - -#include -#include - -#if defined( __ia64__ ) && defined( __INTEL_COMPILER ) -# include -#endif - -namespace boost -{ - -namespace detail -{ - -#if INT_MAX >= 2147483647 - -typedef int sp_int32_t; - -#else - -typedef long sp_int32_t; - -#endif - -inline void atomic_increment( sp_int32_t * pw ) -{ - __sync_fetch_and_add( pw, 1 ); -} - -inline sp_int32_t atomic_decrement( sp_int32_t * pw ) -{ - return __sync_fetch_and_add( pw, -1 ); -} - -inline sp_int32_t atomic_conditional_increment( sp_int32_t * pw ) -{ - // long r = *pw; - // if( r != 0 ) ++*pw; - // return r; - - sp_int32_t r = *pw; - - for( ;; ) - { - if( r == 0 ) - { - return r; - } - - sp_int32_t r2 = __sync_val_compare_and_swap( pw, r, r + 1 ); - - if( r2 == r ) - { - return r; - } - else - { - r = r2; - } - } -} - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - sp_int32_t use_count_; // #shared - sp_int32_t weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - atomic_increment( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - return atomic_conditional_increment( &use_count_ ) != 0; - } - - void release() // nothrow - { - if( atomic_decrement( &use_count_ ) == 1 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - atomic_increment( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( atomic_decrement( &weak_count_ ) == 1 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return const_cast< sp_int32_t const volatile & >( use_count_ ); - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_SYNC_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_base_w32.hpp b/boost/boost/detail/sp_counted_base_w32.hpp deleted file mode 100644 index f9903935d8..0000000000 --- a/boost/boost/detail/sp_counted_base_w32.hpp +++ /dev/null @@ -1,130 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_base_w32.hpp -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// -// 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) -// -// -// Lock-free algorithm by Alexander Terekhov -// -// Thanks to Ben Hitchings for the #weak + (#shared != 0) -// formulation -// - -#include -#include -#include - -namespace boost -{ - -namespace detail -{ - -class sp_counted_base -{ -private: - - sp_counted_base( sp_counted_base const & ); - sp_counted_base & operator= ( sp_counted_base const & ); - - long use_count_; // #shared - long weak_count_; // #weak + (#shared != 0) - -public: - - sp_counted_base(): use_count_( 1 ), weak_count_( 1 ) - { - } - - virtual ~sp_counted_base() // nothrow - { - } - - // dispose() is called when use_count_ drops to zero, to release - // the resources managed by *this. - - virtual void dispose() = 0; // nothrow - - // destroy() is called when weak_count_ drops to zero. - - virtual void destroy() // nothrow - { - delete this; - } - - virtual void * get_deleter( sp_typeinfo const & ti ) = 0; - - void add_ref_copy() - { - BOOST_INTERLOCKED_INCREMENT( &use_count_ ); - } - - bool add_ref_lock() // true on success - { - for( ;; ) - { - long tmp = static_cast< long const volatile& >( use_count_ ); - if( tmp == 0 ) return false; - -#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1200 ) - - // work around a code generation bug - - long tmp2 = tmp + 1; - if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp2, tmp ) == tmp2 - 1 ) return true; - -#else - - if( BOOST_INTERLOCKED_COMPARE_EXCHANGE( &use_count_, tmp + 1, tmp ) == tmp ) return true; - -#endif - } - } - - void release() // nothrow - { - if( BOOST_INTERLOCKED_DECREMENT( &use_count_ ) == 0 ) - { - dispose(); - weak_release(); - } - } - - void weak_add_ref() // nothrow - { - BOOST_INTERLOCKED_INCREMENT( &weak_count_ ); - } - - void weak_release() // nothrow - { - if( BOOST_INTERLOCKED_DECREMENT( &weak_count_ ) == 0 ) - { - destroy(); - } - } - - long use_count() const // nothrow - { - return static_cast( use_count_ ); - } -}; - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_BASE_W32_HPP_INCLUDED diff --git a/boost/boost/detail/sp_counted_impl.hpp b/boost/boost/detail/sp_counted_impl.hpp deleted file mode 100644 index 81f92da249..0000000000 --- a/boost/boost/detail/sp_counted_impl.hpp +++ /dev/null @@ -1,231 +0,0 @@ -#ifndef BOOST_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED -#define BOOST_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// detail/sp_counted_impl.hpp -// -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. -// Copyright 2004-2005 Peter Dimov -// -// 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) -// - -#include - -#if defined(BOOST_SP_USE_STD_ALLOCATOR) && defined(BOOST_SP_USE_QUICK_ALLOCATOR) -# error BOOST_SP_USE_STD_ALLOCATOR and BOOST_SP_USE_QUICK_ALLOCATOR are incompatible. -#endif - -#include -#include - -#if defined(BOOST_SP_USE_QUICK_ALLOCATOR) -#include -#endif - -#if defined(BOOST_SP_USE_STD_ALLOCATOR) -#include // std::allocator -#endif - -#include // std::size_t - -namespace boost -{ - -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - -void sp_scalar_constructor_hook( void * px, std::size_t size, void * pn ); -void sp_scalar_destructor_hook( void * px, std::size_t size, void * pn ); - -#endif - -namespace detail -{ - -template class sp_counted_impl_p: public sp_counted_base -{ -private: - - X * px_; - - sp_counted_impl_p( sp_counted_impl_p const & ); - sp_counted_impl_p & operator= ( sp_counted_impl_p const & ); - - typedef sp_counted_impl_p this_type; - -public: - - explicit sp_counted_impl_p( X * px ): px_( px ) - { -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - boost::sp_scalar_constructor_hook( px, sizeof(X), this ); -#endif - } - - virtual void dispose() // nothrow - { -#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) - boost::sp_scalar_destructor_hook( px_, sizeof(X), this ); -#endif - boost::checked_delete( px_ ); - } - - virtual void * get_deleter( detail::sp_typeinfo const & ) - { - return 0; - } - -#if defined(BOOST_SP_USE_STD_ALLOCATOR) - - void * operator new( std::size_t ) - { - return std::allocator().allocate( 1, static_cast(0) ); - } - - void operator delete( void * p ) - { - std::allocator().deallocate( static_cast(p), 1 ); - } - -#endif - -#if defined(BOOST_SP_USE_QUICK_ALLOCATOR) - - void * operator new( std::size_t ) - { - return quick_allocator::alloc(); - } - - void operator delete( void * p ) - { - quick_allocator::dealloc( p ); - } - -#endif -}; - -// -// Borland's Codeguard trips up over the -Vx- option here: -// -#ifdef __CODEGUARD__ -# pragma option push -Vx- -#endif - -template class sp_counted_impl_pd: public sp_counted_base -{ -private: - - P ptr; // copy constructor must not throw - D del; // copy constructor must not throw - - sp_counted_impl_pd( sp_counted_impl_pd const & ); - sp_counted_impl_pd & operator= ( sp_counted_impl_pd const & ); - - typedef sp_counted_impl_pd this_type; - -public: - - // pre: d(p) must not throw - - sp_counted_impl_pd( P p, D d ): ptr(p), del(d) - { - } - - virtual void dispose() // nothrow - { - del( ptr ); - } - - virtual void * get_deleter( detail::sp_typeinfo const & ti ) - { - return ti == BOOST_SP_TYPEID(D)? &reinterpret_cast( del ): 0; - } - -#if defined(BOOST_SP_USE_STD_ALLOCATOR) - - void * operator new( std::size_t ) - { - return std::allocator().allocate( 1, static_cast(0) ); - } - - void operator delete( void * p ) - { - std::allocator().deallocate( static_cast(p), 1 ); - } - -#endif - -#if defined(BOOST_SP_USE_QUICK_ALLOCATOR) - - void * operator new( std::size_t ) - { - return quick_allocator::alloc(); - } - - void operator delete( void * p ) - { - quick_allocator::dealloc( p ); - } - -#endif -}; - -template class sp_counted_impl_pda: public sp_counted_base -{ -private: - - P p_; // copy constructor must not throw - D d_; // copy constructor must not throw - A a_; // copy constructor must not throw - - sp_counted_impl_pda( sp_counted_impl_pda const & ); - sp_counted_impl_pda & operator= ( sp_counted_impl_pda const & ); - - typedef sp_counted_impl_pda this_type; - -public: - - // pre: d( p ) must not throw - - sp_counted_impl_pda( P p, D d, A a ): p_( p ), d_( d ), a_( a ) - { - } - - virtual void dispose() // nothrow - { - d_( p_ ); - } - - virtual void destroy() // nothrow - { - typedef typename A::template rebind< this_type >::other A2; - - A2 a2( a_ ); - - this->~this_type(); - a2.deallocate( this, 1 ); - } - - virtual void * get_deleter( detail::sp_typeinfo const & ti ) - { - return ti == BOOST_SP_TYPEID( D )? &reinterpret_cast( d_ ): 0; - } -}; - -#ifdef __CODEGUARD__ -# pragma option pop -#endif - -} // namespace detail - -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SP_COUNTED_IMPL_HPP_INCLUDED diff --git a/boost/boost/detail/spinlock.hpp b/boost/boost/detail/spinlock.hpp deleted file mode 100755 index e273647063..0000000000 --- a/boost/boost/detail/spinlock.hpp +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef BOOST_DETAIL_SPINLOCK_HPP_INCLUDED -#define BOOST_DETAIL_SPINLOCK_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// boost/detail/spinlock.hpp -// -// Copyright (c) 2008 Peter Dimov -// -// 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) -// -// struct spinlock -// { -// void lock(); -// bool try_lock(); -// void unlock(); -// -// class scoped_lock; -// }; -// -// #define BOOST_DETAIL_SPINLOCK_INIT -// - -#include - -#if defined(__GNUC__) && defined( __arm__ ) -# include -#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) -# include -#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# include -#elif defined(BOOST_HAS_PTHREADS) -# include -#elif !defined(BOOST_HAS_THREADS) -# include -#else -# error Unrecognized threading platform -#endif - -#endif // #ifndef BOOST_DETAIL_SPINLOCK_HPP_INCLUDED diff --git a/boost/boost/detail/spinlock_gcc_arm.hpp b/boost/boost/detail/spinlock_gcc_arm.hpp deleted file mode 100755 index c21163bdd1..0000000000 --- a/boost/boost/detail/spinlock_gcc_arm.hpp +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef BOOST_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED -#define BOOST_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED - -// -// Copyright (c) 2008 Peter Dimov -// -// 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) -// - -#include - -namespace boost -{ - -namespace detail -{ - -class spinlock -{ -public: - - int v_; - -public: - - bool try_lock() - { - int r; - - __asm__ __volatile__( - "swp %0, %1, [%2]": - "=&r"( r ): // outputs - "r"( 1 ), "r"( &v_ ): // inputs - "memory", "cc" ); - - return r == 0; - } - - void lock() - { - for( unsigned k = 0; !try_lock(); ++k ) - { - boost::detail::yield( k ); - } - } - - void unlock() - { - __asm__ __volatile__( "" ::: "memory" ); - *const_cast< int volatile* >( &v_ ) = 0; - } - -public: - - class scoped_lock - { - private: - - spinlock & sp_; - - scoped_lock( scoped_lock const & ); - scoped_lock & operator=( scoped_lock const & ); - - public: - - explicit scoped_lock( spinlock & sp ): sp_( sp ) - { - sp.lock(); - } - - ~scoped_lock() - { - sp_.unlock(); - } - }; -}; - -} // namespace detail -} // namespace boost - -#define BOOST_DETAIL_SPINLOCK_INIT {0} - -#endif // #ifndef BOOST_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED diff --git a/boost/boost/detail/spinlock_nt.hpp b/boost/boost/detail/spinlock_nt.hpp deleted file mode 100755 index f03ba08a45..0000000000 --- a/boost/boost/detail/spinlock_nt.hpp +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef BOOST_DETAIL_SPINLOCK_NT_HPP_INCLUDED -#define BOOST_DETAIL_SPINLOCK_NT_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// Copyright (c) 2008 Peter Dimov -// -// 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) -// - -#include - -namespace boost -{ - -namespace detail -{ - -class spinlock -{ -public: - - bool locked_; - -public: - - inline bool try_lock() - { - if( locked_ ) - { - return false; - } - else - { - locked_ = true; - return true; - } - } - - inline void lock() - { - BOOST_ASSERT( !locked_ ); - locked_ = true; - } - - inline void unlock() - { - BOOST_ASSERT( locked_ ); - locked_ = false; - } - -public: - - class scoped_lock - { - private: - - spinlock & sp_; - - scoped_lock( scoped_lock const & ); - scoped_lock & operator=( scoped_lock const & ); - - public: - - explicit scoped_lock( spinlock & sp ): sp_( sp ) - { - sp.lock(); - } - - ~scoped_lock() - { - sp_.unlock(); - } - }; -}; - -} // namespace detail -} // namespace boost - -#define BOOST_DETAIL_SPINLOCK_INIT { false } - -#endif // #ifndef BOOST_DETAIL_SPINLOCK_NT_HPP_INCLUDED diff --git a/boost/boost/detail/spinlock_pool.hpp b/boost/boost/detail/spinlock_pool.hpp deleted file mode 100755 index a264b1a331..0000000000 --- a/boost/boost/detail/spinlock_pool.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef BOOST_DETAIL_SPINLOCK_POOL_HPP_INCLUDED -#define BOOST_DETAIL_SPINLOCK_POOL_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// boost/detail/spinlock_pool.hpp -// -// Copyright (c) 2008 Peter Dimov -// -// 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) -// -// spinlock_pool<0> is reserved for atomic<>, when/if it arrives -// spinlock_pool<1> is reserved for shared_ptr reference counts -// spinlock_pool<2> is reserved for shared_ptr atomic access -// - -#include -#include -#include - -namespace boost -{ - -namespace detail -{ - -template< int I > class spinlock_pool -{ -private: - - static spinlock pool_[ 41 ]; - -public: - - static spinlock & spinlock_for( void const * pv ) - { - std::size_t i = reinterpret_cast< std::size_t >( pv ) % 41; - return pool_[ i ]; - } - - class scoped_lock - { - private: - - spinlock & sp_; - - scoped_lock( scoped_lock const & ); - scoped_lock & operator=( scoped_lock const & ); - - public: - - explicit scoped_lock( void const * pv ): sp_( spinlock_for( pv ) ) - { - sp_.lock(); - } - - ~scoped_lock() - { - sp_.unlock(); - } - }; -}; - -template< int I > spinlock spinlock_pool< I >::pool_[ 41 ] = -{ - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT -}; - -} // namespace detail -} // namespace boost - -#endif // #ifndef BOOST_DETAIL_SPINLOCK_POOL_HPP_INCLUDED diff --git a/boost/boost/detail/spinlock_pt.hpp b/boost/boost/detail/spinlock_pt.hpp deleted file mode 100755 index dfb2d6f45b..0000000000 --- a/boost/boost/detail/spinlock_pt.hpp +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef BOOST_DETAIL_SPINLOCK_PT_HPP_INCLUDED -#define BOOST_DETAIL_SPINLOCK_PT_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// Copyright (c) 2008 Peter Dimov -// -// 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) -// - -#include - -namespace boost -{ - -namespace detail -{ - -class spinlock -{ -public: - - pthread_mutex_t v_; - -public: - - bool try_lock() - { - return pthread_mutex_trylock( &v_ ) == 0; - } - - void lock() - { - pthread_mutex_lock( &v_ ); - } - - void unlock() - { - pthread_mutex_unlock( &v_ ); - } - -public: - - class scoped_lock - { - private: - - spinlock & sp_; - - scoped_lock( scoped_lock const & ); - scoped_lock & operator=( scoped_lock const & ); - - public: - - explicit scoped_lock( spinlock & sp ): sp_( sp ) - { - sp.lock(); - } - - ~scoped_lock() - { - sp_.unlock(); - } - }; -}; - -} // namespace detail -} // namespace boost - -#define BOOST_DETAIL_SPINLOCK_INIT { PTHREAD_MUTEX_INITIALIZER } - -#endif // #ifndef BOOST_DETAIL_SPINLOCK_PT_HPP_INCLUDED diff --git a/boost/boost/detail/spinlock_sync.hpp b/boost/boost/detail/spinlock_sync.hpp deleted file mode 100755 index a7523967f0..0000000000 --- a/boost/boost/detail/spinlock_sync.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef BOOST_DETAIL_SPINLOCK_SYNC_HPP_INCLUDED -#define BOOST_DETAIL_SPINLOCK_SYNC_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// Copyright (c) 2008 Peter Dimov -// -// 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) -// - -#include - -#if defined( __ia64__ ) && defined( __INTEL_COMPILER ) -# include -#endif - -namespace boost -{ - -namespace detail -{ - -class spinlock -{ -public: - - int v_; - -public: - - bool try_lock() - { - int r = __sync_lock_test_and_set( &v_, 1 ); - return r == 0; - } - - void lock() - { - for( unsigned k = 0; !try_lock(); ++k ) - { - boost::detail::yield( k ); - } - } - - void unlock() - { - __sync_lock_release( &v_ ); - } - -public: - - class scoped_lock - { - private: - - spinlock & sp_; - - scoped_lock( scoped_lock const & ); - scoped_lock & operator=( scoped_lock const & ); - - public: - - explicit scoped_lock( spinlock & sp ): sp_( sp ) - { - sp.lock(); - } - - ~scoped_lock() - { - sp_.unlock(); - } - }; -}; - -} // namespace detail -} // namespace boost - -#define BOOST_DETAIL_SPINLOCK_INIT {0} - -#endif // #ifndef BOOST_DETAIL_SPINLOCK_SYNC_HPP_INCLUDED diff --git a/boost/boost/detail/spinlock_w32.hpp b/boost/boost/detail/spinlock_w32.hpp deleted file mode 100755 index aa416c34e4..0000000000 --- a/boost/boost/detail/spinlock_w32.hpp +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef BOOST_DETAIL_SPINLOCK_W32_HPP_INCLUDED -#define BOOST_DETAIL_SPINLOCK_W32_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// Copyright (c) 2008 Peter Dimov -// -// 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) -// - -#include -#include - -// BOOST_COMPILER_FENCE - -#if defined(__INTEL_COMPILER) - -#define BOOST_COMPILER_FENCE __memory_barrier(); - -#elif defined( _MSC_VER ) && _MSC_VER >= 1310 - -extern "C" void _ReadWriteBarrier(); -#pragma intrinsic( _ReadWriteBarrier ) - -#define BOOST_COMPILER_FENCE _ReadWriteBarrier(); - -#elif defined(__GNUC__) - -#define BOOST_COMPILER_FENCE __asm__ __volatile__( "" : : : "memory" ); - -#else - -#define BOOST_COMPILER_FENCE - -#endif - -// - -namespace boost -{ - -namespace detail -{ - -class spinlock -{ -public: - - long v_; - -public: - - bool try_lock() - { - long r = BOOST_INTERLOCKED_EXCHANGE( &v_, 1 ); - - BOOST_COMPILER_FENCE - - return r == 0; - } - - void lock() - { - for( unsigned k = 0; !try_lock(); ++k ) - { - boost::detail::yield( k ); - } - } - - void unlock() - { - BOOST_COMPILER_FENCE - *const_cast< long volatile* >( &v_ ) = 0; - } - -public: - - class scoped_lock - { - private: - - spinlock & sp_; - - scoped_lock( scoped_lock const & ); - scoped_lock & operator=( scoped_lock const & ); - - public: - - explicit scoped_lock( spinlock & sp ): sp_( sp ) - { - sp.lock(); - } - - ~scoped_lock() - { - sp_.unlock(); - } - }; -}; - -} // namespace detail -} // namespace boost - -#define BOOST_DETAIL_SPINLOCK_INIT {0} - -#endif // #ifndef BOOST_DETAIL_SPINLOCK_W32_HPP_INCLUDED diff --git a/boost/boost/detail/yield_k.hpp b/boost/boost/detail/yield_k.hpp deleted file mode 100755 index d97542d02e..0000000000 --- a/boost/boost/detail/yield_k.hpp +++ /dev/null @@ -1,149 +0,0 @@ -#ifndef BOOST_DETAIL_YIELD_K_HPP_INCLUDED -#define BOOST_DETAIL_YIELD_K_HPP_INCLUDED - -// MS compatible compilers support #pragma once - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once -#endif - -// -// boost/detail/yield_k.hpp -// -// Copyright (c) 2008 Peter Dimov -// -// void yield( unsigned k ); -// -// Typical use: -// -// for( unsigned k = 0; !try_lock(); ++k ) yield( k ); -// -// 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 -// - -#include - -// BOOST_SMT_PAUSE - -#if defined(_MSC_VER) && _MSC_VER >= 1310 && ( defined(_M_IX86) || defined(_M_X64) ) - -extern "C" void _mm_pause(); -#pragma intrinsic( _mm_pause ) - -#define BOOST_SMT_PAUSE _mm_pause(); - -#elif defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) ) - -#define BOOST_SMT_PAUSE __asm__ __volatile__( "rep; nop" : : : "memory" ); - -#endif - -// - -#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ ) - -#if defined( BOOST_USE_WINDOWS_H ) -# include -#endif - -namespace boost -{ - -namespace detail -{ - -#if !defined( BOOST_USE_WINDOWS_H ) - extern "C" void __stdcall Sleep( unsigned ms ); -#endif - -inline void yield( unsigned k ) -{ - if( k < 4 ) - { - } -#if defined( BOOST_SMT_PAUSE ) - else if( k < 16 ) - { - BOOST_SMT_PAUSE - } -#endif - else if( k < 32 ) - { - Sleep( 0 ); - } - else - { - Sleep( 1 ); - } -} - -} // namespace detail - -} // namespace boost - -#elif defined( BOOST_HAS_PTHREADS ) - -#include -#include - -namespace boost -{ - -namespace detail -{ - -inline void yield( unsigned k ) -{ - if( k < 4 ) - { - } -#if defined( BOOST_SMT_PAUSE ) - else if( k < 16 ) - { - BOOST_SMT_PAUSE - } -#endif - else if( k < 32 || k & 1 ) - { - sched_yield(); - } - else - { - // g++ -Wextra warns on {} or {0} - struct timespec rqtp = { 0, 0 }; - - // POSIX says that timespec has tv_sec and tv_nsec - // But it doesn't guarantee order or placement - - rqtp.tv_sec = 0; - rqtp.tv_nsec = 1000; - - nanosleep( &rqtp, 0 ); - } -} - -} // namespace detail - -} // namespace boost - -#else - -namespace boost -{ - -namespace detail -{ - -inline void yield( unsigned ) -{ -} - -} // namespace detail - -} // namespace boost - -#endif - -#endif // #ifndef BOOST_DETAIL_YIELD_K_HPP_INCLUDED diff --git a/boost/boost/exception/detail/cloning_base.hpp b/boost/boost/exception/detail/cloning_base.hpp deleted file mode 100755 index 86dc4007ec..0000000000 --- a/boost/boost/exception/detail/cloning_base.hpp +++ /dev/null @@ -1,38 +0,0 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. - -//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) - -#ifndef UUID_F7D5662CCB0F11DCA353CAC656D89593 -#define UUID_F7D5662CCB0F11DCA353CAC656D89593 - -#include - -namespace -boost - { - namespace - exception_detail - { - class clone_base; - - class - cloning_base - { - public: - - virtual clone_base const * clone() const = 0; - - protected: - -#if BOOST_WORKAROUND( __GNUC__, BOOST_TESTED_AT(4) ) -virtual //Disable bogus GCC warning. -#endif - ~cloning_base() throw() - { - } - }; - } - } - -#endif diff --git a/boost/boost/exception/detail/counted_base.hpp b/boost/boost/exception/detail/counted_base.hpp deleted file mode 100755 index 75f6375d2d..0000000000 --- a/boost/boost/exception/detail/counted_base.hpp +++ /dev/null @@ -1,49 +0,0 @@ -//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. - -//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) - -#ifndef UUID_DBA0D90C930911DCBA7B675A56D89593 -#define UUID_DBA0D90C930911DCBA7B675A56D89593 - -#include - -namespace -boost - { - namespace - exception_detail - { - class - counted_base - { - friend - void - intrusive_ptr_add_ref( counted_base const * c ) - { - c->add_ref(); - } - - friend - void - intrusive_ptr_release( counted_base const * c ) - { - c->release(); - } - - virtual void add_ref() const=0; - virtual void release() const=0; - - protected: - -#if BOOST_WORKAROUND( __GNUC__, BOOST_TESTED_AT(4) ) -virtual //Disable bogus GCC warning. -#endif - ~counted_base() throw() - { - } - }; - } - } - -#endif diff --git a/boost/boost/exception/detail/exception_ptr_base.hpp b/boost/boost/exception/detail/exception_ptr_base.hpp deleted file mode 100644 index ac68cab7c6..0000000000 --- a/boost/boost/exception/detail/exception_ptr_base.hpp +++ /dev/null @@ -1,33 +0,0 @@ -//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. - -//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) - -#ifndef UUID_DC4208C6417811DEBF11E1EC55D89593 -#define UUID_DC4208C6417811DEBF11E1EC55D89593 - -namespace -boost - { - namespace - exception_detail - { - class - exception_ptr_base - { - public: - - virtual void _rethrow() const=0; - virtual bool _empty() const=0; - - protected: - - virtual - ~exception_ptr_base() throw() - { - } - }; - } - } - -#endif diff --git a/boost/boost/property_map.hpp b/boost/boost/property_map.hpp deleted file mode 100644 index 3a64e93b87..0000000000 --- a/boost/boost/property_map.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= -Copyright (c) 2009 Trustees of Indiana University - -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) -=============================================================================*/ -// Redirect/warning header, adapted from the version in Spirit - -#include - -#if BOOST_VERSION >= 103800 -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__) -# pragma message ("Warning: This header is deprecated. Please use: boost/property_map/property_map.hpp") -#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) -# warning "This header is deprecated. Please use: boost/property_map/property_map.hpp" -#endif -#endif - -#include diff --git a/boost/boost/property_map_iterator.hpp b/boost/boost/property_map_iterator.hpp deleted file mode 100644 index 30799712fa..0000000000 --- a/boost/boost/property_map_iterator.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= -Copyright (c) 2009 Trustees of Indiana University - -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) -=============================================================================*/ -// Redirect/warning header, adapted from the version in Spirit - -#include - -#if BOOST_VERSION >= 103800 -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__) -# pragma message ("Warning: This header is deprecated. Please use: boost/property_map/property_map_iterator.hpp") -#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) -# warning "This header is deprecated. Please use: boost/property_map/property_map_iterator.hpp" -#endif -#endif - -#include diff --git a/boost/boost/regex/v4/regex_cstring.hpp b/boost/boost/regex/v4/regex_cstring.hpp deleted file mode 100644 index 589380d6ee..0000000000 --- a/boost/boost/regex/v4/regex_cstring.hpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * - * Copyright (c) 1998-2002 - * John Maddock - * - * 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) - * - */ - - /* - * LOCATION: see http://www.boost.org for most recent version. - * FILE regex_cstring.hpp - * VERSION see - * DESCRIPTION: This is an internal header file, do not include directly. - * String support and helper functions, for regular - * expression library. - */ - -#ifndef BOOST_REGEX_CSTRING_HPP -#define BOOST_REGEX_CSTRING_HPP - -#ifndef BOOST_REGEX_CONFIG_HPP -#include -#endif - -#include - -namespace boost{ - namespace re_detail{ - -// -// start by defining some template function aliases for C API functions: -// - -template -std::size_t BOOST_REGEX_CALL re_strlen(const charT *s) -{ - std::size_t len = 0; - while(*s) - { - ++s; - ++len; - } - return len; -} - -inline std::size_t BOOST_REGEX_CALL re_strlen(const char *s) -{ - return std::strlen(s); -} - -#ifndef BOOST_NO_WREGEX - -inline std::size_t BOOST_REGEX_CALL re_strlen(const wchar_t *s) -{ - return std::wcslen(s); -} - -#endif - -#ifndef BOOST_NO_WREGEX -BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::basic_string& out, const std::basic_string& in); -#endif -BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::string& out, const std::string& in); - -template -void BOOST_REGEX_CALL re_trunc_primary(std::basic_string& s) -{ - for(unsigned int i = 0; i < s.size(); ++i) - { - if(s[i] <= 1) - { - s.erase(i); - break; - } - } -} - -inline char* BOOST_REGEX_CALL re_strcpy(char *s1, const char *s2) -{ - #if defined(__BORLANDC__) && defined(strcpy) - return ::strcpy(s1, s2); - #else - return std::strcpy(s1, s2); - #endif -} - -#ifndef BOOST_NO_WREGEX - -inline wchar_t* BOOST_REGEX_CALL re_strcpy(wchar_t *s1, const wchar_t *s2) -{ - return std::wcscpy(s1, s2); -} - -#endif - - -template -charT* BOOST_REGEX_CALL re_strdup(const charT* p) -{ - charT* buf = new charT[re_strlen(p) + 1]; - re_strcpy(buf, p); - return buf; -} - -template -inline void BOOST_REGEX_CALL re_strfree(charT* p) -{ - delete[] p; -} - -} // namespace re_detail -} // namespace boost - -#endif // BOOST_REGEX_CSTRING_HPP - - - - - - diff --git a/boost/boost/regex/v4/regex_kmp.hpp b/boost/boost/regex/v4/regex_kmp.hpp deleted file mode 100644 index 3607ef7182..0000000000 --- a/boost/boost/regex/v4/regex_kmp.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * - * Copyright (c) 1998-2002 - * John Maddock - * - * 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) - * - */ - - /* - * LOCATION: see http://www.boost.org for most recent version. - * FILE regex_kmp.hpp - * VERSION see - * DESCRIPTION: Provides Knuth Morris Pratt search operations. - * Note this is an internal header file included - * by regex.hpp, do not include on its own. - */ - -#ifndef BOOST_REGEX_KMP_HPP -#define BOOST_REGEX_KMP_HPP - -#ifdef BOOST_REGEX_CONFIG_HPP -#include -#endif - - -namespace boost{ - namespace re_detail{ - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_PREFIX -#endif - -template -struct kmp_info -{ - unsigned int size; - unsigned int len; - const charT* pstr; - int kmp_next[1]; -}; - -template -void kmp_free(kmp_info* pinfo, const Allocator& a) -{ - typedef typename boost::detail::rebind_allocator::type atype; - atype(a).deallocate(reinterpret_cast(pinfo), pinfo->size); -} - -template -kmp_info* kmp_compile(iterator first, iterator last, charT, Trans translate, const Allocator& a) -{ - typedef typename boost::detail::rebind_allocator::type atype; - int i, j, m; - i = 0; - m = static_cast(::boost::re_detail::distance(first, last)); - ++m; - unsigned int size = sizeof(kmp_info) + sizeof(int)*m + sizeof(charT)*m; - --m; - // - // allocate struct and fill it in: - // - kmp_info* pinfo = reinterpret_cast*>(atype(a).allocate(size)); - BOOST_REGEX_NOEH_ASSERT(pinfo) - pinfo->size = size; - pinfo->len = m; - charT* p = reinterpret_cast(reinterpret_cast(pinfo) + sizeof(kmp_info) + sizeof(int)*(m+1)); - pinfo->pstr = p; - while(first != last) - { - *p = translate(*first); - ++first; - ++p; - } - *p = 0; - // - // finally do regular kmp compile: - // - j = pinfo->kmp_next[0] = -1; - while (i < m) - { - while ((j > -1) && (pinfo->pstr[i] != pinfo->pstr[j])) - j = pinfo->kmp_next[j]; - ++i; - ++j; - if (pinfo->pstr[i] == pinfo->pstr[j]) - pinfo->kmp_next[i] = pinfo->kmp_next[j]; - else - pinfo->kmp_next[i] = j; - } - - return pinfo; -} - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_SUFFIX -#endif - - } // namepsace re_detail -} // namespace boost - -#endif // BOOST_REGEX_KMP_HPP - - - - diff --git a/boost/boost/regex/v4/regex_stack.hpp b/boost/boost/regex/v4/regex_stack.hpp deleted file mode 100644 index 453df203a0..0000000000 --- a/boost/boost/regex/v4/regex_stack.hpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - * - * Copyright (c) 1998-2002 - * John Maddock - * - * 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) - * - */ - - /* - * LOCATION: see http://www.boost.org for most recent version. - * FILE regex_stack.hpp - * VERSION see - * DESCRIPTION: Implements customised internal regex stacks. - * Note this is an internal header file included - * by regex.hpp, do not include on its own. - */ - -#ifndef BOOST_REGEX_STACK_HPP -#define BOOST_REGEX_STACK_HPP - -#ifndef BOOST_REGEX_CONFIG_HPP -#include -#endif -#ifndef BOOST_REGEX_RAW_BUFFER_HPP -#include -#endif - -namespace boost{ - namespace re_detail{ - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_PREFIX -#endif - -// -// class jstack -// simplified stack optimised for push/peek/pop -// operations, we could use std::stack> instead... -// -template -class jstack -{ -public: - typedef typename boost::detail::rebind_allocator::type allocator_type; -private: - typedef typename boost::detail::rebind_allocator::type T_alloc_type; - typedef typename T_alloc_type::size_type size_type; - typedef T value_type; - struct node - { - node* next; - T* start; // first item - T* end; // last item - T* last; // end of storage - }; - - // - // empty base member optimisation: - struct data : public allocator_type - { - padding buf[(sizeof(T) * 16 + sizeof(padding) - 1) / sizeof(padding)]; - data(const Allocator& a) : allocator_type(a){} - }; - - data alloc_inst; - mutable node* m_stack; - mutable node* unused; - node base; - size_type block_size; - - void BOOST_REGEX_CALL pop_aux()const; - void BOOST_REGEX_CALL push_aux(); - -public: - jstack(size_type n = 64, const Allocator& a = Allocator()); - - ~jstack(); - - node* BOOST_REGEX_CALL get_node() - { - node* new_stack = reinterpret_cast(alloc_inst.allocate(sizeof(node) + sizeof(T) * block_size)); - BOOST_REGEX_NOEH_ASSERT(new_stack) - new_stack->last = reinterpret_cast(new_stack+1); - new_stack->start = new_stack->end = new_stack->last + block_size; - new_stack->next = 0; - return new_stack; - } - - bool BOOST_REGEX_CALL empty() - { - return (m_stack->start == m_stack->end) && (m_stack->next == 0); - } - - bool BOOST_REGEX_CALL good() - { - return (m_stack->start != m_stack->end) || (m_stack->next != 0); - } - - T& BOOST_REGEX_CALL peek() - { - if(m_stack->start == m_stack->end) - pop_aux(); - return *m_stack->end; - } - - const T& BOOST_REGEX_CALL peek()const - { - if(m_stack->start == m_stack->end) - pop_aux(); - return *m_stack->end; - } - - void BOOST_REGEX_CALL pop() - { - if(m_stack->start == m_stack->end) - pop_aux(); - ::boost::re_detail::pointer_destroy(m_stack->end); - ++(m_stack->end); - } - - void BOOST_REGEX_CALL pop(T& t) - { - if(m_stack->start == m_stack->end) - pop_aux(); - t = *m_stack->end; - ::boost::re_detail::pointer_destroy(m_stack->end); - ++(m_stack->end); - } - - void BOOST_REGEX_CALL push(const T& t) - { - if(m_stack->end == m_stack->last) - push_aux(); - --(m_stack->end); - pointer_construct(m_stack->end, t); - } - -}; - -template -jstack::jstack(size_type n, const Allocator& a) - : alloc_inst(a) -{ - unused = 0; - block_size = n; - m_stack = &base; - base.last = reinterpret_cast(alloc_inst.buf); - base.end = base.start = base.last + 16; - base.next = 0; -} - -template -void BOOST_REGEX_CALL jstack::push_aux() -{ - // make sure we have spare space on TOS: - register node* new_node; - if(unused) - { - new_node = unused; - unused = new_node->next; - new_node->next = m_stack; - m_stack = new_node; - } - else - { - new_node = get_node(); - new_node->next = m_stack; - m_stack = new_node; - } -} - -template -void BOOST_REGEX_CALL jstack::pop_aux()const -{ - // make sure that we have a valid item - // on TOS: - BOOST_ASSERT(m_stack->next); - register node* p = m_stack; - m_stack = p->next; - p->next = unused; - unused = p; -} - -template -jstack::~jstack() -{ - node* condemned; - while(good()) - pop(); - while(unused) - { - condemned = unused; - unused = unused->next; - alloc_inst.deallocate(reinterpret_cast(condemned), sizeof(node) + sizeof(T) * block_size); - } - while(m_stack != &base) - { - condemned = m_stack; - m_stack = m_stack->next; - alloc_inst.deallocate(reinterpret_cast(condemned), sizeof(node) + sizeof(T) * block_size); - } -} - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_SUFFIX -#endif - -} // namespace re_detail -} // namespace boost - -#endif - - - - - - - - - - - diff --git a/boost/libs/regex/src/c_regex_traits.cpp b/boost/libs/regex/src/c_regex_traits.cpp index 6466bc422e..a99de14c62 100644 --- a/boost/libs/regex/src/c_regex_traits.cpp +++ b/boost/libs/regex/src/c_regex_traits.cpp @@ -155,16 +155,16 @@ c_regex_traits::char_class_type BOOST_REGEX_CALL c_regex_traits::loo char_class_xdigit, }; - int id = ::boost::re_detail::get_default_class_id(p1, p2); - if(id < 0) + int idx = ::boost::re_detail::get_default_class_id(p1, p2); + if(idx < 0) { std::string s(p1, p2); for(std::string::size_type i = 0; i < s.size(); ++i) s[i] = static_cast((std::tolower)(static_cast(s[i]))); - id = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size()); + idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size()); } - BOOST_ASSERT(std::size_t(id+1) < sizeof(masks) / sizeof(masks[0])); - return masks[id+1]; + BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0])); + return masks[idx+1]; } bool BOOST_REGEX_CALL c_regex_traits::isctype(char c, char_class_type mask) diff --git a/boost/libs/regex/src/icu.cpp b/boost/libs/regex/src/icu.cpp index a815e9156b..75ca144484 100755 --- a/boost/libs/regex/src/icu.cpp +++ b/boost/libs/regex/src/icu.cpp @@ -388,14 +388,14 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_ char_class_type(U_GC_ND_MASK) | mask_xdigit, }; - int id = ::boost::re_detail::get_default_class_id(p1, p2); - if(id >= 0) - return masks[id+1]; + int idx = ::boost::re_detail::get_default_class_id(p1, p2); + if(idx >= 0) + return masks[idx+1]; char_class_type result = lookup_icu_mask(p1, p2); if(result != 0) return result; - if(id < 0) + if(idx < 0) { string_type s(p1, p2); string_type::size_type i = 0; @@ -411,16 +411,16 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_ } } if(s.size()) - id = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size()); - if(id >= 0) - return masks[id+1]; + idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size()); + if(idx >= 0) + return masks[idx+1]; if(s.size()) result = lookup_icu_mask(&*s.begin(), &*s.begin() + s.size()); if(result != 0) return result; } - BOOST_ASSERT(std::size_t(id+1) < sizeof(masks) / sizeof(masks[0])); - return masks[id+1]; + BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0])); + return masks[idx+1]; } icu_regex_traits::string_type icu_regex_traits::lookup_collatename(const char_type* p1, const char_type* p2) const diff --git a/boost/libs/regex/src/w32_regex_traits.cpp b/boost/libs/regex/src/w32_regex_traits.cpp index 365fccc002..8c22214d3c 100644 --- a/boost/libs/regex/src/w32_regex_traits.cpp +++ b/boost/libs/regex/src/w32_regex_traits.cpp @@ -43,10 +43,10 @@ namespace std{ namespace boost{ namespace re_detail{ #ifdef BOOST_NO_ANSI_APIS -UINT get_code_page_for_locale_id(lcid_type id) +UINT get_code_page_for_locale_id(lcid_type idx) { WCHAR code_page_string[7]; - if (::GetLocaleInfoW(id, LOCALE_IDEFAULTANSICODEPAGE, code_page_string, 7) == 0) + if (::GetLocaleInfoW(idx, LOCALE_IDEFAULTANSICODEPAGE, code_page_string, 7) == 0) return 0; return static_cast(_wtol(code_page_string)); @@ -157,15 +157,15 @@ BOOST_REGEX_DECL lcid_type BOOST_REGEX_CALL w32_get_default_locale() return ::GetUserDefaultLCID(); } -BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(char c, lcid_type id) +BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(char c, lcid_type idx) { #ifndef BOOST_NO_ANSI_APIS WORD mask; - if(::GetStringTypeExA(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER)) + if(::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER)) return true; return false; #else - UINT code_page = get_code_page_for_locale_id(id); + UINT code_page = get_code_page_for_locale_id(idx); if (code_page == 0) return false; @@ -174,39 +174,39 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(char c, lcid_type id) return false; WORD mask; - if(::GetStringTypeExW(id, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_LOWER)) + if(::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_LOWER)) return true; return false; #endif } -BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(wchar_t c, lcid_type id) +BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(wchar_t c, lcid_type idx) { WORD mask; - if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER)) + if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER)) return true; return false; } #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T -BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(unsigned short ca, lcid_type id) +BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_lower(unsigned short ca, lcid_type idx) { WORD mask; wchar_t c = ca; - if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER)) + if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER)) return true; return false; } #endif -BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(char c, lcid_type id) +BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(char c, lcid_type idx) { #ifndef BOOST_NO_ANSI_APIS WORD mask; - if(::GetStringTypeExA(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER)) + if(::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER)) return true; return false; #else - UINT code_page = get_code_page_for_locale_id(id); + UINT code_page = get_code_page_for_locale_id(idx); if (code_page == 0) return false; @@ -215,25 +215,25 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(char c, lcid_type id) return false; WORD mask; - if(::GetStringTypeExW(id, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_UPPER)) + if(::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_UPPER)) return true; return false; #endif } -BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(wchar_t c, lcid_type id) +BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(wchar_t c, lcid_type idx) { WORD mask; - if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER)) + if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER)) return true; return false; } #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T -BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(unsigned short ca, lcid_type id) +BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is_upper(unsigned short ca, lcid_type idx) { WORD mask; wchar_t c = ca; - if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER)) + if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER)) return true; return false; } @@ -322,11 +322,11 @@ BOOST_REGEX_DECL std::basic_string BOOST_REGEX_CALL w32_cat_get( } #endif #endif -BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_transform(lcid_type id, const char* p1, const char* p2) +BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_transform(lcid_type idx, const char* p1, const char* p2) { #ifndef BOOST_NO_ANSI_APIS int bytes = ::LCMapStringA( - id, // locale identifier + idx, // locale identifier LCMAP_SORTKEY, // mapping transformation type p1, // source string static_cast(p2 - p1), // number of characters in source string @@ -337,7 +337,7 @@ BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_transform(lcid_type id, const return std::string(p1, p2); std::string result(++bytes, '\0'); bytes = ::LCMapStringA( - id, // locale identifier + idx, // locale identifier LCMAP_SORTKEY, // mapping transformation type p1, // source string static_cast(p2 - p1), // number of characters in source string @@ -345,7 +345,7 @@ BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_transform(lcid_type id, const bytes // size of destination buffer ); #else - UINT code_page = get_code_page_for_locale_id(id); + UINT code_page = get_code_page_for_locale_id(idx); if(code_page == 0) return std::string(p1, p2); @@ -355,7 +355,7 @@ BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_transform(lcid_type id, const return std::string(p1, p2); int bytes = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_SORTKEY, // mapping transformation type wide_p1, // source string src_len, // number of characters in source string @@ -366,7 +366,7 @@ BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_transform(lcid_type id, const return std::string(p1, p2); std::string result(++bytes, '\0'); bytes = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_SORTKEY, // mapping transformation type wide_p1, // source string src_len, // number of characters in source string @@ -384,10 +384,10 @@ BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_transform(lcid_type id, const } #ifndef BOOST_NO_WREGEX -BOOST_REGEX_DECL std::wstring BOOST_REGEX_CALL w32_transform(lcid_type id, const wchar_t* p1, const wchar_t* p2) +BOOST_REGEX_DECL std::wstring BOOST_REGEX_CALL w32_transform(lcid_type idx, const wchar_t* p1, const wchar_t* p2) { int bytes = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_SORTKEY, // mapping transformation type p1, // source string static_cast(p2 - p1), // number of characters in source string @@ -398,7 +398,7 @@ BOOST_REGEX_DECL std::wstring BOOST_REGEX_CALL w32_transform(lcid_type id, const return std::wstring(p1, p2); std::string result(++bytes, '\0'); bytes = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_SORTKEY, // mapping transformation type p1, // source string static_cast(p2 - p1), // number of characters in source string @@ -417,10 +417,10 @@ BOOST_REGEX_DECL std::wstring BOOST_REGEX_CALL w32_transform(lcid_type id, const return r2; } #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T -BOOST_REGEX_DECL std::basic_string BOOST_REGEX_CALL w32_transform(lcid_type id, const unsigned short* p1, const unsigned short* p2) +BOOST_REGEX_DECL std::basic_string BOOST_REGEX_CALL w32_transform(lcid_type idx, const unsigned short* p1, const unsigned short* p2) { int bytes = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_SORTKEY, // mapping transformation type (LPCWSTR)p1, // source string static_cast(p2 - p1), // number of characters in source string @@ -431,7 +431,7 @@ BOOST_REGEX_DECL std::basic_string BOOST_REGEX_CALL w32_transfor return std::basic_string(p1, p2); std::string result(++bytes, '\0'); bytes = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_SORTKEY, // mapping transformation type (LPCWSTR)p1, // source string static_cast(p2 - p1), // number of characters in source string @@ -451,12 +451,12 @@ BOOST_REGEX_DECL std::basic_string BOOST_REGEX_CALL w32_transfor } #endif #endif -BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_tolower(char c, lcid_type id) +BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_tolower(char c, lcid_type idx) { char result[2]; #ifndef BOOST_NO_ANSI_APIS int b = ::LCMapStringA( - id, // locale identifier + idx, // locale identifier LCMAP_LOWERCASE, // mapping transformation type &c, // source string 1, // number of characters in source string @@ -465,7 +465,7 @@ BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_tolower(char c, lcid_type id) if(b == 0) return c; #else - UINT code_page = get_code_page_for_locale_id(id); + UINT code_page = get_code_page_for_locale_id(idx); if (code_page == 0) return c; @@ -475,7 +475,7 @@ BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_tolower(char c, lcid_type id) WCHAR wide_result; int b = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_LOWERCASE, // mapping transformation type &wide_c, // source string 1, // number of characters in source string @@ -491,11 +491,11 @@ BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_tolower(char c, lcid_type id) } #ifndef BOOST_NO_WREGEX -BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_tolower(wchar_t c, lcid_type id) +BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_tolower(wchar_t c, lcid_type idx) { wchar_t result[2]; int b = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_LOWERCASE, // mapping transformation type &c, // source string 1, // number of characters in source string @@ -506,11 +506,11 @@ BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_tolower(wchar_t c, lcid_type id) return result[0]; } #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T -BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_tolower(unsigned short c, lcid_type id) +BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_tolower(unsigned short c, lcid_type idx) { wchar_t result[2]; int b = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_LOWERCASE, // mapping transformation type (wchar_t const*)&c, // source string 1, // number of characters in source string @@ -522,12 +522,12 @@ BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_tolower(unsigned short c, l } #endif #endif -BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_toupper(char c, lcid_type id) +BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_toupper(char c, lcid_type idx) { char result[2]; #ifndef BOOST_NO_ANSI_APIS int b = ::LCMapStringA( - id, // locale identifier + idx, // locale identifier LCMAP_UPPERCASE, // mapping transformation type &c, // source string 1, // number of characters in source string @@ -536,7 +536,7 @@ BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_toupper(char c, lcid_type id) if(b == 0) return c; #else - UINT code_page = get_code_page_for_locale_id(id); + UINT code_page = get_code_page_for_locale_id(idx); if(code_page == 0) return c; @@ -546,7 +546,7 @@ BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_toupper(char c, lcid_type id) WCHAR wide_result; int b = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_UPPERCASE, // mapping transformation type &wide_c, // source string 1, // number of characters in source string @@ -562,11 +562,11 @@ BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_toupper(char c, lcid_type id) } #ifndef BOOST_NO_WREGEX -BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_toupper(wchar_t c, lcid_type id) +BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_toupper(wchar_t c, lcid_type idx) { wchar_t result[2]; int b = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_UPPERCASE, // mapping transformation type &c, // source string 1, // number of characters in source string @@ -577,11 +577,11 @@ BOOST_REGEX_DECL wchar_t BOOST_REGEX_CALL w32_toupper(wchar_t c, lcid_type id) return result[0]; } #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T -BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_toupper(unsigned short c, lcid_type id) +BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_toupper(unsigned short c, lcid_type idx) { wchar_t result[2]; int b = ::LCMapStringW( - id, // locale identifier + idx, // locale identifier LCMAP_UPPERCASE, // mapping transformation type (wchar_t const*)&c, // source string 1, // number of characters in source string @@ -593,14 +593,14 @@ BOOST_REGEX_DECL unsigned short BOOST_REGEX_CALL w32_toupper(unsigned short c, l } #endif #endif -BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type id, boost::uint32_t m, char c) +BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m, char c) { WORD mask; #ifndef BOOST_NO_ANSI_APIS - if(::GetStringTypeExA(id, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) + if(::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) return true; #else - UINT code_page = get_code_page_for_locale_id(id); + UINT code_page = get_code_page_for_locale_id(idx); if(code_page == 0) return false; @@ -608,7 +608,7 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type id, boost::uint32_t m, c if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) return false; - if(::GetStringTypeExW(id, CT_CTYPE1, &wide_c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) + if(::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) return true; #endif if((m & w32_regex_traits_implementation::mask_word) && (c == '_')) @@ -617,10 +617,10 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type id, boost::uint32_t m, c } #ifndef BOOST_NO_WREGEX -BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type id, boost::uint32_t m, wchar_t c) +BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m, wchar_t c) { WORD mask; - if(::GetStringTypeExW(id, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) + if(::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) return true; if((m & w32_regex_traits_implementation::mask_word) && (c == '_')) return true; @@ -629,10 +629,10 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type id, boost::uint32_t m, w return false; } #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T -BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type id, boost::uint32_t m, unsigned short c) +BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m, unsigned short c) { WORD mask; - if(::GetStringTypeExW(id, CT_CTYPE1, (wchar_t const*)&c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) + if(::GetStringTypeExW(idx, CT_CTYPE1, (wchar_t const*)&c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) return true; if((m & w32_regex_traits_implementation::mask_word) && (c == '_')) return true; diff --git a/boost/libs/regex/src/wc_regex_traits.cpp b/boost/libs/regex/src/wc_regex_traits.cpp index fb622b5ad9..a9e96d9ec8 100755 --- a/boost/libs/regex/src/wc_regex_traits.cpp +++ b/boost/libs/regex/src/wc_regex_traits.cpp @@ -195,16 +195,16 @@ c_regex_traits::char_class_type BOOST_REGEX_CALL c_regex_traits(sizeof(masks) / sizeof(masks[0]))); - return masks[id+1]; + BOOST_ASSERT(idx+1 < static_cast(sizeof(masks) / sizeof(masks[0]))); + return masks[idx+1]; } bool BOOST_REGEX_CALL c_regex_traits::isctype(wchar_t c, char_class_type mask) -- 2.39.2