From 7d61e78d56f981fd70db51fa99237a36b0b586dc Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 30 Apr 2006 03:04:18 +0000 Subject: [PATCH 01/92] Keep bool_trait_def.hpp as the last #include; add bool_trait_undef.hpp at the end. [SVN r33867] --- include/boost/detail/is_incrementable.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/is_incrementable.hpp b/include/boost/detail/is_incrementable.hpp index 0ae4eca..cb7d7a7 100755 --- a/include/boost/detail/is_incrementable.hpp +++ b/include/boost/detail/is_incrementable.hpp @@ -4,13 +4,15 @@ #ifndef IS_INCREMENTABLE_DWA200415_HPP # define IS_INCREMENTABLE_DWA200415_HPP -# include # include # include # include # include # include +// Must be the last include +# include + namespace boost { namespace detail { // is_incrementable metafunction @@ -117,5 +119,6 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1, ::boost::detail::is_postfix_incrementable) } // namespace boost +# include #endif // IS_INCREMENTABLE_DWA200415_HPP From d2e2b5911115f2fa86ac847c5de310272d2270a8 Mon Sep 17 00:00:00 2001 From: Matthias Troyer Date: Sun, 30 Apr 2006 23:56:35 +0000 Subject: [PATCH 02/92] *** empty log message *** [SVN r33878] --- .../boost/detail/has_default_constructor.hpp | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 include/boost/detail/has_default_constructor.hpp diff --git a/include/boost/detail/has_default_constructor.hpp b/include/boost/detail/has_default_constructor.hpp new file mode 100644 index 0000000..319b30a --- /dev/null +++ b/include/boost/detail/has_default_constructor.hpp @@ -0,0 +1,29 @@ + +// (C) Copyright Matthias Troyerk 2006. +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED +#define BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED + +#include + +namespace boost { namespace detail { + +/// type trait to check for a default constructor +/// +/// The default implementation just checks for a trivial constructor. +/// Using some compiler magic it might be possible to provide a better default + +template +struct has_default_constructor + : public has_trivial_constructor +{}; + +} } // namespace boost::detail + + +#endif // BOOST_DETAIL_HAS_DEFAULT_CONSTRUCTOR_HPP_INCLUDED From e71cca99a6d01e1d62d5c1085ba16d144515b09b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 17 May 2006 22:33:47 +0000 Subject: [PATCH 03/92] Windows CE patch by Michael Fink [SVN r33986] --- include/boost/detail/interlocked.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 3149319..76a24c3 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -31,6 +31,22 @@ # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer # define BOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer +#elif defined(_WIN32_WCE) + +// under Windows CE we still have old-style Interlocked* functions + +extern "C" long __cdecl InterlockedIncrement( long* ); +extern "C" long __cdecl InterlockedDecrement( long* ); +extern "C" long __cdecl InterlockedCompareExchange( long*, long, long ); +extern "C" long __cdecl InterlockedExchange( long*, long ); +extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); + +# define BOOST_INTERLOCKED_INCREMENT InterlockedIncrement +# define BOOST_INTERLOCKED_DECREMENT InterlockedDecrement +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE InterlockedCompareExchange +# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange +# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd + #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) extern "C" long __cdecl _InterlockedIncrement( long volatile * ); @@ -44,18 +60,25 @@ extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long); # pragma intrinsic( _InterlockedCompareExchange ) # pragma intrinsic( _InterlockedExchange ) # pragma intrinsic( _InterlockedExchangeAdd ) + # if defined(_M_IA64) || defined(_M_AMD64) + extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* ); extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* ); + # pragma intrinsic( _InterlockedCompareExchangePointer ) # pragma intrinsic( _InterlockedExchangePointer ) + # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer # define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer + # else + # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) # define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ ((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) + # endif # define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement @@ -77,6 +100,7 @@ extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volat extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long ); extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long ); extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long ); + } // namespace detail } // namespace boost @@ -86,6 +110,7 @@ extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long vol # define BOOST_INTERLOCKED_COMPARE_EXCHANGE ::boost::detail::InterlockedCompareExchange # define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd + # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) # define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ From 72a38b9137fb61a6fa75d4cf8f59348ea0196766 Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Sat, 19 Aug 2006 11:04:25 +0000 Subject: [PATCH 04/92] identification [SVN r34905] --- include/boost/pending/integer_log2.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/pending/integer_log2.hpp b/include/boost/pending/integer_log2.hpp index fd8e446..f85847b 100644 --- a/include/boost/pending/integer_log2.hpp +++ b/include/boost/pending/integer_log2.hpp @@ -12,7 +12,8 @@ // http://www.boost.org/LICENSE_1_0.txt) // // ------------------------------------------------------ - +// +// $Id$ #ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301 From e2bea194a38de8a84bbb07a39760c3601d932737 Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Sat, 19 Aug 2006 11:05:56 +0000 Subject: [PATCH 05/92] use ; include for Borland only [SVN r34906] --- include/boost/pending/integer_log2.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/pending/integer_log2.hpp b/include/boost/pending/integer_log2.hpp index f85847b..15fd8b5 100644 --- a/include/boost/pending/integer_log2.hpp +++ b/include/boost/pending/integer_log2.hpp @@ -19,8 +19,10 @@ #ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301 #define BOOST_INTEGER_LOG2_HPP_GP_20030301 -#include -#include // actually used for Borland only +#include +#ifdef __BORLANDC__ +#include +#endif #include "boost/limits.hpp" #include "boost/config.hpp" From afbb75b3cbc9b783343dffad84997d35dc08e73f Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 5 Oct 2006 13:51:07 +0000 Subject: [PATCH 06/92] Make is_reference_to_pointer work properly with an abstract class [SVN r35498] --- include/boost/detail/indirect_traits.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/boost/detail/indirect_traits.hpp b/include/boost/detail/indirect_traits.hpp index 6ee8a10..313d48b 100755 --- a/include/boost/detail/indirect_traits.hpp +++ b/include/boost/detail/indirect_traits.hpp @@ -388,27 +388,27 @@ typename is_pointer_help::type reference_to_pointer_helper(V&); outer_no_type reference_to_pointer_helper(...); template -struct is_reference_to_pointer +struct reference_to_pointer_impl { static T t; BOOST_STATIC_CONSTANT( bool, value - = (is_reference::value - && sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type)) + = (sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type)) ); typedef mpl::bool_ type; +} +template +struct is_reference_to_pointer + : mpl::eval_if, reference_to_pointer_impl, mpl::false_>::type +{ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T)) }; template struct is_reference_to_function_pointer - : mpl::if_< - is_reference - , is_pointer_to_function_aux - , mpl::bool_ - >::type + : mpl::eval_if, is_pointer_to_function_aux, false_>::type { BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T)) }; From cd03e4d53762bf661013b3ba00b431c3c0457f09 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 6 Oct 2006 15:45:41 +0000 Subject: [PATCH 07/92] Fix typos. [SVN r35505] --- include/boost/detail/indirect_traits.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/indirect_traits.hpp b/include/boost/detail/indirect_traits.hpp index 313d48b..f9c0cd6 100755 --- a/include/boost/detail/indirect_traits.hpp +++ b/include/boost/detail/indirect_traits.hpp @@ -397,7 +397,7 @@ struct reference_to_pointer_impl ); typedef mpl::bool_ type; -} +}; template struct is_reference_to_pointer @@ -408,7 +408,7 @@ struct is_reference_to_pointer template struct is_reference_to_function_pointer - : mpl::eval_if, is_pointer_to_function_aux, false_>::type + : mpl::eval_if, is_pointer_to_function_aux, mpl::false_>::type { BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T)) }; From 7106b3c8b12b2f032d5c7d7e377455953b92b2d6 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 13 Oct 2006 12:40:40 +0000 Subject: [PATCH 08/92] Added 64-bit Intel processor support. [SVN r35587] --- include/boost/detail/endian.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 5f12fbe..190fe98 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -47,7 +47,10 @@ #elif defined(__i386__) || defined(__alpha__) \ || defined(__ia64) || defined(__ia64__) \ || defined(_M_IX86) || defined(_M_IA64) \ - || defined(_M_ALPHA) + || defined(_M_ALPHA) || defined(__amd64) \ + || defined(__amd64__) || defined(_M_AMD64) \ + || defined(__x86_64) || defined(__x86_64__) \ + || defined(_M_X64) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 #else From 62b7d277f28620d2c15eb8336b3c72d6a2519580 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 13 Oct 2006 17:08:47 +0000 Subject: [PATCH 09/92] Fix for HP-UX on Itanium. [SVN r35591] --- include/boost/detail/endian.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 190fe98..5f5f9fd 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -39,7 +39,7 @@ # define BOOST_BYTE_ORDER __BYTE_ORDER #elif defined(__sparc) || defined(__sparc__) \ || defined(_POWER) || defined(__powerpc__) \ - || defined(__ppc__) || defined(__hppa) \ + || defined(__ppc__) || defined(__hpux) \ || defined(_MIPSEB) || defined(_POWER) \ || defined(__s390__) # define BOOST_BIG_ENDIAN From 751e8635647d6092e07a5b14a5f177310a0dec52 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 20 Oct 2006 10:08:21 +0000 Subject: [PATCH 10/92] Updated patch from Boris Gubenko. [SVN r35672] --- include/boost/detail/endian.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 5f5f9fd..524435d 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -37,6 +37,12 @@ # error Unknown machine endianness detected. # endif # define BOOST_BYTE_ORDER __BYTE_ORDER +#elif defined(_BIG_ENDIAN) +# define BOOST_BIG_ENDIAN +# define BOOST_BYTE_ORDER 4321 +#elif defined(_LITTLE_ENDIAN) +# define BOOST_LITTLE_ENDIAN +# define BOOST_BYTE_ORDER 1234 #elif defined(__sparc) || defined(__sparc__) \ || defined(_POWER) || defined(__powerpc__) \ || defined(__ppc__) || defined(__hpux) \ @@ -51,6 +57,7 @@ || defined(__amd64__) || defined(_M_AMD64) \ || defined(__x86_64) || defined(__x86_64__) \ || defined(_M_X64) + # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 #else From 4e009de1ec4d1f63b4740b87fc801b8ea2aca35c Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 3 Nov 2006 16:57:30 +0000 Subject: [PATCH 11/92] Bring into compliance with N2066, TR2 Diagnostics Enhancements. Tests passing on Win32, Linux, on most modern compilers. [SVN r35823] --- include/boost/detail/identifier.hpp | 86 +++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 include/boost/detail/identifier.hpp diff --git a/include/boost/detail/identifier.hpp b/include/boost/detail/identifier.hpp new file mode 100644 index 0000000..dee4bef --- /dev/null +++ b/include/boost/detail/identifier.hpp @@ -0,0 +1,86 @@ +// boost/identifier.hpp ----------------------------------------------------// + +// Copyright Beman Dawes 2006 + +// 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 documentation at http://www.boost.org/libs/utility + +#ifndef BOOST_IDENTIFIER_HPP +#define BOOST_IDENTIFIER_HPP + +#include +#include +#include + +namespace boost +{ + // class template identifier ---------------------------------------------// + + // Always used as a base class so that different instantiations result in + // different class types even if instantiated with the same value type T. + + // Expected usage is that T is often an integer type, best passed by + // value. There is no reason why T can't be a possibly larger class such as + // std::string, best passed by const reference. + + // This implementation uses pass by value, based on expected common uses. + + template + class identifier + { + public: + typedef T value_type; + + const value_type value() const { return m_value; } + void assign( value_type v ) { m_value = v; } + + bool operator==( const D & rhs ) const { return m_value == rhs.m_value; } + bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; } + bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; } + bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; } + bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; } + bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; } + + typedef void (*unspecified_bool_type)(D); // without the D, unspecified_bool_type + static void unspecified_bool_true(D){} // conversion allows relational operators + // between different identifier types + + operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; } + bool operator!() const { return m_value == value_type(); } + + // constructors are protected so that class can only be used as a base class + protected: + identifier() {} + explicit identifier( value_type v ) : m_value(v) {} + +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // 1300 == VC++ 7.0 bug workaround + private: +#endif + T m_value; + }; + +#ifndef BOOST_NO_SFINAE + + template + typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >, + Ostream & >::type operator<<( Ostream & os, const Id & id ) + { + return os << id.value(); + } + + template + typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >, + Istream & >::type operator>>( Istream & is, Id & id ) + { + typename Id::value_type v; + is >> v; + id.value( v ); + return is; + } +#endif + +} // namespace boost + +#endif // BOOST_IDENTIFIER_HPP From a548ecc9688eaf3fc17418dfcbbaab9daca83b1e Mon Sep 17 00:00:00 2001 From: Ronald Garcia Date: Mon, 13 Nov 2006 15:35:54 +0000 Subject: [PATCH 12/92] Replaced the implementation of ct_if with a facade implementation that defers to Boost.MPL. [SVN r36022] --- include/boost/pending/ct_if.hpp | 104 ++++++-------------------------- 1 file changed, 18 insertions(+), 86 deletions(-) diff --git a/include/boost/pending/ct_if.hpp b/include/boost/pending/ct_if.hpp index 2f8540d..a9b801e 100644 --- a/include/boost/pending/ct_if.hpp +++ b/include/boost/pending/ct_if.hpp @@ -3,107 +3,39 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// The ct_if implementation that avoids partial specialization is -// based on the IF class by Ulrich W. Eisenecker and Krzysztof -// Czarnecki. +// This header replaces the implementation of ct_if that preceded the +// introduction of Boost.MPL with a facade that defers to that reviewed and +// accepted library. + +// Author: Ronald Garcia +// Date: 20 October, 2006 + #ifndef BOOST_CT_IF_HPP #define BOOST_CT_IF_HPP -#include -/* - There is a bug in the Borland compiler with regards to using - integers to specialize templates. This made it hard to use ct_if in - the graph library. Changing from 'ct_if' to 'ct_if_t' fixed the - problem. -*/ +// A stub implementation in terms of Boost.MPL -#include // true_type and false_type +#include +#include +#include +// true_type and false_type are used by applications of ct_if +#include namespace boost { - struct ct_if_error { }; - template - struct ct_and { typedef false_type type; }; - template <> struct ct_and { typedef true_type type; }; + struct ct_and : boost::mpl::and_ {}; - template struct ct_not { typedef ct_if_error type; }; - template <> struct ct_not { typedef false_type type; }; - template <> struct ct_not { typedef true_type type; }; + template + struct ct_not : mpl::not_ {}; -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -// agurt, 15/sep/02: in certain cases Borland has problems with -// choosing the right 'ct_if' specialization even though 'cond' -// _does_ equal '1'; the easiest way to fix it is to make first -// 'ct_if' non-type template parameter boolean. -#if !defined(__BORLANDC__) template - struct ct_if { typedef ct_if_error type; }; - template - struct ct_if { typedef A type; }; - template - struct ct_if { typedef B type; }; -#else - template - struct ct_if { typedef A type; }; - template - struct ct_if { typedef B type; }; -#endif + struct ct_if : mpl::if_c {}; template - struct ct_if_t { typedef ct_if_error type; }; - template - struct ct_if_t { typedef A type; }; - template - struct ct_if_t { typedef B type; }; - -#else - - namespace detail { - - template struct IF; - template struct SlectSelector; - struct SelectFirstType; - struct SelectSecondType; - - struct SelectFirstType { - template - struct Template { typedef A type; }; - }; - - struct SelectSecondType { - template - struct Template { typedef B type; }; - }; - - template - struct SlectSelector { - typedef SelectFirstType type; - }; - - template <> - struct SlectSelector<0> { - typedef SelectSecondType type; - }; - - } // namespace detail - - template - struct ct_if - { - typedef typename detail::SlectSelector::type Selector; - typedef typename Selector::template Template::type type; - }; - - template - struct ct_if_t { - typedef typename ct_if::type type; - }; - -#endif + struct ct_if_t : mpl::if_ {}; } // namespace boost From 87ff652a07ae083c160678ef6c473569ff140034 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 13 Nov 2006 22:10:57 +0000 Subject: [PATCH 13/92] move to namespace detail [SVN r36027] --- include/boost/detail/identifier.hpp | 111 ++++++++++++++-------------- 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/include/boost/detail/identifier.hpp b/include/boost/detail/identifier.hpp index dee4bef..688a664 100644 --- a/include/boost/detail/identifier.hpp +++ b/include/boost/detail/identifier.hpp @@ -16,71 +16,74 @@ namespace boost { - // class template identifier ---------------------------------------------// - - // Always used as a base class so that different instantiations result in - // different class types even if instantiated with the same value type T. - - // Expected usage is that T is often an integer type, best passed by - // value. There is no reason why T can't be a possibly larger class such as - // std::string, best passed by const reference. - - // This implementation uses pass by value, based on expected common uses. - - template - class identifier + namespace detail { - public: - typedef T value_type; + // class template identifier ---------------------------------------------// - const value_type value() const { return m_value; } - void assign( value_type v ) { m_value = v; } + // Always used as a base class so that different instantiations result in + // different class types even if instantiated with the same value type T. - bool operator==( const D & rhs ) const { return m_value == rhs.m_value; } - bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; } - bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; } - bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; } - bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; } - bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; } + // Expected usage is that T is often an integer type, best passed by + // value. There is no reason why T can't be a possibly larger class such as + // std::string, best passed by const reference. - typedef void (*unspecified_bool_type)(D); // without the D, unspecified_bool_type - static void unspecified_bool_true(D){} // conversion allows relational operators - // between different identifier types + // This implementation uses pass by value, based on expected common uses. - operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; } - bool operator!() const { return m_value == value_type(); } + template + class identifier + { + public: + typedef T value_type; - // constructors are protected so that class can only be used as a base class - protected: - identifier() {} - explicit identifier( value_type v ) : m_value(v) {} + const value_type value() const { return m_value; } + void assign( value_type v ) { m_value = v; } -#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // 1300 == VC++ 7.0 bug workaround - private: -#endif - T m_value; - }; + bool operator==( const D & rhs ) const { return m_value == rhs.m_value; } + bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; } + bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; } + bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; } + bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; } + bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; } -#ifndef BOOST_NO_SFINAE + typedef void (*unspecified_bool_type)(D); // without the D, unspecified_bool_type + static void unspecified_bool_true(D){} // conversion allows relational operators + // between different identifier types - template - typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >, - Ostream & >::type operator<<( Ostream & os, const Id & id ) - { - return os << id.value(); - } + operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; } + bool operator!() const { return m_value == value_type(); } - template - typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >, - Istream & >::type operator>>( Istream & is, Id & id ) - { - typename Id::value_type v; - is >> v; - id.value( v ); - return is; - } -#endif + // constructors are protected so that class can only be used as a base class + protected: + identifier() {} + explicit identifier( value_type v ) : m_value(v) {} + #if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 // 1300 == VC++ 7.0 bug workaround + private: + #endif + T m_value; + }; + + //#ifndef BOOST_NO_SFINAE + + // template + // typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >, + // Ostream & >::type operator<<( Ostream & os, const Id & id ) + // { + // return os << id.value(); + // } + + // template + // typename enable_if< is_base_of< identifier< typename Id::value_type, Id >, Id >, + // Istream & >::type operator>>( Istream & is, Id & id ) + // { + // typename Id::value_type v; + // is >> v; + // id.value( v ); + // return is; + // } + //#endif + + } // namespace detail } // namespace boost #endif // BOOST_IDENTIFIER_HPP From 60e5d575c0601b8a6ff43d6596315a5964a78320 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 1 Dec 2006 10:29:49 +0000 Subject: [PATCH 14/92] Fixed license & copyright issues. [SVN r36224] --- include/boost/detail/endian.hpp | 4 ++++ include/boost/detail/utf8_codecvt_facet.hpp | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 524435d..4cc81ad 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -1,3 +1,7 @@ +// (c) Copyright John Maddock 2001 +// Distributed under the Boost Software License, Version 1.0. (See accompany- +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + /* * Copyright (c) 1997 * Silicon Graphics Computer Systems, Inc. diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index 88da207..3826ee6 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -1,9 +1,7 @@ // Copyright © 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) -// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). Permission to copy, -// use, modify, sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided "as is" -// without express or implied warranty, and with no claim as to its suitability -// for any purpose. +// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). +// Distributed under the Boost Software License, Version 1.0. (See accompany- +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_UTF8_CODECVT_FACET_HPP #define BOOST_UTF8_CODECVT_FACET_HPP From 57fd51f8f4896f8f5244bd4c8c9cfbb9a19f91a1 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 1 Dec 2006 14:27:03 +0000 Subject: [PATCH 15/92] Added Caleb as copyright owner. [SVN r36230] --- include/boost/detail/endian.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 4cc81ad..01a7689 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -1,4 +1,5 @@ -// (c) Copyright John Maddock 2001 +// (c) Copyright Caleb Epstein 2005 +// (c) Copyright John Maddock 2006 // Distributed under the Boost Software License, Version 1.0. (See accompany- // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) From 1da5dd89a87b45d5603008704b32419377883bf7 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Sat, 2 Dec 2006 10:04:37 +0000 Subject: [PATCH 16/92] Corrected wrong order in copyright notices. [SVN r36240] --- include/boost/detail/endian.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 01a7689..6936dba 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -1,5 +1,5 @@ -// (c) Copyright Caleb Epstein 2005 -// (c) Copyright John Maddock 2006 +// Copyright 2005 Caleb Epstein +// Copyright 2006 John Maddock // Distributed under the Boost Software License, Version 1.0. (See accompany- // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) From 82bda71faa8a0ad1bc6815e0e60e1f1afc621d96 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 25 Sep 2007 13:45:52 +0000 Subject: [PATCH 17/92] Clear compiler warnings [SVN r39520] --- utf8_codecvt_facet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 20d79de..8a8c3ca 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -139,8 +139,8 @@ std::codecvt_base::result utf8_codecvt_facet::do_out( int shift_exponent = (cont_octet_count) * 6; // Process the first character - *to++ = octet1_modifier_table[cont_octet_count] + - (unsigned char)(*from / (1 << shift_exponent)); + *to++ = static_cast(octet1_modifier_table[cont_octet_count] + + (unsigned char)(*from / (1 << shift_exponent))); // Process the continuation characters // Invariants: At the start of the loop: @@ -150,7 +150,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out( int i = 0; while (i != cont_octet_count && to != to_end) { shift_exponent -= 6; - *to++ = 0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)); + *to++ = static_cast(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6))); ++i; } // If we filled up the out buffer before encoding the character @@ -199,7 +199,7 @@ int utf8_codecvt_facet::do_length( last_octet_count = (get_octet_count(*from_next)); ++char_count; } - return from_next-from_end; + return static_cast(from_next-from_end); } unsigned int utf8_codecvt_facet::get_octet_count( From 6443246b4bd827ba9be581abac44f9a9a9a85d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Thu, 11 Oct 2007 10:57:30 +0000 Subject: [PATCH 18/92] Boost 1.35 version of Boost.MultiIndex allocator_utilities.hpp: added partial_std_allocator_wrapper::value_type composite_key.hpp: used hash_fwd.hpp auto_space.hpp: added support for non-standard allocators bidir_node_iterator.hpp: moved friend-injected operators out of class copy_map.hpp: added support for non-standard allocators hash_index_args.hpp: removed deprecated use of hash_index_iterator.hpp: moved friend-injected operators our of class hash_index_node.hpp: added support for non-standard allocators header_holder.hpp:added support for non-standard allocators index_base.hpp: added support for non-standard allocators, added modify_rollback, added small improvement to modify index_loader.hpp: added support for non-standard allocators index_matcher.hpp: added support for non-standard allocators index_node_base.hpp: added support for non-standard allocators iter_adaptor.hpp: added some out-of-class operators to alleviate a MSVC++ 6.0 problem modify_key_adaptor.hpp: renamed some vars to accomudate broader usage scope node_type.hpp: added support for non-standard allocators ord_index_node.hpp: added support for non-standard allocators ord_index_ops.hpp: implemented a more efficient equal_range rnd_index_loader.hpp: added support for non-standard allocators rnd_index_node.hpp: added support for non-standard allocators rnd_index_ops.hpp: added support for non-standard allocators rnd_index_ptr_array.hpp: added support for non-standard allocators rnd_node_iterator.hpp: moved friend-injected operators out of class seq_index_node.hpp: added support for non-standard allocators seq_index_ops.hpp: added support for non-standard allocators uintptr_type.hpp: added support for __int64 unbounded.hpp: fixed ODR problem value_compare.hpp: fixed a small unefficiency global_fun: initial commit hashed_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, [local_]iterator_to, rollback modify identity_fwd.hpp: fixed wrong include guard name key_extractors.hpp: added global_fun mem_fun.hpp: removed superfluous =0's ordered_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, iterator_to, rollback modify, improved equal_range and range, added conformance to DR 233 random_access_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, iterator_to, rollback modify, added conformance to 23.1.1/9 sequenced_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, iterator_to, rollback modify, added conformance to 23.1.1/9, improved resize multi_index_container.hpp: added support for non-standard allocators, improved ctor_args_list, rollback modify acknowledgements.html: added entry for Boost 1.35 examples.html: renamed example 2, added B.IP example/composite_keys.cpp future_work.html: removed entry on bimap hash_indices.html: added c[r]{begin|end}, [local_]iterator_to, rollback modify reference/index.html: added global_fun reference/key_extraction.html: added global_fun, added technical correction multi_index_container.html: added support for non-standard allocators ord_indices.html: added c[r]{begin|end}, iterator_to, rollback modify rnd_indices.html: added c[r]{begin|end}, iterator_to, rollback modify seq_indices.html: added c[r]{begin|end}, iterator_to, rollback modify release_notes.html: added entry for Boost 1.35 tests.html: added new serialization test file basics.html: added rollback modify creation.html: added support for non-standard allocators tutorial/indices.html: added iterator_to tutorial/key_extraction.html: added global_fun composite_keys.cpp: fixed technicality fun_key.cpp: was memfun_key.cpp, added global_fun ip_allocator.cpp: initial commit example/Jamfile.v2: renamed memfun_key, added ip_allocator test_perf.cpp: fixed technicality employee.hpp: used a non-standard allocator test/Jamfile.v2: added new test file non_std_allocator.hpp: initial commit pair_of_ints.hpp: added decrement facilities test_capacity.cpp: added extra check on resize test_copy_assignment.cpp: added test for 23.1.1/9 test_iterators.cpp: added tests for c[r]{begin|end} and [local_]iterator_to, fixed technicality test_key_extractors.cpp: added tests for global_fun test_modifiers.cpp: added tests dor DR 233, fixed technicality test_range.cpp: added extra checks to secure range refactoring test_rearrange.cpp: fixed technicality test_serialization.cpp: added new test file test_serialization1.cpp: corrected include, used a non-standard allocator test_serialization2.cpp: corrected include, used a non-standard allocator, split some stuff ro test_serialization3.cpp test_serialization3.cpp: initial commit test_serialization3.hpp: initial commit test_serialization_template.hpp: removed some reliance on ADL test_update.cpp: addes tests for rollback modify, fixed technicality [SVN r39922] --- include/boost/detail/allocator_utilities.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/allocator_utilities.hpp b/include/boost/detail/allocator_utilities.hpp index 6929087..5a9a79e 100644 --- a/include/boost/detail/allocator_utilities.hpp +++ b/include/boost/detail/allocator_utilities.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2005 Joaquín M López Muñoz. +/* Copyright 2003-2007 Joaquín M López Muñoz. * 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) @@ -30,13 +30,21 @@ namespace detail{ namespace allocator{ /* partial_std_allocator_wrapper inherits the functionality of a std - * allocator while providing a templatized ctor. + * allocator while providing a templatized ctor and other bits missing + * in some stdlib implementation or another. */ template class partial_std_allocator_wrapper:public std::allocator { public: + /* Oddly enough, STLport does not define std::allocator::value_type + * when configured to work without partial template specialization. + * No harm in supplying the definition here unconditionally. + */ + + typedef Type value_type; + partial_std_allocator_wrapper(){}; template From 715c05005fee28d7e990255adb9efbe1c0f7da24 Mon Sep 17 00:00:00 2001 From: Anthony Williams Date: Fri, 2 Nov 2007 09:17:02 +0000 Subject: [PATCH 19/92] Added changes from David Deakins to enable compilation on Windows CE [SVN r40679] --- include/boost/detail/interlocked.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 76a24c3..258320c 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -47,6 +47,11 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare))) +# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)BOOST_INTERLOCKED_EXCHANGE((long*)(dest),(long)(exchange))) + #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) extern "C" long __cdecl _InterlockedIncrement( long volatile * ); From 9dcdea9efc0ddd74a7617d5da66058c72faaa011 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 2 Apr 2008 01:42:32 +0000 Subject: [PATCH 20/92] Replaced all occurrences of non-ASCII copyright symbol with '(c)' for people using non-ASCII code pages [SVN r43992] --- include/boost/detail/utf8_codecvt_facet.hpp | 2 +- utf8_codecvt_facet.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index 3826ee6..ac7e7bf 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -1,4 +1,4 @@ -// Copyright © 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) // Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). // Distributed under the Boost Software License, Version 1.0. (See accompany- // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 8a8c3ca..658ab6a 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -1,7 +1,7 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // utf8_codecvt_facet.cpp -// Copyright © 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) // Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at From e4054d843aee99a1a7a0c3699398e96054be3270 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 5 Apr 2008 15:06:31 +0000 Subject: [PATCH 21/92] spinlock_nt.hpp added, Cygwin fixes. [SVN r44055] --- include/boost/detail/interlocked.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 258320c..b6c8d75 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -92,7 +92,7 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* ); # define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd -#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) +#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ ) namespace boost { From 3d539b76df2514a6fdb5355ccbf13394b8890064 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 20 Apr 2008 15:37:08 +0000 Subject: [PATCH 22/92] Factored out boost/detail/lightweight_thread.hpp. [SVN r44638] --- include/boost/detail/lightweight_thread.hpp | 135 ++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 include/boost/detail/lightweight_thread.hpp diff --git a/include/boost/detail/lightweight_thread.hpp b/include/boost/detail/lightweight_thread.hpp new file mode 100644 index 0000000..6fe70a6 --- /dev/null +++ b/include/boost/detail/lightweight_thread.hpp @@ -0,0 +1,135 @@ +#ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED +#define BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// boost/detail/lightweight_thread.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// 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 +#include + +// pthread_create, pthread_join + +#if defined( BOOST_HAS_PTHREADS ) + +#include + +#else + +#include +#include + +typedef HANDLE pthread_t; + +int pthread_create( pthread_t * thread, void const *, unsigned (__stdcall * start_routine) (void*), void* arg ) +{ + HANDLE h = (HANDLE)_beginthreadex( 0, 0, start_routine, arg, 0, 0 ); + + if( h != 0 ) + { + *thread = h; + return 0; + } + else + { + return EAGAIN; + } +} + +int pthread_join( pthread_t thread, void ** /*value_ptr*/ ) +{ + ::WaitForSingleObject( thread, INFINITE ); + ::CloseHandle( thread ); + return 0; +} + +#endif + +// template int lw_thread_create( pthread_t & pt, F f ); + +namespace boost +{ + +namespace detail +{ + +class lw_abstract_thread +{ +public: + + virtual ~lw_abstract_thread() {} + virtual void run() = 0; +}; + +#if defined( BOOST_HAS_PTHREADS ) + +extern "C" void * lw_thread_routine( void * pv ) +{ + std::auto_ptr pt( static_cast( pv ) ); + + pt->run(); + + return 0; +} + +#else + +unsigned __stdcall lw_thread_routine( void * pv ) +{ + std::auto_ptr pt( static_cast( pv ) ); + + pt->run(); + + return 0; +} + +#endif + +template class lw_thread_impl: public lw_abstract_thread +{ +public: + + explicit lw_thread_impl( F f ): f_( f ) + { + } + + void run() + { + f_(); + } + +private: + + F f_; +}; + +template int lw_thread_create( pthread_t & pt, F f ) +{ + std::auto_ptr p( new lw_thread_impl( f ) ); + + int r = pthread_create( &pt, 0, lw_thread_routine, p.get() ); + + if( r == 0 ) + { + p.release(); + } + + return r; +} + +} // namespace detail +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED From 7e259580c1532e678509075c0944d2086bc34f52 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 21 May 2008 15:39:41 +0000 Subject: [PATCH 23/92] Apply NetBSD fix from issue #1922. [SVN r45608] --- include/boost/detail/endian.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 6936dba..6394d92 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -42,10 +42,10 @@ # error Unknown machine endianness detected. # endif # define BOOST_BYTE_ORDER __BYTE_ORDER -#elif defined(_BIG_ENDIAN) +#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 -#elif defined(_LITTLE_ENDIAN) +#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 #elif defined(__sparc) || defined(__sparc__) \ From 96b53f28a8bf5002764021bbad796871fd5cf821 Mon Sep 17 00:00:00 2001 From: Jonathan Turkanis Date: Sun, 25 May 2008 23:36:55 +0000 Subject: [PATCH 24/92] silenced warning about comma operator (C4913) for VC 8-9 with warning level 4 [SVN r45754] --- include/boost/detail/is_incrementable.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) mode change 100755 => 100644 include/boost/detail/is_incrementable.hpp diff --git a/include/boost/detail/is_incrementable.hpp b/include/boost/detail/is_incrementable.hpp old mode 100755 new mode 100644 index cb7d7a7..1c8fd57 --- a/include/boost/detail/is_incrementable.hpp +++ b/include/boost/detail/is_incrementable.hpp @@ -63,7 +63,12 @@ namespace is_incrementable_ tag operator,(tag,int); # define BOOST_comma(a,b) (a,b) # endif - + +# if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4913) // Warning about operator, +# endif + // two check overloads help us identify which operator++ was picked char (& check(tag) )[2]; @@ -92,6 +97,11 @@ namespace is_incrementable_ , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1 ); }; + +# if defined(BOOST_MSVC) +# pragma warning(pop) +# endif + } # undef BOOST_comma From 7c911e570ffb3878c6487587e4492a8c1ceacbe0 Mon Sep 17 00:00:00 2001 From: Robert Ramey Date: Sat, 14 Jun 2008 17:46:41 +0000 Subject: [PATCH 25/92] modification to correct error detected on stdxxx tests [SVN r46392] --- include/boost/detail/utf8_codecvt_facet.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index ac7e7bf..a8bedc2 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -79,10 +79,8 @@ // specialized on those types for this to work. #include -// for mbstate_t -#include -// for std::size_t -#include +#include // for mbstate_t +#include // for std::size_t #include #include From 3c2c779258e0f8e4773c6839791228cc2734f86f Mon Sep 17 00:00:00 2001 From: Robert Ramey Date: Sun, 15 Jun 2008 17:01:43 +0000 Subject: [PATCH 26/92] simplified namespace issue with mbstate_t [SVN r46408] --- include/boost/detail/utf8_codecvt_facet.hpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index a8bedc2..13c8346 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -85,17 +85,10 @@ #include #include -namespace std { - #if defined(__LIBCOMO__) - using ::mbstate_t; - #elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__) - using ::mbstate_t; - #elif defined(__SGI_STL_PORT) - #elif defined(BOOST_NO_STDC_NAMESPACE) - using ::mbstate_t; - using ::codecvt; - #endif -} // namespace std +#if defined(BOOST_NO_STDC_NAMESPACE) + using ::codecvt; + using ::mbstate_t; +#endif #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) #define BOOST_CODECVT_DO_LENGTH_CONST const From 06946f66073853f8a99650b6a88cbee741b43819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Fri, 27 Jun 2008 13:32:24 +0000 Subject: [PATCH 27/92] Boost 1.36 version of Boost.MultiIndex passim: supressed non-ASCII chars in C++ code bidir_node_iterator.hpp: deleted unused template parameter bucket_array.hpp: avoided allocator instantiations hash_index_iterator.hpp: avoided allocator instantiations hash_index_node.hpp: avoided allocator instantiations, renamed var ord_index_node.hpp: avoided allocator instantiations rnd_index_loader.hpp: avoided allocator instantiations rnd_index_node.hpp: avoided allocator instantiations rnd_index_ptr_array.hpp: avoided allocator instantiations rnd_node_iterator.hpp: deleted unused template parameter seq_index_node.hpp: avoided allocator instantiations hashed_index.hpp: rewritten modify_ so that elements with unmodified key do not change position multi_index_container.hpp: added allocator ctor acknowledgements.html: added acknowledgements for Boost 1.36 compiler_specifics.html: typo hash_indices.html: documented updating functions behavior wrt unmodified keys, formatting typos key_extraction.html: formatting typos multi_index_container.html: added allocator ctor, formatting typos ord_indices.html: documented updating functions behavior wrt unmodified keys, formatting typos rnd_indices.html: formatting typos seq_indices.html: formatting typos release_notes.html: added release notes for Boost 1.36 hashed.cpp: blocked Boost inspect tool check for ASCII only chars non_std_allocator.hpp: removed void specialization to verify that no allocator instantiations are generated test_copy_assignment.cpp: added test for multi_index_container allocator ctor test_update.cpp: added test for stability of update functions wrt to unmodified keys [SVN r46770] --- include/boost/detail/allocator_utilities.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/allocator_utilities.hpp b/include/boost/detail/allocator_utilities.hpp index 5a9a79e..91b0fa7 100644 --- a/include/boost/detail/allocator_utilities.hpp +++ b/include/boost/detail/allocator_utilities.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2007 Joaquín M López Muñoz. +/* Copyright 2003-2008 Joaquin M Lopez Munoz. * 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) From 18dbae470094879cadc732688b8408e028b074c0 Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Wed, 20 Aug 2008 11:06:23 +0000 Subject: [PATCH 28/92] integer_log2.hpp and lowest_bit.hpp, in boost/pending/: little comment cleanup (svn anchors, etc.); added a static_cast<> to silence (harmless) MSVC++ warnings [SVN r48251] --- include/boost/pending/integer_log2.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/boost/pending/integer_log2.hpp b/include/boost/pending/integer_log2.hpp index 15fd8b5..f4bc846 100644 --- a/include/boost/pending/integer_log2.hpp +++ b/include/boost/pending/integer_log2.hpp @@ -1,20 +1,16 @@ -// ------------------------------------- +// ----------------------------------------------------------- // integer_log2.hpp // // Gives the integer part of the logarithm, in base 2, of a // given number. Behavior is undefined if the argument is <= 0. // -// -// (C) Copyright Gennaro Prota 2003 - 2004. +// Copyright (c) 2003-2004, 2008 Gennaro Prota // // 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) // -// ------------------------------------------------------ -// -// $Id$ - +// ----------------------------------------------------------- #ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301 #define BOOST_INTEGER_LOG2_HPP_GP_20030301 @@ -37,7 +33,7 @@ namespace boost { while (x != 1) { - const T t = x >> n; + const T t = static_cast(x >> n); if (t) { result += n; x = t; From da0f568852c0da62f76d86b91d77e358dc7e39ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Sun, 12 Oct 2008 13:06:22 +0000 Subject: [PATCH 29/92] added workaround for http://bugs.sun.com/view_bug.do?bug_id=6757317 , also discussed at http://lists.boost.org/boost-users/2008/10/41154.php [SVN r49289] --- include/boost/detail/allocator_utilities.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/boost/detail/allocator_utilities.hpp b/include/boost/detail/allocator_utilities.hpp index 91b0fa7..6453af0 100644 --- a/include/boost/detail/allocator_utilities.hpp +++ b/include/boost/detail/allocator_utilities.hpp @@ -181,7 +181,13 @@ void construct(void* p,const Type& t) template void destroy(const Type* p) { + +#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590)) + const_cast(p)->~Type(); +#else p->~Type(); +#endif + } } /* namespace boost::detail::allocator */ From c6024a4ac45b5458b03896b0d5e3b85d9fc59d43 Mon Sep 17 00:00:00 2001 From: Robert Ramey Date: Sun, 12 Oct 2008 19:49:05 +0000 Subject: [PATCH 30/92] include header which includes "size_t" [SVN r49298] --- include/boost/detail/utf8_codecvt_facet.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index 13c8346..5a73e54 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -79,8 +79,8 @@ // specialized on those types for this to work. #include -#include // for mbstate_t -#include // for std::size_t +#include // for mbstate_t +#include // for std::size_t #include #include @@ -88,6 +88,7 @@ #if defined(BOOST_NO_STDC_NAMESPACE) using ::codecvt; using ::mbstate_t; + using ::size_t #endif #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) From 20ab8a4e7de6aec14e6ad58e6052774bc104befd Mon Sep 17 00:00:00 2001 From: "Michael A. Jackson" Date: Sat, 1 Nov 2008 13:15:41 +0000 Subject: [PATCH 31/92] Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor [SVN r49510] --- CMakeLists.txt | 21 +++++++++++++++++++++ module.cmake | 1 + 2 files changed, 22 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 module.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e019675 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +#---------------------------------------------------------------------------- +# This file was automatically generated from the original CMakeLists.txt file +# Add a variable to hold the headers for the library +set (lib_headers + detail +) + +# Add a library target to the build system +boost_library_project( + detail + # SRCDIRS + # TESTDIRS + HEADERS ${lib_headers} + # DOCDIRS + # DESCRIPTION "Helps Boost library developers adapt to compiler idiosyncrasies; not intended for library users." + MODULARIZED + # AUTHORS "John Maddock " + # MAINTAINERS +) + + diff --git a/module.cmake b/module.cmake new file mode 100644 index 0000000..123eff6 --- /dev/null +++ b/module.cmake @@ -0,0 +1 @@ +boost_module(detail DEPENDS integer) \ No newline at end of file From 34684d4df2c2f9fb29f24aa75f6f6e7fca2c1b1d Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 9 Nov 2008 12:03:45 +0000 Subject: [PATCH 32/92] Move hash detail headers out of boost/functional/detail. [SVN r49661] --- include/boost/detail/container_fwd.hpp | 95 ++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 include/boost/detail/container_fwd.hpp diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp new file mode 100644 index 0000000..8685905 --- /dev/null +++ b/include/boost/detail/container_fwd.hpp @@ -0,0 +1,95 @@ + +// Copyright 2005-2008 Daniel James. +// 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) + +#if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP) +#define BOOST_DETAIL_CONTAINER_FWD_HPP + +#include +#include + +#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) +#define BOOST_HASH_CHAR_TRAITS string_char_traits +#else +#define BOOST_HASH_CHAR_TRAITS char_traits +#endif + +#if (defined(__GLIBCXX__) && defined(_GLIBCXX_DEBUG)) \ + || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \ + || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ + || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) + +#include +#include +#include +#include +#include +#include +#include +#include + +#else + +#include + +#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && \ + defined(__STL_CONFIG_H) + +#define BOOST_CONTAINER_FWD_BAD_BITSET + +#if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG) +#define BOOST_CONTAINER_FWD_BAD_DEQUE +#endif + +#endif + +#if defined(BOOST_CONTAINER_FWD_BAD_DEQUE) +#include +#endif + +#if defined(BOOST_CONTAINER_FWD_BAD_BITSET) +#include +#endif + +#if defined(BOOST_MSVC) +#pragma warning(push) +#pragma warning(disable:4099) // struct/class mismatch in fwd declarations +#endif + +namespace std +{ + template class allocator; + template class basic_string; + template struct BOOST_HASH_CHAR_TRAITS; + template class complex; +} + +// gcc 3.4 and greater +namespace std +{ +#if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE) + template class deque; +#endif + + template class list; + template class vector; + template class map; + template + class multimap; + template class set; + template class multiset; + +#if !defined(BOOST_CONTAINER_FWD_BAD_BITSET) + template class bitset; +#endif + template struct pair; +} + +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + +#endif + +#endif From 120abc637cbb9efa4d19744ac39e54fe12b05098 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 9 Nov 2008 12:11:50 +0000 Subject: [PATCH 33/92] Add a forwarding header for container_fwd.hpp [SVN r49662] --- include/boost/detail/container_fwd.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 8685905..b7e3a71 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -6,6 +6,10 @@ #if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP) #define BOOST_DETAIL_CONTAINER_FWD_HPP +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + #include #include From d2ce3c57919b0eda92024cb28201b58dcf315a15 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 19 Jan 2009 18:52:23 +0000 Subject: [PATCH 34/92] Add Blackfin support to fix #2663 [SVN r50675] --- include/boost/detail/endian.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 6394d92..803d7e2 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -61,7 +61,7 @@ || defined(_M_ALPHA) || defined(__amd64) \ || defined(__amd64__) || defined(_M_AMD64) \ || defined(__x86_64) || defined(__x86_64__) \ - || defined(_M_X64) + || defined(_M_X64) || defined(__bfin__) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 From 816cad7bd8bc24b7c88cf1af911bee98c53f72d3 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Wed, 28 Jan 2009 14:38:48 +0000 Subject: [PATCH 35/92] Fix BOOST_NO_STDC_NAMESPACE problem; see ticket 2687 [SVN r50844] --- include/boost/detail/utf8_codecvt_facet.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index 5a73e54..1de932c 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -86,9 +86,11 @@ #include #if defined(BOOST_NO_STDC_NAMESPACE) +namespace std { using ::codecvt; using ::mbstate_t; using ::size_t +} #endif #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) From aaf3c4ac987071e35aa97dd91d72d93d38948884 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sat, 31 Jan 2009 02:47:48 +0000 Subject: [PATCH 36/92] Add missing semicolon [SVN r50920] --- include/boost/detail/utf8_codecvt_facet.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index 1de932c..e167c98 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -89,7 +89,7 @@ namespace std { using ::codecvt; using ::mbstate_t; - using ::size_t + using ::size_t; } #endif From 1588a4a05fa13c53969bb38bb4979bda9cf3f355 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 1 Mar 2009 16:00:42 +0000 Subject: [PATCH 37/92] Move smart_ptr into boost/smart_ptr/*.hpp (refs #2239). [SVN r51509] --- include/boost/detail/quick_allocator.hpp | 183 +---------------------- 1 file changed, 4 insertions(+), 179 deletions(-) diff --git a/include/boost/detail/quick_allocator.hpp b/include/boost/detail/quick_allocator.hpp index ddb0a76..d54b3a7 100644 --- a/include/boost/detail/quick_allocator.hpp +++ b/include/boost/detail/quick_allocator.hpp @@ -13,186 +13,11 @@ // Copyright (c) 2003 David Abrahams // Copyright (c) 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) +// 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 -#include -#include - -#include // ::operator new, ::operator delete -#include // std::size_t - -namespace boost -{ - -namespace detail -{ - -template union freeblock -{ - typedef typename boost::type_with_alignment::type aligner_type; - aligner_type aligner; - char bytes[size]; - freeblock * next; -}; - -template struct allocator_impl -{ - typedef freeblock block; - - // It may seem odd to use such small pages. - // - // However, on a typical Windows implementation that uses - // the OS allocator, "normal size" pages interact with the - // "ordinary" operator new, slowing it down dramatically. - // - // 512 byte pages are handled by the small object allocator, - // and don't interfere with ::new. - // - // The other alternative is to use much bigger pages (1M.) - // - // It is surprisingly easy to hit pathological behavior by - // varying the page size. g++ 2.96 on Red Hat Linux 7.2, - // for example, passionately dislikes 496. 512 seems OK. - -#if defined(BOOST_QA_PAGE_SIZE) - - enum { items_per_page = BOOST_QA_PAGE_SIZE / size }; - -#else - - enum { items_per_page = 512 / size }; // 1048560 / size - -#endif - -#ifdef BOOST_HAS_THREADS - - static lightweight_mutex & mutex() - { - static lightweight_mutex m; - return m; - } - - static lightweight_mutex * mutex_init; - -#endif - - static block * free; - static block * page; - static unsigned last; - - static inline void * alloc() - { -#ifdef BOOST_HAS_THREADS - lightweight_mutex::scoped_lock lock( mutex() ); -#endif - if(block * x = free) - { - free = x->next; - return x; - } - else - { - if(last == items_per_page) - { - // "Listen to me carefully: there is no memory leak" - // -- Scott Meyers, Eff C++ 2nd Ed Item 10 - page = ::new block[items_per_page]; - last = 0; - } - - return &page[last++]; - } - } - - static inline void * alloc(std::size_t n) - { - if(n != size) // class-specific new called for a derived object - { - return ::operator new(n); - } - else - { -#ifdef BOOST_HAS_THREADS - lightweight_mutex::scoped_lock lock( mutex() ); -#endif - if(block * x = free) - { - free = x->next; - return x; - } - else - { - if(last == items_per_page) - { - page = ::new block[items_per_page]; - last = 0; - } - - return &page[last++]; - } - } - } - - static inline void dealloc(void * pv) - { - if(pv != 0) // 18.4.1.1/13 - { -#ifdef BOOST_HAS_THREADS - lightweight_mutex::scoped_lock lock( mutex() ); -#endif - block * pb = static_cast(pv); - pb->next = free; - free = pb; - } - } - - static inline void dealloc(void * pv, std::size_t n) - { - if(n != size) // class-specific delete called for a derived object - { - ::operator delete(pv); - } - else if(pv != 0) // 18.4.1.1/13 - { -#ifdef BOOST_HAS_THREADS - lightweight_mutex::scoped_lock lock( mutex() ); -#endif - block * pb = static_cast(pv); - pb->next = free; - free = pb; - } - } -}; - -#ifdef BOOST_HAS_THREADS - -template - lightweight_mutex * allocator_impl::mutex_init = &allocator_impl::mutex(); - -#endif - -template - freeblock * allocator_impl::free = 0; - -template - freeblock * allocator_impl::page = 0; - -template - unsigned allocator_impl::last = allocator_impl::items_per_page; - -template -struct quick_allocator: public allocator_impl< sizeof(T), boost::alignment_of::value > -{ -}; - -} // namespace detail - -} // namespace boost +#include #endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED From 472ca5d636ab0ea4cd162967350fe7e4cd70bf2c Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Wed, 11 Mar 2009 20:19:27 +0000 Subject: [PATCH 38/92] Initial commit. [SVN r51715] --- .../boost/detail/scoped_enum_emulation.hpp | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 include/boost/detail/scoped_enum_emulation.hpp diff --git a/include/boost/detail/scoped_enum_emulation.hpp b/include/boost/detail/scoped_enum_emulation.hpp new file mode 100644 index 0000000..c008b4e --- /dev/null +++ b/include/boost/detail/scoped_enum_emulation.hpp @@ -0,0 +1,52 @@ +// scoped_enum_emulation.hpp ---------------------------------------------------------// + +// Copyright Beman Dawes, 2009 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +// Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x +// scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_SCOPED_ENUMS +// macro is used to detect feature support. +// +// See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a +// description of the scoped enum feature. Note that the committee changed the name +// from strongly typed enum to scoped enum. +// +// Caution: only the syntax is emulated; the semantics are not emulated and +// the syntax emulation doesn't include being able to specify the underlying +// representation type. +// +// The emulation is via struct rather than namespace to allow use within classes. +// Thanks to Andrey Semashev for pointing that out. +// +// Sample usage: +// +// BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END +// ... +// BOOST_SCOPED_ENUM(algae) sample( algae::red ); +// void foo( BOOST_SCOPED_ENUM(algae) color ); +// ... +// sample = algae::green; +// foo( algae::cyan ); + +#ifndef BOOST_SCOPED_ENUM_EMULATION_HPP +#define BOOST_SCOPED_ENUM_EMULATION_HPP + +#include + +#ifdef BOOST_NO_SCOPED_ENUMS + +# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_t +# define BOOST_SCOPED_ENUM_END }; +# define BOOST_SCOPED_ENUM(name) name::enum_t + +#else + +# define BOOST_SCOPED_ENUM_START(name) enum class name +# define BOOST_SCOPED_ENUM_END +# define BOOST_SCOPED_ENUM(name) name + +#endif + +#endif // BOOST_SCOPED_ENUM_EMULATION_HPP From a63bc49cfb2d13b04a9ce348f44f488cb4696f8c Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 24 Mar 2009 15:28:27 +0000 Subject: [PATCH 39/92] Initial commit [SVN r51958] --- include/boost/detail/test_framework.hpp | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 include/boost/detail/test_framework.hpp diff --git a/include/boost/detail/test_framework.hpp b/include/boost/detail/test_framework.hpp new file mode 100644 index 0000000..815ba68 --- /dev/null +++ b/include/boost/detail/test_framework.hpp @@ -0,0 +1,37 @@ +// test_framework.hpp ----------------------------------------------------------------// + +// Copyright Beman Dawes 2009 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +// A very simple test framework that avoids dependencies on Boost.Test + +#include + +namespace boost +{ + namespace test_framework + { + int error_count = 0; + + void check( const char * predicate, const char * file, int line ) + { + ++error_count; + + // format chosen to parse with VC++ IDE output + std::cout << file << "(" << line << ") : error: " + << predicate << " is false\n" << std::endl; + } + + int errors() + { + std::cout << " ***** " << error_count << " error(s) detected *****\n"; + return error_count; + } + } // namespace test_framework +} // namespace boost + +#define BOOST_CHECK(predicate) \ + (predicate) ? static_cast(0) : \ + boost::test_framework::check( #predicate, __FILE__, __LINE__ ) From 770e33343a99274f014a0bef518b52d76b9b8e6d Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Wed, 25 Mar 2009 12:11:47 +0000 Subject: [PATCH 40/92] System, Filesystem: remove boost/detail/test_framework.hpp; use boost/detail/lightweight_test.hpp instead (Thanks to Peter Dimov for pointing this out) [SVN r51966] --- include/boost/detail/test_framework.hpp | 37 ------------------------- 1 file changed, 37 deletions(-) delete mode 100644 include/boost/detail/test_framework.hpp diff --git a/include/boost/detail/test_framework.hpp b/include/boost/detail/test_framework.hpp deleted file mode 100644 index 815ba68..0000000 --- a/include/boost/detail/test_framework.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// test_framework.hpp ----------------------------------------------------------------// - -// Copyright Beman Dawes 2009 - -// Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - -// A very simple test framework that avoids dependencies on Boost.Test - -#include - -namespace boost -{ - namespace test_framework - { - int error_count = 0; - - void check( const char * predicate, const char * file, int line ) - { - ++error_count; - - // format chosen to parse with VC++ IDE output - std::cout << file << "(" << line << ") : error: " - << predicate << " is false\n" << std::endl; - } - - int errors() - { - std::cout << " ***** " << error_count << " error(s) detected *****\n"; - return error_count; - } - } // namespace test_framework -} // namespace boost - -#define BOOST_CHECK(predicate) \ - (predicate) ? static_cast(0) : \ - boost::test_framework::check( #predicate, __FILE__, __LINE__ ) From de4c1b2e9d003cb5f6b54360dfd7fef96b3fd620 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 26 Mar 2009 00:03:45 +0000 Subject: [PATCH 41/92] Add BOOST_TEST_EQ. [SVN r51976] --- include/boost/detail/lightweight_test.hpp | 26 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/include/boost/detail/lightweight_test.hpp b/include/boost/detail/lightweight_test.hpp index b651e0e..ffa750d 100644 --- a/include/boost/detail/lightweight_test.hpp +++ b/include/boost/detail/lightweight_test.hpp @@ -10,14 +10,15 @@ // // boost/detail/lightweight_test.hpp - lightweight test library // -// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2002, 2009 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) +// 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 // // BOOST_TEST(expression) // BOOST_ERROR(message) +// BOOST_TEST_EQ(expr1, expr2) // // int boost::report_errors() // @@ -49,13 +50,27 @@ inline void error_impl(char const * msg, char const * file, int line, char const ++test_errors(); } +template inline void test_eq_impl( char const * expr1, char const * expr2, char const * file, int line, char const * function, T const & t, U const & u ) +{ + if( t == u ) + { + } + else + { + std::cerr << file << "(" << line << "): test '" << expr1 << " == " << expr2 + << "' failed in function '" << function << "': " + << "'" << t << "' != '" << u << "'" << std::endl; + ++test_errors(); + } +} + } // namespace detail inline int report_errors() { int errors = detail::test_errors(); - if(errors == 0) + if( errors == 0 ) { std::cerr << "No errors detected." << std::endl; return 0; @@ -71,5 +86,6 @@ inline int report_errors() #define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)) #define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) +#define BOOST_TEST_EQ(expr1,expr2) ( ::boost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) ) #endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED From 3178938f98f5627fd800b392dc717ec596659847 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 8 Apr 2009 05:51:31 +0000 Subject: [PATCH 42/92] Detect gcc stdlib for gcc 4.0.1. For some reason the normal macros aren't defined for the standard library that comes with gcc 4.0.1 (although maybe just on BSDs?). So try to detect the library for that compiler. [SVN r52245] --- include/boost/detail/container_fwd.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index b7e3a71..b8767fd 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -19,7 +19,8 @@ #define BOOST_HASH_CHAR_TRAITS char_traits #endif -#if (defined(__GLIBCXX__) && defined(_GLIBCXX_DEBUG)) \ +#if ((defined(__GLIBCPP__) || defined(__GLIBCXX__) || defined(_GLIBCXX_CSTDDEF)) \ + && defined(_GLIBCXX_DEBUG)) \ || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) From d425f1e5bfb63eb72ef3bd521ede3ae381b86abe Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 8 Apr 2009 10:56:22 +0000 Subject: [PATCH 43/92] Include for some versions of gcc's library. Sometimes gcc's doesn't define the C++ macros, so check for it and include in that case. Also remove a workaround from container_fwd.hpp Fixes #2924. [SVN r52246] --- include/boost/detail/container_fwd.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index b8767fd..f54dedb 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -19,8 +19,7 @@ #define BOOST_HASH_CHAR_TRAITS char_traits #endif -#if ((defined(__GLIBCPP__) || defined(__GLIBCXX__) || defined(_GLIBCXX_CSTDDEF)) \ - && defined(_GLIBCXX_DEBUG)) \ +#if ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) && defined(_GLIBCXX_DEBUG)) \ || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) From da8fe765fde98b008b86cd7fc9bb1542eae8fc63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Mon, 13 Apr 2009 15:32:42 +0000 Subject: [PATCH 44/92] suppressed spurious MSVC warning [SVN r52371] --- include/boost/detail/allocator_utilities.hpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/allocator_utilities.hpp b/include/boost/detail/allocator_utilities.hpp index 6453af0..5d6ef48 100644 --- a/include/boost/detail/allocator_utilities.hpp +++ b/include/boost/detail/allocator_utilities.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2008 Joaquin M Lopez Munoz. +/* Copyright 2003-2009 Joaquin M Lopez Munoz. * 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) @@ -178,6 +178,15 @@ void construct(void* p,const Type& t) new (p) Type(t); } +#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500)) +/* MSVC++ issues spurious warnings about unreferencend formal parameters + * in destroy when Type is a class with trivial dtor. + */ + +#pragma warning(push) +#pragma warning(disable:4100) +#endif + template void destroy(const Type* p) { @@ -190,6 +199,10 @@ void destroy(const Type* p) } +#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500)) +#pragma warning(pop) +#endif + } /* namespace boost::detail::allocator */ } /* namespace boost::detail */ From 23850d984a7e3f2680dfb273862f20644fb7b0bf Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 16 Apr 2009 02:12:14 +0000 Subject: [PATCH 45/92] Yet another attempt to fix #2687 [SVN r52411] --- include/boost/detail/utf8_codecvt_facet.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index e167c98..b777ff9 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -87,7 +87,6 @@ #if defined(BOOST_NO_STDC_NAMESPACE) namespace std { - using ::codecvt; using ::mbstate_t; using ::size_t; } From 3911d7a669923c52fa2d75f89d3e21550ea9408b Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 12 May 2009 11:05:39 +0000 Subject: [PATCH 46/92] Add acknowledgments [SVN r52934] --- include/boost/detail/scoped_enum_emulation.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/detail/scoped_enum_emulation.hpp b/include/boost/detail/scoped_enum_emulation.hpp index c008b4e..644c138 100644 --- a/include/boost/detail/scoped_enum_emulation.hpp +++ b/include/boost/detail/scoped_enum_emulation.hpp @@ -20,6 +20,10 @@ // The emulation is via struct rather than namespace to allow use within classes. // Thanks to Andrey Semashev for pointing that out. // +// Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott, +// Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vincente +// Botet, and Daniel James. +// // Sample usage: // // BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END From cad13ace57dade31d2cdafdb639e9f439f7ffe9a Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Sat, 30 May 2009 09:44:00 +0000 Subject: [PATCH 47/92] Remove unnecessary operator. Fixes #2166. [SVN r53435] --- utf8_codecvt_facet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 658ab6a..45e8df2 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -159,7 +159,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out( to_next = to - (i+1); return std::codecvt_base::partial; } - *from++; + ++from; } from_next = from; to_next = to; From 8c3a497ec86a4ec852b8a124d969227bb8fca7c0 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sat, 30 May 2009 14:57:49 +0000 Subject: [PATCH 48/92] detail/utf8_codecvt_facet.cpp: apply patch from ticket #2986 to quiet warnings when wchar_t is 16-bits. [SVN r53459] --- utf8_codecvt_facet.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 45e8df2..0821c2f 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -231,9 +231,6 @@ int get_cont_octet_out_count_impl(wchar_t word){ return 2; } -// note the following code will generate on some platforms where -// wchar_t is defined as UCS2. The warnings are superfluous as -// the specialization is never instantitiated with such compilers. template<> int get_cont_octet_out_count_impl<4>(wchar_t word){ if (word < 0x80) { @@ -242,7 +239,19 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){ if (word < 0x800) { return 1; } - if (word < 0x10000) { + + // Note that the following code will generate warnings on some platforms + // where wchar_t is defined as UCS2. The warnings are superfluous as the + // specialization is never instantitiated with such compilers, but this + // can cause problems if warnings are being treated as errors, so we guard + // against that. Including as we do + // should be enough to get WCHAR_MAX defined. +#if !defined(WCHAR_MAX) +# error WCHAR_MAX not defined! +#endif +#if WCHAR_MAX > 0x10000 + + if (word < 0x10000) { return 2; } if (word < 0x200000) { @@ -252,6 +261,10 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){ return 4; } return 5; + +#else + return 2; +#endif } } // namespace anonymous From c8880373991a54063fdab0932740b8ab6d1666b7 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 6 Jun 2009 11:46:24 +0000 Subject: [PATCH 49/92] Support BOOST_NO_TYPEID and BOOST_NO_IOSTREAM in Boost.Variant. Fixes #3051. [SVN r53682] --- include/boost/blank.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/blank.hpp b/include/boost/blank.hpp index f84f2d9..d0fe5ab 100644 --- a/include/boost/blank.hpp +++ b/include/boost/blank.hpp @@ -15,9 +15,11 @@ #include "boost/blank_fwd.hpp" +#if !defined(BOOST_NO_IOSTREAM) #include // for std::basic_ostream forward declare - #include "boost/detail/templated_streams.hpp" +#endif // BOOST_NO_IOSTREAM + #include "boost/mpl/bool.hpp" #include "boost/type_traits/is_empty.hpp" #include "boost/type_traits/is_pod.hpp" @@ -85,6 +87,8 @@ inline bool operator>(const blank&, const blank&) // streaming support // +#if !defined(BOOST_NO_IOSTREAM) + BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<( BOOST_TEMPLATED_STREAM(ostream, E,T)& out @@ -95,6 +99,8 @@ inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<( return out; } +#endif // BOOST_NO_IOSTREAM + } // namespace boost #endif // BOOST_BLANK_HPP From 6a458a381b2103524e00218bd205feaf15a6d767 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Wed, 17 Jun 2009 22:40:14 +0000 Subject: [PATCH 50/92] Fix ticket #2986 patch for VC++ 7.1 and earlier; workaround WCHAR_MAX bug [SVN r54031] --- utf8_codecvt_facet.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 0821c2f..7ea5eeb 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -248,8 +248,11 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){ // should be enough to get WCHAR_MAX defined. #if !defined(WCHAR_MAX) # error WCHAR_MAX not defined! -#endif -#if WCHAR_MAX > 0x10000 +#endif + // cope with VC++ 7.1 or earlier having invalid WCHAR_MAX +#if defined(_MSC_VER) && _MSC_VER <= 1310 // 7.1 or earlier + return 2; +#elif WCHAR_MAX > 0x10000 if (word < 0x10000) { return 2; From 7247d512f828c140a085f2f1b1c90af1eb09bf1f Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 21 Jun 2009 09:42:20 +0000 Subject: [PATCH 51/92] Move BOOST_HASH_CHAR_TRAITS from container_fwd into the hash headers, and undefine it. [SVN r54143] --- include/boost/detail/container_fwd.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index f54dedb..bc7f780 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -13,12 +13,6 @@ #include #include -#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) -#define BOOST_HASH_CHAR_TRAITS string_char_traits -#else -#define BOOST_HASH_CHAR_TRAITS char_traits -#endif - #if ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) && defined(_GLIBCXX_DEBUG)) \ || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ @@ -65,7 +59,13 @@ namespace std { template class allocator; template class basic_string; - template struct BOOST_HASH_CHAR_TRAITS; + +#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) + template struct string_char_traits; +#else + template struct char_traits; +#endif + template class complex; } From 7dbb57bc823bda40664a2ee22028708892e85abc Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sun, 26 Jul 2009 00:49:56 +0000 Subject: [PATCH 52/92] Copyrights on CMakeLists.txt to keep them from clogging up the inspect reports. This is essentially the same commit as r55095 on the release branch. [SVN r55159] --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e019675..b75d9b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,9 @@ +# +# Copyright Troy D. Straszheim +# +# Distributed under the Boost Software License, Version 1.0. +# See http://www.boost.org/LICENSE_1_0.txt +# #---------------------------------------------------------------------------- # This file was automatically generated from the original CMakeLists.txt file # Add a variable to hold the headers for the library From 812c32a5a1bb14b1746f8afd5f6df54677d40135 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sat, 15 Aug 2009 14:20:28 +0000 Subject: [PATCH 53/92] Fix #3346 boost/detail/scoped_enum_emulation.hpp enum_t conflict with Unix rpc/types.h [SVN r55604] --- include/boost/detail/scoped_enum_emulation.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/scoped_enum_emulation.hpp b/include/boost/detail/scoped_enum_emulation.hpp index 644c138..e695a20 100644 --- a/include/boost/detail/scoped_enum_emulation.hpp +++ b/include/boost/detail/scoped_enum_emulation.hpp @@ -41,9 +41,9 @@ #ifdef BOOST_NO_SCOPED_ENUMS -# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_t +# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type # define BOOST_SCOPED_ENUM_END }; -# define BOOST_SCOPED_ENUM(name) name::enum_t +# define BOOST_SCOPED_ENUM(name) name::enum_type #else From 91672171a6b409f5ded1b2d732fa8b702f14bb47 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sat, 17 Oct 2009 02:07:38 +0000 Subject: [PATCH 54/92] rm cmake from trunk. I'm not entirely sure this is necessary to satisfy the inspect script, but I'm not taking any chances, and it is easy to put back [SVN r56942] --- CMakeLists.txt | 27 --------------------------- module.cmake | 1 - 2 files changed, 28 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 module.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index b75d9b9..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright Troy D. Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# See http://www.boost.org/LICENSE_1_0.txt -# -#---------------------------------------------------------------------------- -# This file was automatically generated from the original CMakeLists.txt file -# Add a variable to hold the headers for the library -set (lib_headers - detail -) - -# Add a library target to the build system -boost_library_project( - detail - # SRCDIRS - # TESTDIRS - HEADERS ${lib_headers} - # DOCDIRS - # DESCRIPTION "Helps Boost library developers adapt to compiler idiosyncrasies; not intended for library users." - MODULARIZED - # AUTHORS "John Maddock " - # MAINTAINERS -) - - diff --git a/module.cmake b/module.cmake deleted file mode 100644 index 123eff6..0000000 --- a/module.cmake +++ /dev/null @@ -1 +0,0 @@ -boost_module(detail DEPENDS integer) \ No newline at end of file From badf2c8a7958496a17edf2405c41ee91ea3fa4a5 Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Wed, 21 Oct 2009 18:05:33 +0000 Subject: [PATCH 55/92] fix for fix in r35591: sometimes __hppa is on PA-RISC but __hpux isn't Fixes ticket #3537 [SVN r57048] --- include/boost/detail/endian.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 803d7e2..36ddb7e 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -50,7 +50,7 @@ # define BOOST_BYTE_ORDER 1234 #elif defined(__sparc) || defined(__sparc__) \ || defined(_POWER) || defined(__powerpc__) \ - || defined(__ppc__) || defined(__hpux) \ + || defined(__ppc__) || defined(__hpux) || defined(__hppa) \ || defined(_MIPSEB) || defined(_POWER) \ || defined(__s390__) # define BOOST_BIG_ENDIAN From 097a256c16f3f4f792955d0fea7f33c00e561fde Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Tue, 24 Nov 2009 19:43:16 +0000 Subject: [PATCH 56/92] Removed obsolete file [SVN r57901] --- include/boost/pending/ct_if.hpp | 43 --------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 include/boost/pending/ct_if.hpp diff --git a/include/boost/pending/ct_if.hpp b/include/boost/pending/ct_if.hpp deleted file mode 100644 index a9b801e..0000000 --- a/include/boost/pending/ct_if.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// (C) Copyright Jeremy Siek 2000. -// 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) - -// This header replaces the implementation of ct_if that preceded the -// introduction of Boost.MPL with a facade that defers to that reviewed and -// accepted library. - -// Author: Ronald Garcia -// Date: 20 October, 2006 - - -#ifndef BOOST_CT_IF_HPP -#define BOOST_CT_IF_HPP - - -// A stub implementation in terms of Boost.MPL - -#include -#include -#include -// true_type and false_type are used by applications of ct_if -#include - -namespace boost { - - template - struct ct_and : boost::mpl::and_ {}; - - template - struct ct_not : mpl::not_ {}; - - template - struct ct_if : mpl::if_c {}; - - template - struct ct_if_t : mpl::if_ {}; - -} // namespace boost - -#endif // BOOST_CT_IF_HPP - From c2192c4cafaecc6f7125c207d35154f03c650835 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 26 Nov 2009 21:40:50 +0000 Subject: [PATCH 57/92] Fix interlocked.hpp to compile under /clr:pure. Refs #3378. [SVN r57958] --- include/boost/detail/interlocked.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index b6c8d75..fccebc3 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -54,11 +54,23 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) +#if defined( __CLRCALL_PURE_OR_CDECL ) + +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedIncrement( long volatile * ); +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedDecrement( long volatile * ); +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedCompareExchange( long volatile *, long, long ); +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedExchange( long volatile *, long ); +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedExchangeAdd( long volatile *, long ); + +#else + extern "C" long __cdecl _InterlockedIncrement( long volatile * ); extern "C" long __cdecl _InterlockedDecrement( long volatile * ); extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); -extern "C" long __cdecl _InterlockedExchange( long volatile *, long); -extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long); +extern "C" long __cdecl _InterlockedExchange( long volatile *, long ); +extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long ); + +#endif # pragma intrinsic( _InterlockedIncrement ) # pragma intrinsic( _InterlockedDecrement ) From 00e723fba0177e9af660d854e22b6afd3774c273 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 27 Jan 2010 19:32:39 +0000 Subject: [PATCH 58/92] Don't foward declare containers when using gcc's parallel library and add a macro to disable forward declaration. Fixes #3866. [SVN r59282] --- include/boost/detail/container_fwd.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index bc7f780..67c5a21 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -13,7 +13,9 @@ #include #include -#if ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) && defined(_GLIBCXX_DEBUG)) \ +#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) \ + || ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) \ + && (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL))) \ || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) From c5dc10b3c4101656d4c8f4c6830e7b2369fe8565 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 26 May 2010 21:10:41 +0000 Subject: [PATCH 59/92] Add detection of __LITTLE/BIG_ENDIAN__ for GCC versions that define them. I.e. the Apple builds of Xcode/gcc. (fixes #2762) [SVN r62252] --- include/boost/detail/endian.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 36ddb7e..5f9b90e 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -1,5 +1,6 @@ // Copyright 2005 Caleb Epstein // Copyright 2006 John Maddock +// Copyright 2010 Rene Rivera // Distributed under the Boost Software License, Version 1.0. (See accompany- // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -42,10 +43,12 @@ # error Unknown machine endianness detected. # endif # define BOOST_BYTE_ORDER __BYTE_ORDER -#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) +#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \ + defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 -#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) +#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \ + defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 #elif defined(__sparc) || defined(__sparc__) \ From a4eef8ff7d2f7abb6a8761dd52c653e505baff69 Mon Sep 17 00:00:00 2001 From: Anthony Williams Date: Mon, 7 Jun 2010 15:44:32 +0000 Subject: [PATCH 60/92] Applied patch from issue #3377 [SVN r62509] --- include/boost/detail/interlocked.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index fccebc3..c88d326 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -118,6 +118,11 @@ extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long ); extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long ); +# if defined(_M_IA64) || defined(_M_AMD64) +extern "C" __declspec(dllimport) void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* ); +extern "C" __declspec(dllimport) void* __stdcall InterlockedExchangePointer( void* volatile *, void* ); +# endif + } // namespace detail } // namespace boost @@ -128,10 +133,15 @@ extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long vol # define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd -# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ +# if defined(_M_IA64) || defined(_M_AMD64) +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::boost::detail::InterlockedCompareExchangePointer +# define BOOST_INTERLOCKED_EXCHANGE_POINTER ::boost::detail::InterlockedExchangePointer +# else +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare))) -# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ +# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ ((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange))) +# endif #else From af85a27b12c71257159b70ca5209178d75b873ea Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 8 Jul 2010 20:49:27 +0000 Subject: [PATCH 61/92] Rename 'check' in detail/is_incrementable. To avoid clashing with Apple testing macros. [SVN r63763] --- include/boost/detail/is_incrementable.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/detail/is_incrementable.hpp b/include/boost/detail/is_incrementable.hpp index 1c8fd57..e7ef9dc 100644 --- a/include/boost/detail/is_incrementable.hpp +++ b/include/boost/detail/is_incrementable.hpp @@ -70,10 +70,10 @@ namespace is_incrementable_ # endif // two check overloads help us identify which operator++ was picked - char (& check(tag) )[2]; + char (& check_(tag) )[2]; template - char check(T const&); + char check_(T const&); template @@ -83,7 +83,7 @@ namespace is_incrementable_ BOOST_STATIC_CONSTANT( bool - , value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1 + , value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1 ); }; @@ -94,7 +94,7 @@ namespace is_incrementable_ BOOST_STATIC_CONSTANT( bool - , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1 + , value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1 ); }; From cd4810a2e773671556a61151dd12a9b0dd57a799 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 19 Aug 2010 17:03:38 +0000 Subject: [PATCH 62/92] Remove path array optimization; problematic when array contains a string shorter than the array length. Reported by Adam Badura. [SVN r64928] --- include/boost/detail/lightweight_test.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/boost/detail/lightweight_test.hpp b/include/boost/detail/lightweight_test.hpp index ffa750d..8aa76f8 100644 --- a/include/boost/detail/lightweight_test.hpp +++ b/include/boost/detail/lightweight_test.hpp @@ -24,6 +24,7 @@ // #include +#include #include namespace boost @@ -64,10 +65,31 @@ template inline void test_eq_impl( char const * expr1, char co } } +struct report_errors_reminder +{ + bool remembered_to_call_report_errors_function; + report_errors_reminder() : remembered_to_call_report_errors_function(false) {} + ~report_errors_reminder() + { + BOOST_ASSERT(remembered_to_call_report_errors_function); + } +}; + } // namespace detail +} // namespace boost +namespace +{ + boost::detail::report_errors_reminder boost_report_errors_reminder; +} + +namespace boost +{ + inline int report_errors() { + boost_report_errors_reminder.remembered_to_call_report_errors_function = true; + int errors = detail::test_errors(); if( errors == 0 ) From 4f2d881cb1ed24938fd9462c0bfc8c5b6f917e8b Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 19 Aug 2010 17:09:22 +0000 Subject: [PATCH 63/92] Revert change committed in error [SVN r64929] --- include/boost/detail/lightweight_test.hpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/include/boost/detail/lightweight_test.hpp b/include/boost/detail/lightweight_test.hpp index 8aa76f8..ffa750d 100644 --- a/include/boost/detail/lightweight_test.hpp +++ b/include/boost/detail/lightweight_test.hpp @@ -24,7 +24,6 @@ // #include -#include #include namespace boost @@ -65,31 +64,10 @@ template inline void test_eq_impl( char const * expr1, char co } } -struct report_errors_reminder -{ - bool remembered_to_call_report_errors_function; - report_errors_reminder() : remembered_to_call_report_errors_function(false) {} - ~report_errors_reminder() - { - BOOST_ASSERT(remembered_to_call_report_errors_function); - } -}; - } // namespace detail -} // namespace boost -namespace -{ - boost::detail::report_errors_reminder boost_report_errors_reminder; -} - -namespace boost -{ - inline int report_errors() { - boost_report_errors_reminder.remembered_to_call_report_errors_function = true; - int errors = detail::test_errors(); if( errors == 0 ) From 0aa7afd1d8a745bcc05be0b212096f000ba2aa4a Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 24 Aug 2010 18:57:38 +0000 Subject: [PATCH 64/92] Add BOOST_ASSERT that report_errors() has been called. [SVN r64987] --- include/boost/detail/lightweight_test.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/boost/detail/lightweight_test.hpp b/include/boost/detail/lightweight_test.hpp index ffa750d..8add322 100644 --- a/include/boost/detail/lightweight_test.hpp +++ b/include/boost/detail/lightweight_test.hpp @@ -24,6 +24,7 @@ // #include +#include #include namespace boost @@ -32,9 +33,26 @@ namespace boost namespace detail { +struct report_errors_reminder +{ + bool called_report_errors_function; + report_errors_reminder() : called_report_errors_function(false) {} + ~report_errors_reminder() + { + BOOST_ASSERT(called_report_errors_function); // verify report_errors() was called + } +}; + +inline report_errors_reminder& report_errors_remind() +{ + static report_errors_reminder r; + return r; +} + inline int & test_errors() { static int x = 0; + report_errors_remind(); return x; } @@ -68,6 +86,8 @@ template inline void test_eq_impl( char const * expr1, char co inline int report_errors() { + detail::report_errors_remind().called_report_errors_function = true; + int errors = detail::test_errors(); if( errors == 0 ) From d1a4c127eb04807769dd8379ea69ff752aeca1b8 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 28 Aug 2010 17:34:12 +0000 Subject: [PATCH 65/92] Pick STLPort endian options when available. This should be a fix for embedded Visual C++ used with STLPort. [SVN r65089] --- include/boost/detail/endian.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 5f9b90e..98c870c 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -44,11 +44,13 @@ # endif # define BOOST_BYTE_ORDER __BYTE_ORDER #elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \ - defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) + defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \ + defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 #elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \ - defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) + defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \ + defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 #elif defined(__sparc) || defined(__sparc__) \ From 9261171c6fa507fb4f6aadb23981e68ed2dc322d Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Mon, 8 Nov 2010 17:10:25 +0000 Subject: [PATCH 66/92] Added a detail header for fenv. Please use boost/detail/fenv.hpp in Boost code to avoid problems with Clang/glibc. [SVN r66458] --- include/boost/detail/fenv.hpp | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 include/boost/detail/fenv.hpp diff --git a/include/boost/detail/fenv.hpp b/include/boost/detail/fenv.hpp new file mode 100644 index 0000000..b4b6b4c --- /dev/null +++ b/include/boost/detail/fenv.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2010 Bryce Lelbach + + 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) +=============================================================================*/ + +#if !defined(BOOST_DETAIL_FENV_HPP) +#define BOOST_DETAIL_FENV_HPP + +/* If we're using clang + glibc, we have to get hacky. + * See http://llvm.org/bugs/show_bug.cgi?id=6907 */ +#if defined(__clang__) && \ + defined(__GNU_LIBRARY__) && /* up to version 5 */ \ + defined(__GLIBC__) /* version 6 + */ + + #define _FENV_H + + #include + #include + + extern "C" { + extern int fegetexceptflag (fexcept_t*, int) __THROW; + extern int fesetexceptflag (__const fexcept_t*, int) __THROW; + extern int feclearexcept (int) __THROW; + extern int feraiseexcept (int) __THROW; + extern int fetestexcept (int) __THROW; + extern int fegetround (void) __THROW; + extern int fesetround (int) __THROW; + extern int fegetenv (fenv_t*) __THROW; + extern int fesetenv (__const fenv_t*) __THROW; + extern int feupdateenv (__const fenv_t*) __THROW; + extern int feholdexcept (fenv_t*) __THROW; + + #ifdef __USE_GNU + extern int feenableexcept (int) __THROW; + extern int fedisableexcept (int) __THROW; + extern int fegetexcept (void) __THROW; + #endif + } + + namespace std { namespace tr1 { + using ::fenv_t; + using ::fexcept_t; + using ::fegetexceptflag; + using ::fesetexceptflag; + using ::feclearexcept; + using ::feraiseexcept; + using ::fetestexcept; + using ::fegetround; + using ::fesetround; + using ::fegetenv; + using ::fesetenv; + using ::feupdateenv; + using ::feholdexcept; + } } + +#else /* if we're not using GNU's C stdlib, fenv.h should work with clang */ + + #if defined(__CYGWIN__) /* lol cygwin */ + #warn The header is not available for this platform + #elif defined(__SUNPRO_CC) /* lol suncc */ + #include + #include + #else + #include + #endif + +#endif + +#endif /* BOOST_DETAIL_FENV_HPP */ From 2c1f83de56b6b4884698a96fed4c1f1c0ebccfb1 Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Tue, 23 Nov 2010 03:34:05 +0000 Subject: [PATCH 67/92] Added BOOST_HAS_FENV_H detection to Boost.Config (if this macro is defined, then the standard library/platform provide a POSIX compliant implementation of fenv.h). [SVN r66693] --- include/boost/detail/fenv.hpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/include/boost/detail/fenv.hpp b/include/boost/detail/fenv.hpp index b4b6b4c..b8e8aa2 100644 --- a/include/boost/detail/fenv.hpp +++ b/include/boost/detail/fenv.hpp @@ -5,6 +5,12 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ +#include + +#if !defined(BOOST_HAS_FENV_H) + #error This platform does not have a floating point environment +#endif + #if !defined(BOOST_DETAIL_FENV_HPP) #define BOOST_DETAIL_FENV_HPP @@ -13,7 +19,6 @@ #if defined(__clang__) && \ defined(__GNU_LIBRARY__) && /* up to version 5 */ \ defined(__GLIBC__) /* version 6 + */ - #define _FENV_H #include @@ -56,16 +61,13 @@ } } #else /* if we're not using GNU's C stdlib, fenv.h should work with clang */ - - #if defined(__CYGWIN__) /* lol cygwin */ - #warn The header is not available for this platform - #elif defined(__SUNPRO_CC) /* lol suncc */ + #if defined(__SUNPRO_CC) /* lol suncc */ #include - #include - #else - #include #endif + + #include #endif -#endif /* BOOST_DETAIL_FENV_HPP */ +#endif /* BOOST_DETAIL_FENV_HPP */ + From 1d911d37841a0d47e07ca48f13bc73ef56609296 Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Sat, 27 Nov 2010 21:43:52 +0000 Subject: [PATCH 68/92] Added *nix identification macros to Boost.Config; BOOST_NIX, BOOST_GENETIC_NIX, BOOST_TRADEMARK_NIX and BOOST_FUNCTIONAL_NIX. [SVN r66804] --- include/boost/detail/fenv.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/fenv.hpp b/include/boost/detail/fenv.hpp index b8e8aa2..1ba8833 100644 --- a/include/boost/detail/fenv.hpp +++ b/include/boost/detail/fenv.hpp @@ -7,7 +7,7 @@ #include -#if !defined(BOOST_HAS_FENV_H) +#if defined(BOOST_NO_FENV_H) #error This platform does not have a floating point environment #endif From 313008fc312461a967e46d7d0e2250411c05db10 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 30 Nov 2010 14:48:03 +0000 Subject: [PATCH 69/92] Add lightweight std::exception catching main, dependent only upon and [SVN r66893] --- include/boost/detail/main.hpp | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 include/boost/detail/main.hpp diff --git a/include/boost/detail/main.hpp b/include/boost/detail/main.hpp new file mode 100644 index 0000000..d6196e9 --- /dev/null +++ b/include/boost/detail/main.hpp @@ -0,0 +1,36 @@ +// boost/detail/main.hpp -------------------------------------------------------------// + +// Copyright Beman Dawes 2010 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#include +#include + +//--------------------------------------------------------------------------------------// +// // +// exception reporting main() that calls cpp_main() // +// // +//--------------------------------------------------------------------------------------// + +int cpp_main(int argc, char* argv[]); + +int main(int argc, char* argv[]) +{ + try + { + return cpp_main(argc, argv); + } + + catch (const std::exception& ex) + { + std::cout + << "\nERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR\n" + << "\n****************************** std::exception *****************************\n" + << ex.what() + << "\n***************************************************************************\n" + << std::endl; + } + return 1; +} From 6d861790f7cb91bccbe6269eae9d407a329b7ae2 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 30 Nov 2010 14:53:22 +0000 Subject: [PATCH 70/92] Rename main.hpp -> lightweight_main.hpp [SVN r66894] --- include/boost/detail/{main.hpp => lightweight_main.hpp} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename include/boost/detail/{main.hpp => lightweight_main.hpp} (86%) diff --git a/include/boost/detail/main.hpp b/include/boost/detail/lightweight_main.hpp similarity index 86% rename from include/boost/detail/main.hpp rename to include/boost/detail/lightweight_main.hpp index d6196e9..375f3f4 100644 --- a/include/boost/detail/main.hpp +++ b/include/boost/detail/lightweight_main.hpp @@ -1,4 +1,4 @@ -// boost/detail/main.hpp -------------------------------------------------------------// +// boost/detail/lightweight_main.hpp -------------------------------------------------// // Copyright Beman Dawes 2010 @@ -28,8 +28,7 @@ int main(int argc, char* argv[]) std::cout << "\nERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR\n" << "\n****************************** std::exception *****************************\n" - << ex.what() - << "\n***************************************************************************\n" + << ex.what() ligh************************************************\n" << std::endl; } return 1; From 2a7bc8999fb70d2a0cfdd133bf29aa0d8f2d40a7 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 30 Nov 2010 14:56:03 +0000 Subject: [PATCH 71/92] fix fumble-fingers [SVN r66895] --- include/boost/detail/lightweight_main.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/lightweight_main.hpp b/include/boost/detail/lightweight_main.hpp index 375f3f4..1705309 100644 --- a/include/boost/detail/lightweight_main.hpp +++ b/include/boost/detail/lightweight_main.hpp @@ -28,7 +28,8 @@ int main(int argc, char* argv[]) std::cout << "\nERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR\n" << "\n****************************** std::exception *****************************\n" - << ex.what() ligh************************************************\n" + << ex.what() + << "\n***************************************************************************\n" << std::endl; } return 1; From a057517431ac0d73d507656d91112c984d84dc8a Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Wed, 8 Dec 2010 18:25:07 +0000 Subject: [PATCH 72/92] Added an iomanip implementation to boost/detail. GNU's libstdc++ version 4.5+ contains an iomanip header which uses C++0x features that only GCC supports, causing breakage with ICC and Clang. Also added a test, but I'm not sure how to set it up to be run by the testing machines. [SVN r67111] --- include/boost/detail/iomanip.hpp | 222 +++++++++++++++++++++++++++++++ test/Jamfile | 21 +++ test/iomanip_test.cpp | 58 ++++++++ 3 files changed, 301 insertions(+) create mode 100644 include/boost/detail/iomanip.hpp create mode 100644 test/Jamfile create mode 100644 test/iomanip_test.cpp diff --git a/include/boost/detail/iomanip.hpp b/include/boost/detail/iomanip.hpp new file mode 100644 index 0000000..7b41cdd --- /dev/null +++ b/include/boost/detail/iomanip.hpp @@ -0,0 +1,222 @@ +/*<-============================================================================ + Copyright (c) 2010 Bryce Lelbach + + 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 BOOST_DETAIL_IOMANIP_HPP +#define BOOST_DETAIL_IOMANIP_HPP + +#include +#include + +namespace boost { +namespace detail { + +//[resetiosflags +class resetiosflags_manip { + private: + std::ios_base::fmtflags mask; + + public: + explicit resetiosflags_manip (std::ios_base::fmtflags m): + mask(m) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, + resetiosflags_manip const& x) { + is.unsetf(x.mask); + return is; + } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, + resetiosflags_manip const& x) { + os.unsetf(x.mask); + return os; + } +}; + +inline resetiosflags_manip resetiosflags (std::ios_base::fmtflags mask) { + return resetiosflags_manip(mask); +} +//] + +//[setiosflags +class setiosflags_manip { + private: + std::ios_base::fmtflags mask; + + public: + explicit setiosflags_manip (std::ios_base::fmtflags m): + mask(m) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, + setiosflags_manip const& x) { + is.setf(x.mask); + return is; + } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, + setiosflags_manip const& x) { + os.setf(x.mask); + return os; + } +}; + +inline setiosflags_manip setiosflags (std::ios_base::fmtflags mask) { + return setiosflags_manip(mask); +} +//] + +//[setbase +class setbase_manip { + private: + int base; + + public: + explicit setbase_manip (int b): + base(b) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, setbase_manip const& x) { + using namespace std; + switch (x.base) { + case 8: + is.setf(ios_base::oct, ios_base::basefield); + return is; + case 10: + is.setf(ios_base::dec, ios_base::basefield); + return is; + case 16: + is.setf(ios_base::hex, ios_base::basefield); + return is; + default: + is.setf(ios_base::fmtflags(0), ios_base::basefield); + return is; + } + } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, setbase_manip const& x) { + using namespace std; + switch (x.base) { + case 8: + os.setf(ios_base::oct, ios_base::basefield); + return os; + case 10: + os.setf(ios_base::dec, ios_base::basefield); + return os; + case 16: + os.setf(ios_base::hex, ios_base::basefield); + return os; + default: + os.setf(ios_base::fmtflags(0), ios_base::basefield); + return os; + } + } +}; + +inline setbase_manip setbase (int base) { + return setbase_manip(base); +} +//] + +//[setfill +template +class setfill_manip { + private: + CharT fill; + + public: + explicit setfill_manip (CharT c): + fill(c) { } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, setfill_manip const& x) { + os.fill(x.fill); + return os; + } +}; + +template +inline setfill_manip setfill (CharT c) { + return setfill_manip(c); +} +//] + +//[setprecision +class setprecision_manip { + private: + int n; + + public: + explicit setprecision_manip (int n_): + n(n_) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, + setprecision_manip const& x) { + is.precision(x.n); + return is; + } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, + setprecision_manip const& x) { + os.precision(x.n); + return os; + } +}; + +inline setprecision_manip setprecision (int n_) { + return setprecision_manip(n_); +} +//] + +//[setw +class setw_manip { + private: + int n; + + public: + explicit setw_manip (int n_): + n(n_) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, setw_manip const& x) { + is.width(x.n); + return is; + } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, setw_manip const& x) { + os.width(x.n); + return os; + } +}; + +inline setw_manip setw (int n_) { + return setw_manip(n_); +} +//] + +} // detail +} // boost + +#endif // BOOST_DETAIL_IOMANIP_HPP + diff --git a/test/Jamfile b/test/Jamfile new file mode 100644 index 0000000..9413621 --- /dev/null +++ b/test/Jamfile @@ -0,0 +1,21 @@ +################################################################*# Jam #*####### +# Copyright (C) 2010 Bryce Lelbach +# +# 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) +################################################################################ + +project detail/test + : requirements + clang:-Wno-unused + clang:-Wno-tautological-compare + clang:-ftemplate-depth-300 + gcc:-ftemplate-depth-300 + darwin:-ftemplate-depth-300 + ; + +for tests in [ glob *.cpp ] { + run $(tests) : : : : $(tests:B) ; +} + + diff --git a/test/iomanip_test.cpp b/test/iomanip_test.cpp new file mode 100644 index 0000000..0a4f76d --- /dev/null +++ b/test/iomanip_test.cpp @@ -0,0 +1,58 @@ +/*<-============================================================================ + Copyright (c) 2010 Bryce Lelbach + + 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 + +#include +#include + +int main (void) { + using namespace boost::detail; + + std::ostringstream oss(std::ostringstream::out); + + //[setbase_test + oss << setbase(8) << 8; + BOOST_TEST(oss.str() == "10"); + + oss.str(""); + oss << setbase(10) << 10; + BOOST_TEST(oss.str() == "10"); + + oss.str(""); + oss << setbase(16) << 16; + BOOST_TEST(oss.str() == "10"); + //] + + //[setiosflags_test + oss.str(""); + oss << setiosflags(std::ios_base::showbase | std::ios_base::hex) << 16; + BOOST_TEST(oss.str() == "0x10"); + //] + + //[resetiosflags_test + oss.str(""); + oss << resetiosflags(std::ios_base::showbase | std::ios_base::hex) << 16; + BOOST_TEST(oss.str() == "16"); + //] + + //[setprecision_test + oss.str(""); + oss << setprecision(4) << 3.14159; + BOOST_TEST(oss.str() == "3.142"); + //] + + //[setfill_and_setw_test + oss.str(""); + oss << setfill('*') << setw(5) << 9; + BOOST_TEST(oss.str() == "****9"); + //] + + return boost::report_errors(); +} + From d6a77e40543b4881fcc4930345207b900c47ab65 Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Wed, 29 Dec 2010 01:37:28 +0000 Subject: [PATCH 73/92] Added the get_c_string function back in (it dispatches to the get_c_string_impl CP). Fixed utree::list_type attribute so that only non-list utree nodes are wrapped in lists (this was the original behavior we wanted). [SVN r67484] --- include/boost/detail/container_fwd.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 67c5a21..9a21252 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -68,7 +68,11 @@ namespace std template struct char_traits; #endif - template class complex; + #if BOOST_CLANG + template struct complex; + #else + template class complex; + #endif } // gcc 3.4 and greater From 475c3310be90697b9c7a6d1b3abc6540c67a45bd Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 4 Jan 2011 23:30:22 +0000 Subject: [PATCH 74/92] Move tests for container_fwd.hpp into detail. [SVN r67667] --- test/container_fwd_test.cpp | 112 +++++++++++++++++++++++++++++++++ test/container_no_fwd_test.cpp | 14 +++++ 2 files changed, 126 insertions(+) create mode 100644 test/container_fwd_test.cpp create mode 100644 test/container_no_fwd_test.cpp diff --git a/test/container_fwd_test.cpp b/test/container_fwd_test.cpp new file mode 100644 index 0000000..55c2e04 --- /dev/null +++ b/test/container_fwd_test.cpp @@ -0,0 +1,112 @@ + +// Copyright 2005-2009 Daniel James. +// 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 BOOST_WORKAROUND(__GNUC__, < 3) && \ + !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) +template +static void test( + std::basic_string, Allocator> const&) +{ +} +#else +template +static void test( + std::basic_string, Allocator> const&) +{ +} +#endif + +template +static void test(std::deque const&) +{ +} + +template +static void test(std::list const&) +{ +} + +template +static void test(std::vector const&) +{ +} + +template +static void test(std::map const&) +{ +} + +template +static void test(std::multimap const&) +{ +} + +template +static void test(std::set const&) +{ +} + +template +static void test(std::multiset const&) +{ +} + +template +static void test(std::bitset const&) +{ +} + +template +static void test(std::complex const&) +{ +} + +template +static void test(std::pair const&) +{ +} + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main() +{ + std::deque x1; + std::list x2; + std::vector x3; + std::vector x4; + std::map x5; + std::multimap x6; + std::set x7; + std::multiset > x8; + std::bitset<10> x9; + std::string x10; + std::complex x11; + std::pair, char***> x12; + + test(x1); + test(x2); + test(x3); + test(x4); + test(x5); + test(x6); + test(x7); + test(x8); + test(x9); + test(x10); + test(x11); + test(x12); + + return 0; +} diff --git a/test/container_no_fwd_test.cpp b/test/container_no_fwd_test.cpp new file mode 100644 index 0000000..9da09da --- /dev/null +++ b/test/container_no_fwd_test.cpp @@ -0,0 +1,14 @@ + +// Copyright 2010 Daniel James. +// 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) + +#define BOOST_DETAIL_NO_CONTAINER_FWD + +#include + +int main() +{ + std::set x; + std::vector y; +} From e7f3ca8c2fea07a8f4905f3bb40d08850abbf2b5 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Fri, 7 Jan 2011 07:51:15 +0000 Subject: [PATCH 75/92] Boost.Chrono: Added detail/win files used by Boost.Chrono to manage with HEAADER_ONLY libs [SVN r67749] --- .../boost/detail/win/GetCurrentProcess.hpp | 25 ++++ include/boost/detail/win/GetCurrentThread.hpp | 26 ++++ include/boost/detail/win/GetLastError.hpp | 27 ++++ include/boost/detail/win/GetProcessTimes.hpp | 33 +++++ include/boost/detail/win/GetThreadTimes.hpp | 33 +++++ include/boost/detail/win/LocalFree.hpp | 29 ++++ include/boost/detail/win/basic_types.hpp | 109 +++++++++++++++ .../boost/detail/win/directory_management.hpp | 43 ++++++ include/boost/detail/win/dll.hpp | 52 ++++++++ include/boost/detail/win/error_handling.hpp | 88 ++++++++++++ include/boost/detail/win/file_management.hpp | 126 ++++++++++++++++++ include/boost/detail/win/handles.hpp | 37 +++++ include/boost/detail/win/memory.hpp | 59 ++++++++ include/boost/detail/win/process.hpp | 33 +++++ include/boost/detail/win/security.hpp | 62 +++++++++ include/boost/detail/win/synchronization.hpp | 125 +++++++++++++++++ include/boost/detail/win/system.hpp | 50 +++++++ include/boost/detail/win/thread.hpp | 45 +++++++ include/boost/detail/win/time.hpp | 68 ++++++++++ include/boost/detail/win/timers.hpp | 41 ++++++ 20 files changed, 1111 insertions(+) create mode 100644 include/boost/detail/win/GetCurrentProcess.hpp create mode 100644 include/boost/detail/win/GetCurrentThread.hpp create mode 100644 include/boost/detail/win/GetLastError.hpp create mode 100644 include/boost/detail/win/GetProcessTimes.hpp create mode 100644 include/boost/detail/win/GetThreadTimes.hpp create mode 100644 include/boost/detail/win/LocalFree.hpp create mode 100644 include/boost/detail/win/basic_types.hpp create mode 100644 include/boost/detail/win/directory_management.hpp create mode 100644 include/boost/detail/win/dll.hpp create mode 100644 include/boost/detail/win/error_handling.hpp create mode 100644 include/boost/detail/win/file_management.hpp create mode 100644 include/boost/detail/win/handles.hpp create mode 100644 include/boost/detail/win/memory.hpp create mode 100644 include/boost/detail/win/process.hpp create mode 100644 include/boost/detail/win/security.hpp create mode 100644 include/boost/detail/win/synchronization.hpp create mode 100644 include/boost/detail/win/system.hpp create mode 100644 include/boost/detail/win/thread.hpp create mode 100644 include/boost/detail/win/time.hpp create mode 100644 include/boost/detail/win/timers.hpp diff --git a/include/boost/detail/win/GetCurrentProcess.hpp b/include/boost/detail/win/GetCurrentProcess.hpp new file mode 100644 index 0000000..a76eb06 --- /dev/null +++ b/include/boost/detail/win/GetCurrentProcess.hpp @@ -0,0 +1,25 @@ +// GetCurrentProcess.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP +#define BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP + +#include + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + using ::GetCurrentProcess; +#else + extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentProcess(); +#endif +} +} +} +#endif // BOOST_DETAIL_WIN_TIME_HPP diff --git a/include/boost/detail/win/GetCurrentThread.hpp b/include/boost/detail/win/GetCurrentThread.hpp new file mode 100644 index 0000000..a0922e9 --- /dev/null +++ b/include/boost/detail/win/GetCurrentThread.hpp @@ -0,0 +1,26 @@ +// GetCurrentThread.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP +#define BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP + +#include + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + using ::GetCurrentThread; +#else + extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentThread(); +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_TIME_HPP diff --git a/include/boost/detail/win/GetLastError.hpp b/include/boost/detail/win/GetLastError.hpp new file mode 100644 index 0000000..d040abf --- /dev/null +++ b/include/boost/detail/win/GetLastError.hpp @@ -0,0 +1,27 @@ +// GetLastError.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_GETLASTERROR_HPP +#define BOOST_DETAIL_WIN_GETLASTERROR_HPP + +#include + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + using ::GetLastError; +#else + extern "C" __declspec(dllimport) DWORD_ WINAPI + GetLastError(); +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_TIME_HPP diff --git a/include/boost/detail/win/GetProcessTimes.hpp b/include/boost/detail/win/GetProcessTimes.hpp new file mode 100644 index 0000000..b1d95e0 --- /dev/null +++ b/include/boost/detail/win/GetProcessTimes.hpp @@ -0,0 +1,33 @@ +// GetProcessTimes.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP +#define BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP + +#include + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + using ::GetProcessTimes; +#else + extern "C" __declspec(dllimport) BOOL_ WINAPI + GetProcessTimes( + HANDLE_ hProcess, + LPFILETIME_ lpCreationTime, + LPFILETIME_ lpExitTime, + LPFILETIME_ lpKernelTime, + LPFILETIME_ lpUserTime + ); +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP diff --git a/include/boost/detail/win/GetThreadTimes.hpp b/include/boost/detail/win/GetThreadTimes.hpp new file mode 100644 index 0000000..cf19c46 --- /dev/null +++ b/include/boost/detail/win/GetThreadTimes.hpp @@ -0,0 +1,33 @@ +// GetThreadTimes.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_GETTHREADTIMES_HPP +#define BOOST_DETAIL_WIN_GETTHREADTIMES_HPP + +#include + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + using ::GetThreadTimes; +#else + extern "C" __declspec(dllimport) BOOL_ WINAPI + GetThreadTimes( + HANDLE_ hThread, + LPFILETIME_ lpCreationTime, + LPFILETIME_ lpExitTime, + LPFILETIME_ lpKernelTime, + LPFILETIME_ lpUserTime + ); +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_GETTHREADTIMES_HPP diff --git a/include/boost/detail/win/LocalFree.hpp b/include/boost/detail/win/LocalFree.hpp new file mode 100644 index 0000000..da1c77b --- /dev/null +++ b/include/boost/detail/win/LocalFree.hpp @@ -0,0 +1,29 @@ +// LocalFree.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_LOCALFREE_HPP +#define BOOST_DETAIL_WIN_LOCALFREE_HPP + +#include + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + typedef HANDLE_ HLOCAL_; + + using ::LocalFree; +#else + extern "C" typedef HANDLE_ HLOCAL_; + extern "C" __declspec(dllimport) HLOCAL_ WINAPI + LocalFree(HLOCAL_ hMem); +#endif +} +} +} +#endif // BOOST_DETAIL_WIN_LOCALFREE_HPP diff --git a/include/boost/detail/win/basic_types.hpp b/include/boost/detail/win/basic_types.hpp new file mode 100644 index 0000000..0d728b6 --- /dev/null +++ b/include/boost/detail/win/basic_types.hpp @@ -0,0 +1,109 @@ +// basic_types.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_BASIC_TYPES_HPP +#define BOOST_DETAIL_WIN_BASIC_TYPES_HPP +#include +#include + +#if defined( BOOST_USE_WINDOWS_H ) +# include +#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) +# include +// @FIXME Which condition must be tested +# ifdef UNDER_CE +# ifndef WINAPI +# ifndef _WIN32_WCE_EMULATION +# define WINAPI __cdecl // Note this doesn't match the desktop definition +# else +# define WINAPI __stdcall +# endif +# endif +# else +# ifndef WINAPI +# define WINAPI __stdcall +# endif +# endif +#else +# error "Win32 functions not available" +#endif + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + typedef ::BOOL BOOL_; + typedef ::WORD WORD_; + typedef ::DWORD DWORD_; + typedef ::HANDLE HANDLE_; + typedef ::LONG LONG_; + typedef ::LONGLONG LONGLONG_; + typedef ::ULONG_PTR ULONG_PTR_; + typedef ::LARGE_INTEGER LARGE_INTEGER_; + typedef ::PLARGE_INTEGER PLARGE_INTEGER_; + typedef ::PVOID PVOID_; + typedef ::LPVOID LPVOID_; + typedef ::CHAR CHAR_; + typedef ::LPSTR LPSTR_; + typedef ::LPCSTR LPCSTR_; + typedef ::WCHAR WCHAR_; + typedef ::LPWSTR LPWSTR_; + typedef ::LPCWSTR LPCWSTR_; +#else +extern "C" { + typedef int BOOL_; + typedef unsigned short WORD_; + typedef unsigned long DWORD_; + typedef void* HANDLE_; + + typedef long LONG_; + +// @FIXME Which condition must be tested +#if !defined(_M_IX86) +#if defined(__CYGWIN__) + typedef double LONGLONG_; +#else + typedef __int64 LONGLONG_; +#endif +#else + typedef double LONGLONG_; +#endif + +# ifdef _WIN64 +#if defined(__CYGWIN__) + typedef unsigned long ULONG_PTR_; +#else + typedef unsigned __int64 ULONG_PTR_; +#endif +# else + typedef unsigned long ULONG_PTR_; +# endif + + typedef struct _LARGE_INTEGER { + LONGLONG_ QuadPart; + } LARGE_INTEGER_; + typedef LARGE_INTEGER_ *PLARGE_INTEGER_; + + typedef void *PVOID_; + typedef void *LPVOID_; + typedef const void *LPCVOID_; + + typedef char CHAR_; + typedef CHAR_ *LPSTR_; + typedef const CHAR_ *LPCSTR_; + + typedef wchar_t WCHAR_; + typedef WCHAR_ *LPWSTR_; + typedef const WCHAR_ *LPCWSTR_; + +} +#endif +} +} +} +#endif // BOOST_DETAIL_WIN_TIME_HPP diff --git a/include/boost/detail/win/directory_management.hpp b/include/boost/detail/win/directory_management.hpp new file mode 100644 index 0000000..1ffe659 --- /dev/null +++ b/include/boost/detail/win/directory_management.hpp @@ -0,0 +1,43 @@ +// directory_management.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP +#define BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP + +#include +#include + +namespace boost +{ +namespace detail +{ +namespace win32 +{ +#if defined( BOOST_USE_WINDOWS_H ) + using ::CreateDirectory; + using ::CreateDirectoryA; + using ::GetTempPathA; + using ::RemoveDirectoryA; +#else +extern "C" { + __declspec(dllimport) int __stdcall + CreateDirectory(LPCTSTR_, LPSECURITY_ATTRIBUTES_*); + __declspec(dllimport) int __stdcall + CreateDirectoryA(LPCTSTR_, interprocess_security_attributes*); + __declspec(dllimport) int __stdcall + GetTempPathA(unsigned long length, char *buffer); + __declspec(dllimport) int __stdcall + RemoveDirectoryA(LPCTSTR_); + +} +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_THREAD_HPP diff --git a/include/boost/detail/win/dll.hpp b/include/boost/detail/win/dll.hpp new file mode 100644 index 0000000..605a1bf --- /dev/null +++ b/include/boost/detail/win/dll.hpp @@ -0,0 +1,52 @@ +// dll.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_DLL_HPP +#define BOOST_DETAIL_WIN_DLL_HPP + +#include +#include + +namespace boost +{ +namespace detail +{ +namespace win32 +{ +#if defined( BOOST_USE_WINDOWS_H ) + using ::LoadLibrary; + using ::FreeLibrary; + using ::GetProcAddress; + using ::GetModuleHandleA; +#else +extern "C" { + __declspec(dllimport) HMODULE_ __stdcall + LoadLibrary( + LPCTSTR_ lpFileName + ); + __declspec(dllimport) BOOL_ __stdcall + FreeLibrary( + HMODULE_ hModule + ); + __declspec(dllimport) FARPROC_ __stdcall + GetProcAddress( + HMODULE_ hModule, + LPCSTR_ lpProcName + ); + __declspec(dllimport) FARPROC_ __stdcall + GetModuleHandleA( + LPCSTR_ lpProcName + ); + +} +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_THREAD_HPP diff --git a/include/boost/detail/win/error_handling.hpp b/include/boost/detail/win/error_handling.hpp new file mode 100644 index 0000000..d6fb428 --- /dev/null +++ b/include/boost/detail/win/error_handling.hpp @@ -0,0 +1,88 @@ +// error_handling.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_ERROR_HANDLING_HPP +#define BOOST_DETAIL_WIN_ERROR_HANDLING_HPP + +#include +#include + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + using ::FormatMessageA; + using ::FormatMessageW; + + const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= FORMAT_MESSAGE_ALLOCATE_BUFFER; + const int FORMAT_MESSAGE_IGNORE_INSERTS_= FORMAT_MESSAGE_IGNORE_INSERTS; + const int FORMAT_MESSAGE_FROM_STRING_= FORMAT_MESSAGE_FROM_STRING; + const int FORMAT_MESSAGE_FROM_HMODULE_= FORMAT_MESSAGE_FROM_HMODULE; + const int FORMAT_MESSAGE_FROM_SYSTEM_= FORMAT_MESSAGE_FROM_SYSTEM; + const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= FORMAT_MESSAGE_ARGUMENT_ARRAY; + const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= FORMAT_MESSAGE_MAX_WIDTH_MASK; + + const char LANG_NEUTRAL_= LANG_NEUTRAL; + const char LANG_INVARIANT_= LANG_INVARIANT; + + const char SUBLANG_DEFAULT_= SUBLANG_DEFAULT; // user default + inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) { + return MAKELANGID(p,s); + } +#else +extern "C" { + // using ::FormatMessageA; + __declspec(dllimport) + DWORD_ + WINAPI + FormatMessageA( + DWORD_ dwFlags, + LPCVOID_ lpSource, + DWORD_ dwMessageId, + DWORD_ dwLanguageId, + LPSTR_ lpBuffer, + DWORD_ nSize, + va_list *Arguments + ); + + // using ::FormatMessageW; + __declspec(dllimport) + DWORD_ + WINAPI + FormatMessageW( + DWORD_ dwFlags, + LPCVOID_ lpSource, + DWORD_ dwMessageId, + DWORD_ dwLanguageId, + LPWSTR_ lpBuffer, + DWORD_ nSize, + va_list *Arguments + ); + + const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= 0x00000100; + const int FORMAT_MESSAGE_IGNORE_INSERTS_= 0x00000200; + const int FORMAT_MESSAGE_FROM_STRING_= 0x00000400; + const int FORMAT_MESSAGE_FROM_HMODULE_= 0x00000800; + const int FORMAT_MESSAGE_FROM_SYSTEM_= 0x00001000; + const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= 0x00002000; + const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= 0x000000FF; + + const char LANG_NEUTRAL_= 0x00; + const char LANG_INVARIANT_= 0x7f; + + const char SUBLANG_DEFAULT_= 0x01; // user default + inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) { + return ((((WORD_ )(s)) << 10) | (WORD_ )(p)); + } + +} +#endif +} +} +} +#endif // BOOST_DETAIL_WIN_ERROR_HANDLING_HPP diff --git a/include/boost/detail/win/file_management.hpp b/include/boost/detail/win/file_management.hpp new file mode 100644 index 0000000..5cb0dbf --- /dev/null +++ b/include/boost/detail/win/file_management.hpp @@ -0,0 +1,126 @@ +// thread.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP +#define BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP + +#include +#include + +namespace boost +{ +namespace detail +{ +namespace win32 +{ +#if defined( BOOST_USE_WINDOWS_H ) + using ::CreateFileA; + using ::DeleteFileA; + using ::FindFirstFileA; + using ::FindNextFileA; + using ::FindClose; + using ::GetFileSizeEx; + using ::MoveFileExA; + using ::SetFileValidData; +#else +extern "C" { + typedef struct _OVERLAPPED { + ULONG_PTR Internal; + ULONG_PTR InternalHigh; + union { + struct { + DWORD Offset; + DWORD OffsetHigh; + } ; + PVOID Pointer; + } ; + HANDLE hEvent; + } OVERLAPPED, *LPOVERLAPPED; + + + __declspec(dllimport) void * __stdcall + CreateFileA (const char *, unsigned long, unsigned long, struct SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, void *); + __declspec(dllimport) int __stdcall + DeleteFileA (const char *); + __declspec(dllimport) void *__stdcall + FindFirstFileA(const char *lpFileName, win32_find_data_t *lpFindFileData); + __declspec(dllimport) int __stdcall + FindNextFileA(void *hFindFile, win32_find_data_t *lpFindFileData); + __declspec(dllimport) int __stdcall + FindClose(void *hFindFile); + __declspec(dllimport) BOOL __stdcall + GetFileSizeEx( + HANDLE_ hFile, + PLARGE_INTEGER_ lpFileSize + ); + __declspec(dllimport) int __stdcall + MoveFileExA (const char *, const char *, unsigned long); + __declspec(dllimport) BOOL_ __stdcall + SetFileValidData( + HANDLE_ hFile, + LONGLONG_ ValidDataLength + ); + __declspec(dllimport) BOOL_ __stdcall + SetEndOfFile( + HANDLE_ hFile + ); + __declspec(dllimport) BOOL_ __stdcall + SetFilePointerEx( + HANDLE_ hFile, + LARGE_INTEGER_ liDistanceToMove, + PLARGE_INTEGER_ lpNewFilePointer, + DWORD_ dwMoveMethod + ); + __declspec(dllimport) BOOL_ __stdcall + LockFile( + HANDLE_ hFile, + DWORD_ dwFileOffsetLow, + DWORD_ dwFileOffsetHigh, + DWORD_ nNumberOfBytesToLockLow, + DWORD_ nNumberOfBytesToLockHigh + ); + __declspec(dllimport) BOOL_ __stdcall + UnlockFile( + HANDLE_ hFile, + DWORD_ dwFileOffsetLow, + DWORD_ dwFileOffsetHigh, + DWORD_ nNumberOfBytesToUnlockLow, + DWORD_ nNumberOfBytesToUnlockHigh + ); + __declspec(dllimport) BOOL_ __stdcall + LockFileEx( + HANDLE_ hFile, + DWORD_ dwFlags, + DWORD_ dwReserved, + DWORD_ nNumberOfBytesToLockLow, + DWORD_ nNumberOfBytesToLockHigh, + LPOVERLAPPED_ lpOverlapped + ); + __declspec(dllimport) BOOL_ __stdcall + UnlockFileEx( + HANDLE_ hFile, + DWORD_ dwReserved, + DWORD_ nNumberOfBytesToUnlockLow, + DWORD_ nNumberOfBytesToUnlockHigh, + LPOVERLAPPED_ lpOverlapped + ); + __declspec(dllimport) BOOL_ __stdcall + WriteFile( + HANDLE_ hFile, + LPCVOID_ lpBuffer, + DWORD_ nNumberOfBytesToWrite, + LPDWORD_ lpNumberOfBytesWritten, + LPOVERLAPPED_ lpOverlapped + ); +} +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_THREAD_HPP diff --git a/include/boost/detail/win/handles.hpp b/include/boost/detail/win/handles.hpp new file mode 100644 index 0000000..1441d10 --- /dev/null +++ b/include/boost/detail/win/handles.hpp @@ -0,0 +1,37 @@ +// memory.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_HANDLES_HPP +#define BOOST_DETAIL_WIN_HANDLES_HPP + +#include + + +namespace boost +{ +namespace detail +{ +namespace win32 +{ +#if defined( BOOST_USE_WINDOWS_H ) + using ::CloseHandle; + using ::DuplicateHandle; +#else +extern "C" { + __declspec(dllimport) int __stdcall + CloseHandle(void*); + __declspec(dllimport) int __stdcall + DuplicateHandle(void*,void*,void*,void**,unsigned long,int,unsigned long); +} + +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_HANDLES_HPP diff --git a/include/boost/detail/win/memory.hpp b/include/boost/detail/win/memory.hpp new file mode 100644 index 0000000..8bf59ad --- /dev/null +++ b/include/boost/detail/win/memory.hpp @@ -0,0 +1,59 @@ +// memory.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_MEMORY_HPP +#define BOOST_DETAIL_WIN_MEMORY_HPP + +#include +#include +#include + + +namespace boost +{ +namespace detail +{ +namespace win32 +{ +#if defined( BOOST_USE_WINDOWS_H ) + using ::CreateFileMappingA; + using ::FlushViewOfFile; + using ::GetProcessHeap; + using ::HeapAlloc; + using ::HeapFree; + using ::MapViewOfFileEx; + using ::OpenFileMappingA; + using ::UnmapViewOfFile; +#else +# ifdef HeapAlloc +# undef HeapAlloc +# endif +extern "C" { + __declspec(dllimport) void * __stdcall + CreateFileMappingA (void *, SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, unsigned long, const char *); + __declspec(dllimport) int __stdcall + FlushViewOfFile (void *, std::size_t); + __declspec(dllimport) HANDLE_ __stdcall + GetProcessHeap(); + __declspec(dllimport) void* __stdcall + HeapAlloc(HANDLE_,DWORD_,SIZE_T_); + __declspec(dllimport) BOOL_ __stdcall + HeapFree(HANDLE_,DWORD_,LPVOID_); + __declspec(dllimport) void * __stdcall + MapViewOfFileEx (void *, unsigned long, unsigned long, unsigned long, std::size_t, void*); + __declspec(dllimport) void * __stdcall + OpenFileMappingA (unsigned long, int, const char *); + __declspec(dllimport) int __stdcall + UnmapViewOfFile(void *); +} +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP diff --git a/include/boost/detail/win/process.hpp b/include/boost/detail/win/process.hpp new file mode 100644 index 0000000..10c3a93 --- /dev/null +++ b/include/boost/detail/win/process.hpp @@ -0,0 +1,33 @@ +// process.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_PROCESS_HPP +#define BOOST_DETAIL_WIN_PROCESS_HPP + +#include +#include + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + using ::GetCurrentProcessId; +#else +# ifndef UNDER_CE +extern "C" { + __declspec(dllimport) unsigned long __stdcall + GetCurrentProcessId(void); +} +# else + using ::GetCurrentProcessId; +# endif +#endif +} +} +} +#endif // BOOST_DETAIL_WIN_PROCESS_HPP diff --git a/include/boost/detail/win/security.hpp b/include/boost/detail/win/security.hpp new file mode 100644 index 0000000..ee38985 --- /dev/null +++ b/include/boost/detail/win/security.hpp @@ -0,0 +1,62 @@ +// security.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_SECURITY_HPP +#define BOOST_DETAIL_WIN_SECURITY_HPP + +#include + + +namespace boost +{ +namespace detail +{ +namespace win32 +{ +#if defined( BOOST_USE_WINDOWS_H ) +typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_; +typedef ::PSECURITY_ATTRIBUTES PSECURITY_ATTRIBUTES_; +typedef ::LPSECURITY_ATTRIBUTES LPSECURITY_ATTRIBUTES_; + +#else +extern "C" { + struct SECURITY_DESCRIPTOR_; + typedef SECURITY_DESCRIPTOR_* PSECURITY_DESCRIPTOR_; + typedef struct _ACL { + BYTE_ AclRevision; + BYTE_ Sbz1; + WORD_ AclSize; + WORD_ AceCount; + WORD_ Sbz2; + } ACL_, *PACL_; + + typedef struct _SECURITY_ATTRIBUTES { + DWORD_ nLength; + LPVOID_ lpSecurityDescriptor; + BOOL_ bInheritHandle; + } SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_; + + __declspec(dllimport) BOOL_ __stdcall + InitializeSecurityDescriptor( + PSECURITY_DESCRIPTOR_ pSecurityDescriptor, + DWORD_ dwRevision + ); + __declspec(dllimport) BOOL_ __stdcall + SetSecurityDescriptorDacl( + PSECURITY_DESCRIPTOR_ pSecurityDescriptor, + BOOL_ bDaclPresent, + PACL_ pDacl, + BOOL_ bDaclDefaulted + ); +} +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_SECURITY_HPP diff --git a/include/boost/detail/win/synchronization.hpp b/include/boost/detail/win/synchronization.hpp new file mode 100644 index 0000000..8fe015b --- /dev/null +++ b/include/boost/detail/win/synchronization.hpp @@ -0,0 +1,125 @@ +// synchronizaion.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP +#define BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP + +#include + + +namespace boost +{ +namespace detail +{ +namespace win32 +{ +#if defined( BOOST_USE_WINDOWS_H ) + typedef ::CRITICAL_SECTION CRITICAL_SECTION_; + typedef ::PAPCFUNC PAPCFUNC_; + + using ::InitializeCriticalSection; + using ::EnterCriticalSection; + using ::TryEnterCriticalSection; + using ::LeaveCriticalSection; + using ::DeleteCriticalSection; + +# ifdef BOOST_NO_ANSI_APIS + using ::CreateMutexW; + using ::CreateEventW; + using ::OpenEventW; + using ::CreateSemaphoreW; +# else + using ::CreateMutexA; + using ::CreateEventA; + using ::OpenEventA; + using ::CreateSemaphoreA; +# endif + using ::ReleaseMutex; + using ::ReleaseSemaphore; + using ::SetEvent; + using ::ResetEvent; + using ::WaitForMultipleObjects; + using ::WaitForSingleObject; + using ::QueueUserAPC; +#else +extern "C" { + 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 + }; + + __declspec(dllimport) void __stdcall + InitializeCriticalSection(CRITICAL_SECTION_ *); + __declspec(dllimport) void __stdcall + EnterCriticalSection(CRITICAL_SECTION_ *); + __declspec(dllimport) bool __stdcall + TryEnterCriticalSection(CRITICAL_SECTION_ *); + __declspec(dllimport) void __stdcall + LeaveCriticalSection(CRITICAL_SECTION_ *); + __declspec(dllimport) void __stdcall + DeleteCriticalSection(CRITICAL_SECTION_ *); + + struct _SECURITY_ATTRIBUTES; +# ifdef BOOST_NO_ANSI_APIS + __declspec(dllimport) void* __stdcall + CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*); + __declspec(dllimport) void* __stdcall + CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*); + __declspec(dllimport) void* __stdcall + CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*); + __declspec(dllimport) void* __stdcall + OpenEventW(unsigned long,int,wchar_t const*); +# else + __declspec(dllimport) void* __stdcall + CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*); + __declspec(dllimport) void* __stdcall + CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*); + __declspec(dllimport) void* __stdcall + CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*); + __declspec(dllimport) void* __stdcall + OpenEventA(unsigned long,int,char const*); +# endif + __declspec(dllimport) int __stdcall + ReleaseMutex(void*); + __declspec(dllimport) unsigned long __stdcall + WaitForSingleObject(void*,unsigned long); + __declspec(dllimport) unsigned long __stdcall + WaitForMultipleObjects(unsigned long nCount, + void* const * lpHandles, + int bWaitAll, + unsigned long dwMilliseconds); + __declspec(dllimport) int __stdcall + ReleaseSemaphore(void*,long,long*); + typedef void (__stdcall *PAPCFUNC8)(ulong_ptr); + __declspec(dllimport) unsigned long __stdcall + QueueUserAPC(PAPCFUNC8,void*,ulong_ptr); +# ifndef UNDER_CE + __declspec(dllimport) int __stdcall + SetEvent(void*); + __declspec(dllimport) int __stdcall + ResetEvent(void*); +# else + using ::SetEvent; + using ::ResetEvent; +# endif +} +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP diff --git a/include/boost/detail/win/system.hpp b/include/boost/detail/win/system.hpp new file mode 100644 index 0000000..3bcffce --- /dev/null +++ b/include/boost/detail/win/system.hpp @@ -0,0 +1,50 @@ +// system.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_SYSTEM_HPP +#define BOOST_DETAIL_WIN_SYSTEM_HPP +#include +#include + +#include +extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *); + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + typedef ::SYSTEM_INFO SYSTEM_INFO_; +#else +extern "C" { + typedef struct _SYSTEM_INFO { + union { + DWORD_ dwOemId; + struct { + WORD_ wProcessorArchitecture; + WORD_ wReserved; + } dummy; + } ; + DWORD_ dwPageSize; + LPVOID_ lpMinimumApplicationAddress; + LPVOID_ lpMaximumApplicationAddress; + DWORD_PTR_ dwActiveProcessorMask; + DWORD_ dwNumberOfProcessors; + DWORD_ dwProcessorType; + DWORD_ dwAllocationGranularity; + WORD_ wProcessorLevel; + WORD_ wProcessorRevision; + } SYSTEM_INFO_; + + __declspec(dllimport) void __stdcall + GetSystemInfo (struct system_info *); +} +#endif +} +} +} +#endif // BOOST_DETAIL_WIN_TIME_HPP diff --git a/include/boost/detail/win/thread.hpp b/include/boost/detail/win/thread.hpp new file mode 100644 index 0000000..4e1bf30 --- /dev/null +++ b/include/boost/detail/win/thread.hpp @@ -0,0 +1,45 @@ +// thread.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_THREAD_HPP +#define BOOST_DETAIL_WIN_THREAD_HPP + +#include +#include + +namespace boost +{ +namespace detail +{ +namespace win32 +{ +#if defined( BOOST_USE_WINDOWS_H ) + using ::GetCurrentThreadId; + using ::SleepEx; + using ::Sleep; +#else +extern "C" { +# ifndef UNDER_CE + __declspec(dllimport) unsigned long __stdcall + GetCurrentThreadId(void); + __declspec(dllimport) unsigned long __stdcall + SleepEx(unsigned long,int); + __declspec(dllimport) void __stdcall + Sleep(unsigned long); +#else + using ::GetCurrentThreadId; + using ::SleepEx; + using ::Sleep; +#endif +} +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_THREAD_HPP diff --git a/include/boost/detail/win/time.hpp b/include/boost/detail/win/time.hpp new file mode 100644 index 0000000..1707423 --- /dev/null +++ b/include/boost/detail/win/time.hpp @@ -0,0 +1,68 @@ +// time.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_TIME_HPP +#define BOOST_DETAIL_WIN_TIME_HPP + +#include + + +namespace boost { +namespace detail { +namespace win32 { +#if defined( BOOST_USE_WINDOWS_H ) + typedef FILETIME FILETIME_; + typedef PFILETIME PFILETIME_; + typedef LPFILETIME LPFILETIME_; + + typedef SYSTEMTIME SYSTEMTIME_; + typedef SYSTEMTIME* PSYSTEMTIME_; + + using ::GetSystemTimeAsFileTime; + using ::FileTimeToLocalFileTime; + using ::GetSystemTime; + using ::SystemTimeToFileTime; + using ::GetTickCount; + +#else +extern "C" { + typedef struct _FILETIME { + DWORD_ dwLowDateTime; + DWORD_ dwHighDateTime; + } FILETIME_, *PFILETIME_, *LPFILETIME_; + + typedef struct _SYSTEMTIME { + WORD_ wYear; + WORD_ wMonth; + WORD_ wDayOfWeek; + WORD_ wDay; + WORD_ wHour; + WORD_ wMinute; + WORD_ wSecond; + WORD_ wMilliseconds; + } SYSTEMTIME_, *PSYSTEMTIME_; + + __declspec(dllimport) void WINAPI + GetSystemTimeAsFileTime(FILETIME_* lpFileTime); + __declspec(dllimport) int WINAPI + FileTimeToLocalFileTime(const FILETIME_* lpFileTime, + FILETIME_* lpLocalFileTime); + __declspec(dllimport) void WINAPI + GetSystemTime(SYSTEMTIME_* lpSystemTime); + __declspec(dllimport) int WINAPI + SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime, + FILETIME_* lpFileTime); + __declspec(dllimport) unsigned long __stdcall + GetTickCount(); +} +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_TIME_HPP diff --git a/include/boost/detail/win/timers.hpp b/include/boost/detail/win/timers.hpp new file mode 100644 index 0000000..753c91f --- /dev/null +++ b/include/boost/detail/win/timers.hpp @@ -0,0 +1,41 @@ +// timers.hpp --------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + + +#ifndef BOOST_DETAIL_WIN_TIMERS_HPP +#define BOOST_DETAIL_WIN_TIMERS_HPP + +#include + + +namespace boost +{ +namespace detail +{ +namespace win32 +{ +#if defined( BOOST_USE_WINDOWS_H ) + using ::QueryPerformanceCounter; + using ::QueryPerformanceFrequency; +#else +extern "C" { + __declspec(dllimport) BOOL_ WINAPI + QueryPerformanceCounter( + LARGE_INTEGER_ *lpPerformanceCount + ); + + __declspec(dllimport) BOOL_ WINAPI + QueryPerformanceFrequency( + LARGE_INTEGER_ *lpFrequency + ); +} +#endif +} +} +} + +#endif // BOOST_DETAIL_WIN_TIMERS_HPP From 91db205d1715127102a655a6ded06b7070aac7fb Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Thu, 13 Jan 2011 22:07:19 +0000 Subject: [PATCH 76/92] Boost.Chrono: try to fix LONGLONG_ definition [SVN r68128] --- include/boost/detail/win/basic_types.hpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/include/boost/detail/win/basic_types.hpp b/include/boost/detail/win/basic_types.hpp index 0d728b6..f4e3472 100644 --- a/include/boost/detail/win/basic_types.hpp +++ b/include/boost/detail/win/basic_types.hpp @@ -10,10 +10,10 @@ #define BOOST_DETAIL_WIN_BASIC_TYPES_HPP #include #include - +#include #if defined( BOOST_USE_WINDOWS_H ) # include -#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) +#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__) # include // @FIXME Which condition must be tested # ifdef UNDER_CE @@ -64,16 +64,18 @@ extern "C" { typedef long LONG_; // @FIXME Which condition must be tested -#if !defined(_M_IX86) -#if defined(__CYGWIN__) - typedef double LONGLONG_; -#else - typedef __int64 LONGLONG_; -#endif -#else - typedef double LONGLONG_; -#endif +//~ #if !defined(_M_IX86) +//~ #if defined(BOOST_NO_INT64_T) + //~ typedef double LONGLONG_; +//~ #else + //~ typedef __int64 LONGLONG_; +//~ #endif +//~ #else + //~ typedef double LONGLONG_; +//~ #endif + typedef boost::int64_t LONGLONG_; +// @FIXME Which condition must be tested # ifdef _WIN64 #if defined(__CYGWIN__) typedef unsigned long ULONG_PTR_; From 99f3841839e2ff8ec2c38b64446ee7aa4be35dab Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Fri, 14 Jan 2011 00:23:15 +0000 Subject: [PATCH 77/92] Updating copyright. [SVN r68137] --- include/boost/detail/iomanip.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/boost/detail/iomanip.hpp b/include/boost/detail/iomanip.hpp index 7b41cdd..d45ecb5 100644 --- a/include/boost/detail/iomanip.hpp +++ b/include/boost/detail/iomanip.hpp @@ -1,9 +1,9 @@ -/*<-============================================================================ - Copyright (c) 2010 Bryce Lelbach +/*============================================================================== + Copyright (c) 2010-2011 Bryce Lelbach 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 BOOST_DETAIL_IOMANIP_HPP #define BOOST_DETAIL_IOMANIP_HPP @@ -26,7 +26,8 @@ class resetiosflags_manip { template friend std::basic_istream& operator>> (std::basic_istream& is, - resetiosflags_manip const& x) { + resetiosflags_manip const& x) + { is.unsetf(x.mask); return is; } @@ -34,7 +35,8 @@ class resetiosflags_manip { template friend std::basic_ostream& operator<< (std::basic_ostream& os, - resetiosflags_manip const& x) { + resetiosflags_manip const& x) + { os.unsetf(x.mask); return os; } From 4a1c553f908ef92c0e1fde05c6fd984d689b27da Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Fri, 14 Jan 2011 02:35:58 +0000 Subject: [PATCH 78/92] Replacing the use of with across Boost. On Linux, GNU's libstdc++, which is the default stdlib for icc and clang, cannot parse the header in version 4.5+ (which thankfully neither compiler advises the use of yet), as it's original C++98-friendly implementation has been replaced with a gnu++0x implementation. is a portable implementation of , providing boost::detail::setfill, boost::detail::setbase, boost::detail::setw, boost::detail::setprecision, boost::detail::setiosflags and boost::detail::resetiosflags. [SVN r68140] --- test/iomanip_test.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/iomanip_test.cpp b/test/iomanip_test.cpp index 0a4f76d..60d91c3 100644 --- a/test/iomanip_test.cpp +++ b/test/iomanip_test.cpp @@ -1,13 +1,14 @@ -/*<-============================================================================ - Copyright (c) 2010 Bryce Lelbach +/*============================================================================== + Copyright (c) 2010-2011 Bryce Lelbach 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 +#include #include #include @@ -18,39 +19,39 @@ int main (void) { //[setbase_test oss << setbase(8) << 8; - BOOST_TEST(oss.str() == "10"); + BOOST_TEST_EQ(oss.str(), "10"); oss.str(""); oss << setbase(10) << 10; - BOOST_TEST(oss.str() == "10"); + BOOST_TEST_EQ(oss.str(), "10"); oss.str(""); oss << setbase(16) << 16; - BOOST_TEST(oss.str() == "10"); + BOOST_TEST_EQ(oss.str(), "10"); //] //[setiosflags_test oss.str(""); oss << setiosflags(std::ios_base::showbase | std::ios_base::hex) << 16; - BOOST_TEST(oss.str() == "0x10"); + BOOST_TEST_EQ(oss.str(), "0x10"); //] //[resetiosflags_test oss.str(""); oss << resetiosflags(std::ios_base::showbase | std::ios_base::hex) << 16; - BOOST_TEST(oss.str() == "16"); + BOOST_TEST_EQ(oss.str(), "16"); //] //[setprecision_test oss.str(""); oss << setprecision(4) << 3.14159; - BOOST_TEST(oss.str() == "3.142"); + BOOST_TEST_EQ(oss.str(), "3.142"); //] //[setfill_and_setw_test oss.str(""); oss << setfill('*') << setw(5) << 9; - BOOST_TEST(oss.str() == "****9"); + BOOST_TEST_EQ(oss.str(), "****9"); //] return boost::report_errors(); From e8060b3ef550e21b099cc8fe5de467a3d1dbbc2e Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Fri, 14 Jan 2011 03:02:47 +0000 Subject: [PATCH 79/92] Removed the use of __gnu_cxx::is_sorted from Boost.Graph as it's lolnonportable, implemented a version of the algorithm as a replacement, [SVN r68144] --- include/boost/detail/is_sorted.hpp | 56 +++++++++++++ test/is_sorted_test.cpp | 129 +++++++++++++++++++++++++++++ 2 files changed, 185 insertions(+) create mode 100644 include/boost/detail/is_sorted.hpp create mode 100644 test/is_sorted_test.cpp diff --git a/include/boost/detail/is_sorted.hpp b/include/boost/detail/is_sorted.hpp new file mode 100644 index 0000000..91f254c --- /dev/null +++ b/include/boost/detail/is_sorted.hpp @@ -0,0 +1,56 @@ +/*============================================================================== + Copyright (c) 2010-2011 Bryce Lelbach + + 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 BOOST_DETAIL_SORTED_HPP +#define BOOST_DETAIL_SORTED_HPP + +#include + +#include + +namespace boost { +namespace detail { + +template +inline Iterator is_sorted_until (Iterator first, Iterator last, Comp compare) { + if (first == last) + return last; + + Iterator it = first; ++it; + + for (; it != last; first = it, ++it) + if (compare(*it, *first)) + return it; + + return it; +} + +template +inline Iterator is_sorted_until (Iterator first, Iterator last) { + typedef typename boost::detail::iterator_traits::value_type + value_type; + + typedef std::less compare; + + return is_sorted_until(first, last, compare()); +} + +template +inline bool is_sorted (Iterator first, Iterator last, Comp compare) { + return is_sorted_until(first, last, compare) == last; +} + +template +inline bool is_sorted (Iterator first, Iterator last) { + return is_sorted_until(first, last) == last; +} + +} // detail +} // boost + +#endif // BOOST_DETAIL_SORTED_HPP + diff --git a/test/is_sorted_test.cpp b/test/is_sorted_test.cpp new file mode 100644 index 0000000..36c03bc --- /dev/null +++ b/test/is_sorted_test.cpp @@ -0,0 +1,129 @@ +/*============================================================================== + Copyright (c) 2010-2011 Bryce Lelbach + + 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 +#include +#include +#include + +template +struct tracking_less: std::binary_function { + typedef bool result_type; + + #if defined(__PATHSCALE__) + tracking_less (void) { } + ~tracking_less (void) { } + #endif + + bool operator() (T const& x, T const& y) const { + std::cout << x << " < " << y << " == " << (x < y) << "\n"; + return x < y; + } +}; + +template +struct tracking_less_equal: std::binary_function { + typedef bool result_type; + + #if defined(__PATHSCALE__) + tracking_less_equal (void) { } + ~tracking_less_equal (void) { } + #endif + + bool operator() (T const& x, T const& y) const { + std::cout << x << " <= " << y << " == " << (x <= y) << "\n"; + return x <= y; + } +}; + +template +struct tracking_greater: std::binary_function { + typedef bool result_type; + + #if defined(__PATHSCALE__) + tracking_greater (void) { } + ~tracking_greater (void) { } + #endif + + bool operator() (T const& x, T const& y) const { + std::cout << x << " > " << y << " == " << (x > y) << "\n"; + return x > y; + } +}; + +template +struct tracking_greater_equal: std::binary_function { + typedef bool result_type; + + #if defined(__PATHSCALE__) + tracking_greater_equal (void) { } + ~tracking_greater_equal (void) { } + #endif + + bool operator() (T const& x, T const& y) const { + std::cout << x << " >= " << y << " == " << (x >= y) << "\n"; + return x >= y; + } +}; + +int main (void) { + using boost::detail::is_sorted; + using boost::detail::is_sorted_until; + using boost::array; + using boost::report_errors; + + std::cout << std::boolalpha; + + array a = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } }; + array b = { { 0, 1, 1, 2, 5, 8, 13, 34, 55, 89 } }; + array c = { { 0, 1, -1, 2, -3, 5, -8, 13, -21, 34 } }; + + tracking_less lt; + tracking_less_equal lte; + tracking_greater gt; + tracking_greater_equal gte; + + BOOST_TEST_EQ(is_sorted_until(a.begin(), a.end()), a.end()); + BOOST_TEST_EQ(is_sorted_until(a.begin(), a.end(), lt), a.end()); + BOOST_TEST_EQ(is_sorted_until(a.begin(), a.end(), lte), a.end()); + BOOST_TEST_EQ(*is_sorted_until(a.rbegin(), a.rend(), gt), *a.rend()); + BOOST_TEST_EQ(*is_sorted_until(a.rbegin(), a.rend(), gte), *a.rend()); + + BOOST_TEST_EQ(is_sorted(a.begin(), a.end()), true); + BOOST_TEST_EQ(is_sorted(a.begin(), a.end(), lt), true); + BOOST_TEST_EQ(is_sorted(a.begin(), a.end(), lte), true); + BOOST_TEST_EQ(is_sorted(a.rbegin(), a.rend(), gt), true); + BOOST_TEST_EQ(is_sorted(a.rbegin(), a.rend(), gte), true); + + BOOST_TEST_EQ(is_sorted_until(b.begin(), b.end()), b.end()); + BOOST_TEST_EQ(is_sorted_until(b.begin(), b.end(), lt), b.end()); + BOOST_TEST_EQ(is_sorted_until(b.begin(), b.end(), lte), &b[2]); + BOOST_TEST_EQ(*is_sorted_until(b.rbegin(), b.rend(), gt), *b.rend()); + BOOST_TEST_EQ(*is_sorted_until(b.rbegin(), b.rend(), gte), b[2]); + + BOOST_TEST_EQ(is_sorted(b.begin(), b.end()), true); + BOOST_TEST_EQ(is_sorted(b.begin(), b.end(), lt), true); + BOOST_TEST_EQ(is_sorted(b.begin(), b.end(), lte), false); + BOOST_TEST_EQ(is_sorted(b.rbegin(), b.rend(), gt), true); + BOOST_TEST_EQ(is_sorted(b.rbegin(), b.rend(), gte), false); + + BOOST_TEST_EQ(is_sorted_until(c.begin(), c.end()), &c[2]); + BOOST_TEST_EQ(is_sorted_until(c.begin(), c.end(), lt), &c[2]); + BOOST_TEST_EQ(is_sorted_until(c.begin(), c.end(), lte), &c[2]); + BOOST_TEST_EQ(*is_sorted_until(c.rbegin(), c.rend(), gt), c[7]); + BOOST_TEST_EQ(*is_sorted_until(c.rbegin(), c.rend(), gte), c[7]); + + BOOST_TEST_EQ(is_sorted(c.begin(), c.end()), false); + BOOST_TEST_EQ(is_sorted(c.begin(), c.end(), lt), false); + BOOST_TEST_EQ(is_sorted(c.begin(), c.end(), lte), false); + BOOST_TEST_EQ(is_sorted(c.rbegin(), c.rend(), gt), false); + BOOST_TEST_EQ(is_sorted(c.rbegin(), c.rend(), gte), false); + + return report_errors(); +} + From 0693db0847953f65e7bd98519cd7fc2c312e949c Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Fri, 14 Jan 2011 17:37:59 +0000 Subject: [PATCH 80/92] Fixed ambiguity issues when compiling with C++0x support enabled. [SVN r68155] --- include/boost/detail/is_sorted.hpp | 14 +++---- test/is_sorted_test.cpp | 65 +++++++++++++++--------------- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/include/boost/detail/is_sorted.hpp b/include/boost/detail/is_sorted.hpp index 91f254c..5ab32e5 100644 --- a/include/boost/detail/is_sorted.hpp +++ b/include/boost/detail/is_sorted.hpp @@ -16,14 +16,14 @@ namespace boost { namespace detail { template -inline Iterator is_sorted_until (Iterator first, Iterator last, Comp compare) { +inline Iterator is_sorted_until (Iterator first, Iterator last, Comp c) { if (first == last) return last; Iterator it = first; ++it; for (; it != last; first = it, ++it) - if (compare(*it, *first)) + if (c(*it, *first)) return it; return it; @@ -34,19 +34,19 @@ inline Iterator is_sorted_until (Iterator first, Iterator last) { typedef typename boost::detail::iterator_traits::value_type value_type; - typedef std::less compare; + typedef std::less c; - return is_sorted_until(first, last, compare()); + return ::boost::detail::is_sorted_until(first, last, c()); } template -inline bool is_sorted (Iterator first, Iterator last, Comp compare) { - return is_sorted_until(first, last, compare) == last; +inline bool is_sorted (Iterator first, Iterator last, Comp c) { + return ::boost::detail::is_sorted_until(first, last, c) == last; } template inline bool is_sorted (Iterator first, Iterator last) { - return is_sorted_until(first, last) == last; + return ::boost::detail::is_sorted_until(first, last) == last; } } // detail diff --git a/test/is_sorted_test.cpp b/test/is_sorted_test.cpp index 36c03bc..036c10a 100644 --- a/test/is_sorted_test.cpp +++ b/test/is_sorted_test.cpp @@ -71,9 +71,10 @@ struct tracking_greater_equal: std::binary_function { } }; + int main (void) { - using boost::detail::is_sorted; - using boost::detail::is_sorted_until; + #define IS_SORTED ::boost::detail::is_sorted + #define IS_SORTED_UNTIL ::boost::detail::is_sorted_until using boost::array; using boost::report_errors; @@ -88,41 +89,41 @@ int main (void) { tracking_greater gt; tracking_greater_equal gte; - BOOST_TEST_EQ(is_sorted_until(a.begin(), a.end()), a.end()); - BOOST_TEST_EQ(is_sorted_until(a.begin(), a.end(), lt), a.end()); - BOOST_TEST_EQ(is_sorted_until(a.begin(), a.end(), lte), a.end()); - BOOST_TEST_EQ(*is_sorted_until(a.rbegin(), a.rend(), gt), *a.rend()); - BOOST_TEST_EQ(*is_sorted_until(a.rbegin(), a.rend(), gte), *a.rend()); + BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end()), a.end()); + BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end(), lt), a.end()); + BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end(), lte), a.end()); + BOOST_TEST_EQ(*IS_SORTED_UNTIL(a.rbegin(), a.rend(), gt), *a.rend()); + BOOST_TEST_EQ(*IS_SORTED_UNTIL(a.rbegin(), a.rend(), gte), *a.rend()); - BOOST_TEST_EQ(is_sorted(a.begin(), a.end()), true); - BOOST_TEST_EQ(is_sorted(a.begin(), a.end(), lt), true); - BOOST_TEST_EQ(is_sorted(a.begin(), a.end(), lte), true); - BOOST_TEST_EQ(is_sorted(a.rbegin(), a.rend(), gt), true); - BOOST_TEST_EQ(is_sorted(a.rbegin(), a.rend(), gte), true); + BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end()), true); + BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end(), lt), true); + BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end(), lte), true); + BOOST_TEST_EQ(IS_SORTED(a.rbegin(), a.rend(), gt), true); + BOOST_TEST_EQ(IS_SORTED(a.rbegin(), a.rend(), gte), true); - BOOST_TEST_EQ(is_sorted_until(b.begin(), b.end()), b.end()); - BOOST_TEST_EQ(is_sorted_until(b.begin(), b.end(), lt), b.end()); - BOOST_TEST_EQ(is_sorted_until(b.begin(), b.end(), lte), &b[2]); - BOOST_TEST_EQ(*is_sorted_until(b.rbegin(), b.rend(), gt), *b.rend()); - BOOST_TEST_EQ(*is_sorted_until(b.rbegin(), b.rend(), gte), b[2]); + BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end()), b.end()); + BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end(), lt), b.end()); + BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end(), lte), &b[2]); + BOOST_TEST_EQ(*IS_SORTED_UNTIL(b.rbegin(), b.rend(), gt), *b.rend()); + BOOST_TEST_EQ(*IS_SORTED_UNTIL(b.rbegin(), b.rend(), gte), b[2]); - BOOST_TEST_EQ(is_sorted(b.begin(), b.end()), true); - BOOST_TEST_EQ(is_sorted(b.begin(), b.end(), lt), true); - BOOST_TEST_EQ(is_sorted(b.begin(), b.end(), lte), false); - BOOST_TEST_EQ(is_sorted(b.rbegin(), b.rend(), gt), true); - BOOST_TEST_EQ(is_sorted(b.rbegin(), b.rend(), gte), false); + BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end()), true); + BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lt), true); + BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lte), false); + BOOST_TEST_EQ(IS_SORTED(b.rbegin(), b.rend(), gt), true); + BOOST_TEST_EQ(IS_SORTED(b.rbegin(), b.rend(), gte), false); - BOOST_TEST_EQ(is_sorted_until(c.begin(), c.end()), &c[2]); - BOOST_TEST_EQ(is_sorted_until(c.begin(), c.end(), lt), &c[2]); - BOOST_TEST_EQ(is_sorted_until(c.begin(), c.end(), lte), &c[2]); - BOOST_TEST_EQ(*is_sorted_until(c.rbegin(), c.rend(), gt), c[7]); - BOOST_TEST_EQ(*is_sorted_until(c.rbegin(), c.rend(), gte), c[7]); + BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end()), &c[2]); + BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end(), lt), &c[2]); + BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end(), lte), &c[2]); + BOOST_TEST_EQ(*IS_SORTED_UNTIL(c.rbegin(), c.rend(), gt), c[7]); + BOOST_TEST_EQ(*IS_SORTED_UNTIL(c.rbegin(), c.rend(), gte), c[7]); - BOOST_TEST_EQ(is_sorted(c.begin(), c.end()), false); - BOOST_TEST_EQ(is_sorted(c.begin(), c.end(), lt), false); - BOOST_TEST_EQ(is_sorted(c.begin(), c.end(), lte), false); - BOOST_TEST_EQ(is_sorted(c.rbegin(), c.rend(), gt), false); - BOOST_TEST_EQ(is_sorted(c.rbegin(), c.rend(), gte), false); + BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end()), false); + BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end(), lt), false); + BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end(), lte), false); + BOOST_TEST_EQ(IS_SORTED(c.rbegin(), c.rend(), gt), false); + BOOST_TEST_EQ(IS_SORTED(c.rbegin(), c.rend(), gte), false); return report_errors(); } From 74a47fbf054df070dd94537ecbd7b7d279c3185b Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Fri, 14 Jan 2011 17:39:36 +0000 Subject: [PATCH 81/92] Fixed issue with iomanip implementation + Apache stdlib. [SVN r68156] --- include/boost/detail/iomanip.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/boost/detail/iomanip.hpp b/include/boost/detail/iomanip.hpp index d45ecb5..f1132c5 100644 --- a/include/boost/detail/iomanip.hpp +++ b/include/boost/detail/iomanip.hpp @@ -8,6 +8,7 @@ #ifndef BOOST_DETAIL_IOMANIP_HPP #define BOOST_DETAIL_IOMANIP_HPP +#include #include #include @@ -93,13 +94,13 @@ class setbase_manip { using namespace std; switch (x.base) { case 8: - is.setf(ios_base::oct, ios_base::basefield); + is << std::oct; return is; case 10: - is.setf(ios_base::dec, ios_base::basefield); + is << std::dec; return is; case 16: - is.setf(ios_base::hex, ios_base::basefield); + is << std::hex; return is; default: is.setf(ios_base::fmtflags(0), ios_base::basefield); @@ -113,13 +114,13 @@ class setbase_manip { using namespace std; switch (x.base) { case 8: - os.setf(ios_base::oct, ios_base::basefield); + os << std::oct; return os; case 10: - os.setf(ios_base::dec, ios_base::basefield); + os << std::dec; return os; case 16: - os.setf(ios_base::hex, ios_base::basefield); + os << std::hex; return os; default: os.setf(ios_base::fmtflags(0), ios_base::basefield); From e3049b14803e1008d9306308217e7da9a88d4129 Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Sat, 15 Jan 2011 02:23:46 +0000 Subject: [PATCH 82/92] Make include and put the functions in the boost::detail namespace if not on clang- or intel-linux. [SVN r68165] --- include/boost/detail/iomanip.hpp | 425 ++++++++++++++++--------------- 1 file changed, 223 insertions(+), 202 deletions(-) diff --git a/include/boost/detail/iomanip.hpp b/include/boost/detail/iomanip.hpp index f1132c5..7e84b6d 100644 --- a/include/boost/detail/iomanip.hpp +++ b/include/boost/detail/iomanip.hpp @@ -8,218 +8,239 @@ #ifndef BOOST_DETAIL_IOMANIP_HPP #define BOOST_DETAIL_IOMANIP_HPP -#include -#include -#include +#include -namespace boost { -namespace detail { - -//[resetiosflags -class resetiosflags_manip { - private: - std::ios_base::fmtflags mask; - - public: - explicit resetiosflags_manip (std::ios_base::fmtflags m): - mask(m) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, - resetiosflags_manip const& x) - { - is.unsetf(x.mask); - return is; - } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, - resetiosflags_manip const& x) - { - os.unsetf(x.mask); - return os; - } -}; - -inline resetiosflags_manip resetiosflags (std::ios_base::fmtflags mask) { - return resetiosflags_manip(mask); -} -//] - -//[setiosflags -class setiosflags_manip { - private: - std::ios_base::fmtflags mask; - - public: - explicit setiosflags_manip (std::ios_base::fmtflags m): - mask(m) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, - setiosflags_manip const& x) { - is.setf(x.mask); - return is; - } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, - setiosflags_manip const& x) { - os.setf(x.mask); - return os; - } -}; - -inline setiosflags_manip setiosflags (std::ios_base::fmtflags mask) { - return setiosflags_manip(mask); -} -//] - -//[setbase -class setbase_manip { - private: - int base; - - public: - explicit setbase_manip (int b): - base(b) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, setbase_manip const& x) { - using namespace std; - switch (x.base) { - case 8: - is << std::oct; - return is; - case 10: - is << std::dec; - return is; - case 16: - is << std::hex; - return is; - default: - is.setf(ios_base::fmtflags(0), ios_base::basefield); - return is; +#if (defined(BOOST_CLANG) || defined(BOOST_INTEL_LINUX)) && \ + defined(BOOST_GNU_STDLIB) + #include + #include + #include + + namespace boost { + namespace detail { + + //[resetiosflags + class resetiosflags_manip { + private: + std::ios_base::fmtflags mask; + + public: + explicit resetiosflags_manip (std::ios_base::fmtflags m): + mask(m) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, + resetiosflags_manip const& x) + { + is.unsetf(x.mask); + return is; } - } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, setbase_manip const& x) { - using namespace std; - switch (x.base) { - case 8: - os << std::oct; - return os; - case 10: - os << std::dec; - return os; - case 16: - os << std::hex; - return os; - default: - os.setf(ios_base::fmtflags(0), ios_base::basefield); - return os; + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, + resetiosflags_manip const& x) + { + os.unsetf(x.mask); + return os; } + }; + + inline resetiosflags_manip resetiosflags (std::ios_base::fmtflags mask) { + return resetiosflags_manip(mask); } -}; - -inline setbase_manip setbase (int base) { - return setbase_manip(base); -} -//] - -//[setfill -template -class setfill_manip { - private: - CharT fill; - - public: - explicit setfill_manip (CharT c): - fill(c) { } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, setfill_manip const& x) { - os.fill(x.fill); - return os; + //] + + //[setiosflags + class setiosflags_manip { + private: + std::ios_base::fmtflags mask; + + public: + explicit setiosflags_manip (std::ios_base::fmtflags m): + mask(m) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, + setiosflags_manip const& x) { + is.setf(x.mask); + return is; + } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, + setiosflags_manip const& x) { + os.setf(x.mask); + return os; + } + }; + + inline setiosflags_manip setiosflags (std::ios_base::fmtflags mask) { + return setiosflags_manip(mask); } -}; - -template -inline setfill_manip setfill (CharT c) { - return setfill_manip(c); -} -//] - -//[setprecision -class setprecision_manip { - private: - int n; - - public: - explicit setprecision_manip (int n_): - n(n_) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, - setprecision_manip const& x) { - is.precision(x.n); - return is; + //] + + //[setbase + class setbase_manip { + private: + int base; + + public: + explicit setbase_manip (int b): + base(b) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, setbase_manip const& x) { + using namespace std; + switch (x.base) { + case 8: + is << std::oct; + return is; + case 10: + is << std::dec; + return is; + case 16: + is << std::hex; + return is; + default: + is.setf(ios_base::fmtflags(0), ios_base::basefield); + return is; + } + } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, setbase_manip const& x) { + using namespace std; + switch (x.base) { + case 8: + os << std::oct; + return os; + case 10: + os << std::dec; + return os; + case 16: + os << std::hex; + return os; + default: + os.setf(ios_base::fmtflags(0), ios_base::basefield); + return os; + } + } + }; + + inline setbase_manip setbase (int base) { + return setbase_manip(base); } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, - setprecision_manip const& x) { - os.precision(x.n); - return os; + //] + + //[setfill + template + class setfill_manip { + private: + CharT fill; + + public: + explicit setfill_manip (CharT c): + fill(c) { } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, setfill_manip const& x) { + os.fill(x.fill); + return os; + } + }; + + template + inline setfill_manip setfill (CharT c) { + return setfill_manip(c); } -}; - -inline setprecision_manip setprecision (int n_) { - return setprecision_manip(n_); -} -//] - -//[setw -class setw_manip { - private: - int n; - - public: - explicit setw_manip (int n_): - n(n_) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, setw_manip const& x) { - is.width(x.n); - return is; + //] + + //[setprecision + class setprecision_manip { + private: + int n; + + public: + explicit setprecision_manip (int n_): + n(n_) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, + setprecision_manip const& x) { + is.precision(x.n); + return is; + } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, + setprecision_manip const& x) { + os.precision(x.n); + return os; + } + }; + + inline setprecision_manip setprecision (int n_) { + return setprecision_manip(n_); } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, setw_manip const& x) { - os.width(x.n); - return os; + //] + + //[setw + class setw_manip { + private: + int n; + + public: + explicit setw_manip (int n_): + n(n_) { } + + template + friend std::basic_istream& + operator>> (std::basic_istream& is, setw_manip const& x) { + is.width(x.n); + return is; + } + + template + friend std::basic_ostream& + operator<< (std::basic_ostream& os, setw_manip const& x) { + os.width(x.n); + return os; + } + }; + + inline setw_manip setw (int n_) { + return setw_manip(n_); } -}; + //] -inline setw_manip setw (int n_) { - return setw_manip(n_); -} -//] + } // detail + } // boost -} // detail -} // boost +#else + #include + + namespace boost { + namespace detail { + + using ::std::resetiosflags; + using ::std::setiosflags; + using ::std::setbase; + using ::std::setfill; + using ::std::setprecision; + using ::std::setw; + + } // detail + } // boost + +#endif #endif // BOOST_DETAIL_IOMANIP_HPP - From d20069a4d6cf8960afa813f7c4c1b3470859a81c Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sat, 15 Jan 2011 08:11:51 +0000 Subject: [PATCH 83/92] Revert [67111] (addition of boost/detail/iomanip.hpp) and all the commits that depend on it. ([68137], [68140], [68141], [68154], and [68165]). [SVN r68168] --- include/boost/detail/iomanip.hpp | 246 ------------------------------- test/iomanip_test.cpp | 59 -------- 2 files changed, 305 deletions(-) delete mode 100644 include/boost/detail/iomanip.hpp delete mode 100644 test/iomanip_test.cpp diff --git a/include/boost/detail/iomanip.hpp b/include/boost/detail/iomanip.hpp deleted file mode 100644 index 7e84b6d..0000000 --- a/include/boost/detail/iomanip.hpp +++ /dev/null @@ -1,246 +0,0 @@ -/*============================================================================== - Copyright (c) 2010-2011 Bryce Lelbach - - 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 BOOST_DETAIL_IOMANIP_HPP -#define BOOST_DETAIL_IOMANIP_HPP - -#include - -#if (defined(BOOST_CLANG) || defined(BOOST_INTEL_LINUX)) && \ - defined(BOOST_GNU_STDLIB) - #include - #include - #include - - namespace boost { - namespace detail { - - //[resetiosflags - class resetiosflags_manip { - private: - std::ios_base::fmtflags mask; - - public: - explicit resetiosflags_manip (std::ios_base::fmtflags m): - mask(m) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, - resetiosflags_manip const& x) - { - is.unsetf(x.mask); - return is; - } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, - resetiosflags_manip const& x) - { - os.unsetf(x.mask); - return os; - } - }; - - inline resetiosflags_manip resetiosflags (std::ios_base::fmtflags mask) { - return resetiosflags_manip(mask); - } - //] - - //[setiosflags - class setiosflags_manip { - private: - std::ios_base::fmtflags mask; - - public: - explicit setiosflags_manip (std::ios_base::fmtflags m): - mask(m) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, - setiosflags_manip const& x) { - is.setf(x.mask); - return is; - } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, - setiosflags_manip const& x) { - os.setf(x.mask); - return os; - } - }; - - inline setiosflags_manip setiosflags (std::ios_base::fmtflags mask) { - return setiosflags_manip(mask); - } - //] - - //[setbase - class setbase_manip { - private: - int base; - - public: - explicit setbase_manip (int b): - base(b) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, setbase_manip const& x) { - using namespace std; - switch (x.base) { - case 8: - is << std::oct; - return is; - case 10: - is << std::dec; - return is; - case 16: - is << std::hex; - return is; - default: - is.setf(ios_base::fmtflags(0), ios_base::basefield); - return is; - } - } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, setbase_manip const& x) { - using namespace std; - switch (x.base) { - case 8: - os << std::oct; - return os; - case 10: - os << std::dec; - return os; - case 16: - os << std::hex; - return os; - default: - os.setf(ios_base::fmtflags(0), ios_base::basefield); - return os; - } - } - }; - - inline setbase_manip setbase (int base) { - return setbase_manip(base); - } - //] - - //[setfill - template - class setfill_manip { - private: - CharT fill; - - public: - explicit setfill_manip (CharT c): - fill(c) { } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, setfill_manip const& x) { - os.fill(x.fill); - return os; - } - }; - - template - inline setfill_manip setfill (CharT c) { - return setfill_manip(c); - } - //] - - //[setprecision - class setprecision_manip { - private: - int n; - - public: - explicit setprecision_manip (int n_): - n(n_) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, - setprecision_manip const& x) { - is.precision(x.n); - return is; - } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, - setprecision_manip const& x) { - os.precision(x.n); - return os; - } - }; - - inline setprecision_manip setprecision (int n_) { - return setprecision_manip(n_); - } - //] - - //[setw - class setw_manip { - private: - int n; - - public: - explicit setw_manip (int n_): - n(n_) { } - - template - friend std::basic_istream& - operator>> (std::basic_istream& is, setw_manip const& x) { - is.width(x.n); - return is; - } - - template - friend std::basic_ostream& - operator<< (std::basic_ostream& os, setw_manip const& x) { - os.width(x.n); - return os; - } - }; - - inline setw_manip setw (int n_) { - return setw_manip(n_); - } - //] - - } // detail - } // boost - -#else - #include - - namespace boost { - namespace detail { - - using ::std::resetiosflags; - using ::std::setiosflags; - using ::std::setbase; - using ::std::setfill; - using ::std::setprecision; - using ::std::setw; - - } // detail - } // boost - -#endif - -#endif // BOOST_DETAIL_IOMANIP_HPP diff --git a/test/iomanip_test.cpp b/test/iomanip_test.cpp deleted file mode 100644 index 60d91c3..0000000 --- a/test/iomanip_test.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================== - Copyright (c) 2010-2011 Bryce Lelbach - - 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 - -#include -#include -#include - -int main (void) { - using namespace boost::detail; - - std::ostringstream oss(std::ostringstream::out); - - //[setbase_test - oss << setbase(8) << 8; - BOOST_TEST_EQ(oss.str(), "10"); - - oss.str(""); - oss << setbase(10) << 10; - BOOST_TEST_EQ(oss.str(), "10"); - - oss.str(""); - oss << setbase(16) << 16; - BOOST_TEST_EQ(oss.str(), "10"); - //] - - //[setiosflags_test - oss.str(""); - oss << setiosflags(std::ios_base::showbase | std::ios_base::hex) << 16; - BOOST_TEST_EQ(oss.str(), "0x10"); - //] - - //[resetiosflags_test - oss.str(""); - oss << resetiosflags(std::ios_base::showbase | std::ios_base::hex) << 16; - BOOST_TEST_EQ(oss.str(), "16"); - //] - - //[setprecision_test - oss.str(""); - oss << setprecision(4) << 3.14159; - BOOST_TEST_EQ(oss.str(), "3.142"); - //] - - //[setfill_and_setw_test - oss.str(""); - oss << setfill('*') << setw(5) << 9; - BOOST_TEST_EQ(oss.str(), "****9"); - //] - - return boost::report_errors(); -} - From b98d99bc63dda1deb44c2c1967f69f54fe452834 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Mon, 17 Jan 2011 04:51:54 +0000 Subject: [PATCH 84/92] Revert addition of BOOST_NIX, etc and everything tied to it. ([66696], [66783], [66804], [66833], and [66834]) [SVN r68201] --- include/boost/detail/fenv.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/fenv.hpp b/include/boost/detail/fenv.hpp index 1ba8833..b8e8aa2 100644 --- a/include/boost/detail/fenv.hpp +++ b/include/boost/detail/fenv.hpp @@ -7,7 +7,7 @@ #include -#if defined(BOOST_NO_FENV_H) +#if !defined(BOOST_HAS_FENV_H) #error This platform does not have a floating point environment #endif From 76e55056ded6633bd63fb87b69404eeedb506444 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 24 Jan 2011 15:37:13 +0000 Subject: [PATCH 85/92] Add BOOST_ASSERT_MSG. Add macros to configure output stream. [SVN r68414] --- include/boost/detail/lightweight_test.hpp | 29 +++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/include/boost/detail/lightweight_test.hpp b/include/boost/detail/lightweight_test.hpp index 8add322..986bf41 100644 --- a/include/boost/detail/lightweight_test.hpp +++ b/include/boost/detail/lightweight_test.hpp @@ -11,6 +11,7 @@ // boost/detail/lightweight_test.hpp - lightweight test library // // Copyright (c) 2002, 2009 Peter Dimov +// Copyright (2) Beman Dawes 2010, 2011 // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at @@ -23,9 +24,15 @@ // int boost::report_errors() // +#include #include #include -#include + +// IDE's like Visual Studio perform better if output goes to std::cout or +// some other stream, so allow user to configure output stream: +#ifndef BOOST_LIGHTWEIGHT_TEST_OSTREAM +# define BOOST_LIGHTWEIGHT_TEST_OSTREAM std::cerr +#endif namespace boost { @@ -58,24 +65,30 @@ inline int & test_errors() inline void test_failed_impl(char const * expr, char const * file, int line, char const * function) { - std::cerr << file << "(" << line << "): test '" << expr << "' failed in function '" << function << "'" << std::endl; + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): test '" << expr << "' failed in function '" + << function << "'" << std::endl; ++test_errors(); } inline void error_impl(char const * msg, char const * file, int line, char const * function) { - std::cerr << file << "(" << line << "): " << msg << " in function '" << function << "'" << std::endl; + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): " << msg << " in function '" + << function << "'" << std::endl; ++test_errors(); } -template inline void test_eq_impl( char const * expr1, char const * expr2, char const * file, int line, char const * function, T const & t, U const & u ) +template inline void test_eq_impl( char const * expr1, char const * expr2, + char const * file, int line, char const * function, T const & t, U const & u ) { if( t == u ) { } else { - std::cerr << file << "(" << line << "): test '" << expr1 << " == " << expr2 + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): test '" << expr1 << " == " << expr2 << "' failed in function '" << function << "': " << "'" << t << "' != '" << u << "'" << std::endl; ++test_errors(); @@ -92,12 +105,14 @@ inline int report_errors() if( errors == 0 ) { - std::cerr << "No errors detected." << std::endl; + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << "No errors detected." << std::endl; return 0; } else { - std::cerr << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl; + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl; return 1; } } From 4920859a06e3de9e20920646e48f905362c7f081 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sun, 30 Jan 2011 06:24:30 +0000 Subject: [PATCH 86/92] Restore [66804], [66833], and [66834]. (fenv fixes.) I mistakenly reverted them in [68201] because [66804] was mislabeled. [SVN r68554] --- include/boost/detail/fenv.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/fenv.hpp b/include/boost/detail/fenv.hpp index b8e8aa2..1ba8833 100644 --- a/include/boost/detail/fenv.hpp +++ b/include/boost/detail/fenv.hpp @@ -7,7 +7,7 @@ #include -#if !defined(BOOST_HAS_FENV_H) +#if defined(BOOST_NO_FENV_H) #error This platform does not have a floating point environment #endif From 361414ba84044d00dd24df76e85e9f942c7723ee Mon Sep 17 00:00:00 2001 From: Christopher Jefferson Date: Fri, 11 Feb 2011 20:39:25 +0000 Subject: [PATCH 87/92] Disable forward container declarations for libc++ [SVN r68786] --- include/boost/detail/container_fwd.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/container_fwd.hpp b/include/boost/detail/container_fwd.hpp index 9a21252..1a58935 100644 --- a/include/boost/detail/container_fwd.hpp +++ b/include/boost/detail/container_fwd.hpp @@ -18,7 +18,8 @@ && (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL))) \ || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ - || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) + || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) \ + || (defined(_LIBCPP_VERSION)) #include #include From 8717cff3c57059b7ddc47c261d81cedfe01bca90 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 13 Feb 2011 14:48:01 +0000 Subject: [PATCH 88/92] Initial commit; bitmask.hpp is needed by upcoming filesystem changes [SVN r68836] --- include/boost/detail/bitmask.hpp | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 include/boost/detail/bitmask.hpp diff --git a/include/boost/detail/bitmask.hpp b/include/boost/detail/bitmask.hpp new file mode 100644 index 0000000..c6714a1 --- /dev/null +++ b/include/boost/detail/bitmask.hpp @@ -0,0 +1,47 @@ +// boost/detail/bitmask.hpp ------------------------------------------------// + +// Copyright Beman Dawes 2006 + +// Distributed under the Boost Software License, Version 1.0 +// http://www.boost.org/LICENSE_1_0.txt + +// Usage: enum foo { a=1, b=2, c=4 }; +// BOOST_BITMASK( foo ); +// +// void f( foo arg ); +// ... +// f( a | c ); + +#ifndef BOOST_BITMASK_HPP +#define BOOST_BITMASK_HPP + +#include + +#define BOOST_BITMASK(Bitmask) \ + \ + inline Bitmask operator| (Bitmask x , Bitmask y ) \ + { return static_cast( static_cast(x) \ + | static_cast(y)); } \ + \ + inline Bitmask operator& (Bitmask x , Bitmask y ) \ + { return static_cast( static_cast(x) \ + & static_cast(y)); } \ + \ + inline Bitmask operator^ (Bitmask x , Bitmask y ) \ + { return static_cast( static_cast(x) \ + ^ static_cast(y)); } \ + \ + inline Bitmask operator~ (Bitmask x ) \ + { return static_cast(~static_cast(x)); } \ + \ + inline Bitmask & operator&=(Bitmask & x , Bitmask y) \ + { x = x & y ; return x ; } \ + \ + inline Bitmask & operator|=(Bitmask & x , Bitmask y) \ + { x = x | y ; return x ; } \ + \ + inline Bitmask & operator^=(Bitmask & x , Bitmask y) \ + { x = x ^ y ; return x ; } + +#endif // BOOST_BITMASK_HPP + From 5367f6459d7ab55892c1ea67267ac0592c19686e Mon Sep 17 00:00:00 2001 From: Christopher Jefferson Date: Mon, 14 Feb 2011 10:27:38 +0000 Subject: [PATCH 89/92] libc++ also has no const on codecvt length [SVN r68859] --- include/boost/detail/utf8_codecvt_facet.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index b777ff9..65c5e4e 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -92,7 +92,8 @@ namespace std { } #endif -#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) +#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) \ + && !defined(_LIBCPP_VERSION) #define BOOST_CODECVT_DO_LENGTH_CONST const #else #define BOOST_CODECVT_DO_LENGTH_CONST From 704bb6644b964a681d7f70dced6ddcb721dc297c Mon Sep 17 00:00:00 2001 From: David Deakins Date: Thu, 24 Feb 2011 18:21:52 +0000 Subject: [PATCH 90/92] Changes to complete Boost.Chrono support for Windows CE. Closes ticket 5218. [SVN r69240] --- include/boost/detail/win/GetCurrentThread.hpp | 8 ++++++++ include/boost/detail/win/GetProcessTimes.hpp | 2 ++ include/boost/detail/win/time.hpp | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/include/boost/detail/win/GetCurrentThread.hpp b/include/boost/detail/win/GetCurrentThread.hpp index a0922e9..4e12d60 100644 --- a/include/boost/detail/win/GetCurrentThread.hpp +++ b/include/boost/detail/win/GetCurrentThread.hpp @@ -14,11 +14,19 @@ namespace boost { namespace detail { namespace win32 { +#if defined( UNDER_CE ) +// Windows CE define GetCurrentThread as an inline function in kfuncs.h +inline HANDLE_ GetCurrentThread() +{ + return ::GetCurrentThread(); +} +#else #if defined( BOOST_USE_WINDOWS_H ) using ::GetCurrentThread; #else extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentThread(); #endif +#endif } } } diff --git a/include/boost/detail/win/GetProcessTimes.hpp b/include/boost/detail/win/GetProcessTimes.hpp index b1d95e0..d8ccb35 100644 --- a/include/boost/detail/win/GetProcessTimes.hpp +++ b/include/boost/detail/win/GetProcessTimes.hpp @@ -14,6 +14,7 @@ namespace boost { namespace detail { namespace win32 { +#if !defined(UNDER_CE) // Windows CE does not define GetProcessTimes #if defined( BOOST_USE_WINDOWS_H ) using ::GetProcessTimes; #else @@ -26,6 +27,7 @@ namespace win32 { LPFILETIME_ lpUserTime ); #endif +#endif } } } diff --git a/include/boost/detail/win/time.hpp b/include/boost/detail/win/time.hpp index 1707423..e1c912b 100644 --- a/include/boost/detail/win/time.hpp +++ b/include/boost/detail/win/time.hpp @@ -23,7 +23,9 @@ namespace win32 { typedef SYSTEMTIME SYSTEMTIME_; typedef SYSTEMTIME* PSYSTEMTIME_; + #ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime using ::GetSystemTimeAsFileTime; + #endif using ::FileTimeToLocalFileTime; using ::GetSystemTime; using ::SystemTimeToFileTime; @@ -47,8 +49,10 @@ extern "C" { WORD_ wMilliseconds; } SYSTEMTIME_, *PSYSTEMTIME_; + #ifndef UNDER_CE // Windows CE does not define GetSystemTimeAsFileTime __declspec(dllimport) void WINAPI GetSystemTimeAsFileTime(FILETIME_* lpFileTime); + #endif __declspec(dllimport) int WINAPI FileTimeToLocalFileTime(const FILETIME_* lpFileTime, FILETIME_* lpLocalFileTime); From c42fd431af2fe78550e060d5287642b82050f822 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 24 Feb 2011 23:24:54 +0000 Subject: [PATCH 91/92] Add hash_value for shared_ptr; prevents hash_value( bool ) from being used. Refs #5216. [SVN r69260] --- include/boost/detail/lightweight_test.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/boost/detail/lightweight_test.hpp b/include/boost/detail/lightweight_test.hpp index 986bf41..dbd99b9 100644 --- a/include/boost/detail/lightweight_test.hpp +++ b/include/boost/detail/lightweight_test.hpp @@ -95,6 +95,22 @@ template inline void test_eq_impl( char const * expr1, char co } } +template inline void test_ne_impl( char const * expr1, char const * expr2, + char const * file, int line, char const * function, T const & t, U const & u ) +{ + if( t != u ) + { + } + else + { + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): test '" << expr1 << " != " << expr2 + << "' failed in function '" << function << "': " + << "'" << t << "' == '" << u << "'" << std::endl; + ++test_errors(); + } +} + } // namespace detail inline int report_errors() @@ -122,5 +138,6 @@ inline int report_errors() #define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)) #define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) #define BOOST_TEST_EQ(expr1,expr2) ( ::boost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) ) +#define BOOST_TEST_NE(expr1,expr2) ( ::boost::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) ) #endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED From 9f938bf39bba02240a13fa5a85dde25542953c07 Mon Sep 17 00:00:00 2001 From: Anthony Williams Date: Mon, 21 Mar 2011 23:09:07 +0000 Subject: [PATCH 92/92] Applied patch from issue #4849 [SVN r70383] --- include/boost/detail/interlocked.hpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index c88d326..5889ccb 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -106,21 +106,28 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* ); #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ ) +#if defined(__MINGW64__) +#define BOOST_INTERLOCKED_IMPORT +#else +#define BOOST_INTERLOCKED_IMPORT __declspec(dllimport) +#endif + + namespace boost { namespace detail { -extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * ); -extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * ); -extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long ); -extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long ); -extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long ); +extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * ); +extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * ); +extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long ); +extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long ); +extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long ); # if defined(_M_IA64) || defined(_M_AMD64) -extern "C" __declspec(dllimport) void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* ); -extern "C" __declspec(dllimport) void* __stdcall InterlockedExchangePointer( void* volatile *, void* ); +extern "C"BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* ); +extern "C"BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* ); # endif } // namespace detail