diff options
Diffstat (limited to '3rdParty/Boost/src')
386 files changed, 11794 insertions, 4030 deletions
diff --git a/3rdParty/Boost/src/boost/algorithm/string/case_conv.hpp b/3rdParty/Boost/src/boost/algorithm/string/case_conv.hpp index 536c022..683340b 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/case_conv.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/case_conv.hpp @@ -59,7 +59,7 @@ namespace boost { { return ::boost::algorithm::detail::transform_range_copy( Output, - as_literal(Input), + ::boost::as_literal(Input), ::boost::algorithm::detail::to_lowerF< typename range_value<RangeT>::type >(Loc)); } @@ -93,7 +93,7 @@ namespace boost { const std::locale& Loc=std::locale()) { ::boost::algorithm::detail::transform_range( - as_literal(Input), + ::boost::as_literal(Input), ::boost::algorithm::detail::to_lowerF< typename range_value<WritableRangeT>::type >(Loc)); } @@ -124,7 +124,7 @@ namespace boost { { return ::boost::algorithm::detail::transform_range_copy( Output, - as_literal(Input), + ::boost::as_literal(Input), ::boost::algorithm::detail::to_upperF< typename range_value<RangeT>::type >(Loc)); } @@ -158,7 +158,7 @@ namespace boost { const std::locale& Loc=std::locale()) { ::boost::algorithm::detail::transform_range( - as_literal(Input), + ::boost::as_literal(Input), ::boost::algorithm::detail::to_upperF< typename range_value<WritableRangeT>::type >(Loc)); } diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/case_conv.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/case_conv.hpp index 5253454..3440c27 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/case_conv.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/case_conv.hpp @@ -105,10 +105,10 @@ namespace boost { FunctorT Functor) { return SequenceT( - make_transform_iterator( + ::boost::make_transform_iterator( ::boost::begin(Input), Functor), - make_transform_iterator( + ::boost::make_transform_iterator( ::boost::end(Input), Functor)); } diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format.hpp index 8fb625e..0d8b104 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format.hpp @@ -24,26 +24,7 @@ namespace boost { // find_format_copy (iterator variant) implementation -------------------------------// - template< - typename OutputIteratorT, - typename InputT, - typename FormatterT, - typename FindResultT > - inline OutputIteratorT find_format_copy_impl( - OutputIteratorT Output, - const InputT& Input, - FormatterT Formatter, - const FindResultT& FindResult ) - { - return find_format_copy_impl2( - Output, - Input, - Formatter, - FindResult, - Formatter(FindResult) ); - } - - template< + template< typename OutputIteratorT, typename InputT, typename FormatterT, @@ -83,25 +64,29 @@ namespace boost { return Output; } -// find_format_copy implementation --------------------------------------------------// - template< - typename InputT, + typename OutputIteratorT, + typename InputT, typename FormatterT, typename FindResultT > - inline InputT find_format_copy_impl( + inline OutputIteratorT find_format_copy_impl( + OutputIteratorT Output, const InputT& Input, FormatterT Formatter, - const FindResultT& FindResult) - { - return find_format_copy_impl2( + const FindResultT& FindResult ) + { + return ::boost::algorithm::detail::find_format_copy_impl2( + Output, Input, Formatter, FindResult, Formatter(FindResult) ); } - template< + +// find_format_copy implementation --------------------------------------------------// + + template< typename InputT, typename FormatterT, typename FindResultT, @@ -138,24 +123,24 @@ namespace boost { return Output; } -// replace implementation ----------------------------------------------------// - - template< - typename InputT, + template< + typename InputT, typename FormatterT, typename FindResultT > - inline void find_format_impl( - InputT& Input, + inline InputT find_format_copy_impl( + const InputT& Input, FormatterT Formatter, const FindResultT& FindResult) { - find_format_impl2( + return ::boost::algorithm::detail::find_format_copy_impl2( Input, Formatter, FindResult, Formatter(FindResult) ); } + // replace implementation ----------------------------------------------------// + template< typename InputT, typename FormatterT, @@ -183,7 +168,23 @@ namespace boost { } // Replace match - replace( Input, M.begin(), M.end(), M.format_result() ); + ::boost::algorithm::detail::replace( Input, M.begin(), M.end(), M.format_result() ); + } + + template< + typename InputT, + typename FormatterT, + typename FindResultT > + inline void find_format_impl( + InputT& Input, + FormatterT Formatter, + const FindResultT& FindResult) + { + ::boost::algorithm::detail::find_format_impl2( + Input, + Formatter, + FindResult, + Formatter(FindResult) ); } } // namespace detail diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_all.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_all.hpp index 9533be6..36edf56 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_all.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/find_format_all.hpp @@ -24,29 +24,7 @@ namespace boost { // find_format_all_copy (iterator variant) implementation ---------------------------// - template< - typename OutputIteratorT, - typename InputT, - typename FinderT, - typename FormatterT, - typename FindResultT > - inline OutputIteratorT find_format_all_copy_impl( - OutputIteratorT Output, - const InputT& Input, - FinderT Finder, - FormatterT Formatter, - const FindResultT& FindResult ) - { - return find_format_all_copy_impl2( - Output, - Input, - Finder, - Formatter, - FindResult, - Formatter(FindResult) ); - } - - template< + template< typename OutputIteratorT, typename InputT, typename FinderT, @@ -94,20 +72,21 @@ namespace boost { return Output; } -// find_format_all_copy implementation ----------------------------------------------// - template< - typename InputT, + typename OutputIteratorT, + typename InputT, typename FinderT, typename FormatterT, typename FindResultT > - inline InputT find_format_all_copy_impl( + inline OutputIteratorT find_format_all_copy_impl( + OutputIteratorT Output, const InputT& Input, FinderT Finder, FormatterT Formatter, - const FindResultT& FindResult) - { - return find_format_all_copy_impl2( + const FindResultT& FindResult ) + { + return ::boost::algorithm::detail::find_format_all_copy_impl2( + Output, Input, Finder, Formatter, @@ -115,7 +94,9 @@ namespace boost { Formatter(FindResult) ); } - template< + // find_format_all_copy implementation ----------------------------------------------// + + template< typename InputT, typename FinderT, typename FormatterT, @@ -159,25 +140,23 @@ namespace boost { } // Copy the rest of the sequence - insert( Output, ::boost::end(Output), LastMatch, ::boost::end(Input) ); + ::boost::algorithm::detail::insert( Output, ::boost::end(Output), LastMatch, ::boost::end(Input) ); return Output; } -// find_format_all implementation ------------------------------------------------// - - template< - typename InputT, + template< + typename InputT, typename FinderT, typename FormatterT, typename FindResultT > - inline void find_format_all_impl( - InputT& Input, + inline InputT find_format_all_copy_impl( + const InputT& Input, FinderT Finder, FormatterT Formatter, - FindResultT FindResult) + const FindResultT& FindResult) { - find_format_all_impl2( + return ::boost::algorithm::detail::find_format_all_copy_impl2( Input, Finder, Formatter, @@ -185,6 +164,8 @@ namespace boost { Formatter(FindResult) ); } + // find_format_all implementation ------------------------------------------------// + template< typename InputT, typename FinderT, @@ -230,14 +211,14 @@ namespace boost { SearchIt=M.end(); // Copy formated replace to the storage - copy_to_storage( Storage, M.format_result() ); + ::boost::algorithm::detail::copy_to_storage( Storage, M.format_result() ); // Find range for a next match M=Finder( SearchIt, ::boost::end(Input) ); } // process the last segment - InsertIt=process_segment( + InsertIt=::boost::algorithm::detail::process_segment( Storage, Input, InsertIt, @@ -247,15 +228,34 @@ namespace boost { if ( Storage.empty() ) { // Truncate input - erase( Input, InsertIt, ::boost::end(Input) ); + ::boost::algorithm::detail::erase( Input, InsertIt, ::boost::end(Input) ); } else { // Copy remaining data to the end of input - insert( Input, ::boost::end(Input), Storage.begin(), Storage.end() ); + ::boost::algorithm::detail::insert( Input, ::boost::end(Input), Storage.begin(), Storage.end() ); } } + template< + typename InputT, + typename FinderT, + typename FormatterT, + typename FindResultT > + inline void find_format_all_impl( + InputT& Input, + FinderT Finder, + FormatterT Formatter, + FindResultT FindResult) + { + ::boost::algorithm::detail::find_format_all_impl2( + Input, + Finder, + Formatter, + FindResult, + Formatter(FindResult) ); + } + } // namespace detail } // namespace algorithm } // namespace boost diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/finder.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/finder.hpp index c6d0752..45bcb7d 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/finder.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/finder.hpp @@ -382,7 +382,7 @@ namespace boost { typedef BOOST_STRING_TYPENAME boost::detail:: iterator_traits<ForwardIteratorT>::iterator_category category; - return find_head_impl( Begin, End, N, category() ); + return ::boost::algorithm::detail::find_head_impl( Begin, End, N, category() ); } template< typename ForwardIteratorT > @@ -456,7 +456,7 @@ namespace boost { typedef BOOST_STRING_TYPENAME boost::detail:: iterator_traits<ForwardIteratorT>::iterator_category category; - return find_tail_impl( Begin, End, N, category() ); + return ::boost::algorithm::detail::find_tail_impl( Begin, End, N, category() ); } @@ -484,14 +484,14 @@ namespace boost { { if(m_N>=0) { - return find_head_impl( Begin, End, m_N ); + return ::boost::algorithm::detail::find_head_impl( Begin, End, m_N ); } else { iterator_range<ForwardIteratorT> Res= - find_tail_impl( Begin, End, -m_N ); + ::boost::algorithm::detail::find_tail_impl( Begin, End, -m_N ); - return make_iterator_range(Begin, Res.begin()); + return ::boost::make_iterator_range(Begin, Res.begin()); } } @@ -522,14 +522,14 @@ namespace boost { { if(m_N>=0) { - return find_tail_impl( Begin, End, m_N ); + return ::boost::algorithm::detail::find_tail_impl( Begin, End, m_N ); } else { iterator_range<ForwardIteratorT> Res= - find_head_impl( Begin, End, -m_N ); + ::boost::algorithm::detail::find_head_impl( Begin, End, -m_N ); - return make_iterator_range(Res.end(), End); + return ::boost::make_iterator_range(Res.end(), End); } } diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/replace_storage.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/replace_storage.hpp index 7aff247..db35e4c 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/replace_storage.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/replace_storage.hpp @@ -68,7 +68,7 @@ namespace boost { ForwardIteratorT SegmentEnd ) { // Copy data from the storage until the beginning of the segment - ForwardIteratorT It=move_from_storage( Storage, InsertIt, SegmentBegin ); + ForwardIteratorT It=::boost::algorithm::detail::move_from_storage( Storage, InsertIt, SegmentBegin ); // 3 cases are possible : // a) Storage is empty, It==SegmentBegin @@ -125,7 +125,7 @@ namespace boost { { // Call replace to do the job - replace( Input, InsertIt, SegmentBegin, Storage ); + ::boost::algorithm::detail::replace( Input, InsertIt, SegmentBegin, Storage ); // Empty the storage Storage.clear(); // Iterators were not changed, simply return the end of segment diff --git a/3rdParty/Boost/src/boost/algorithm/string/detail/sequence.hpp b/3rdParty/Boost/src/boost/algorithm/string/detail/sequence.hpp index de01350..dc47409 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/detail/sequence.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/detail/sequence.hpp @@ -41,7 +41,7 @@ namespace boost { BOOST_STRING_TYPENAME InputT::iterator At, const InsertT& Insert ) { - insert( Input, At, ::boost::begin(Insert), ::boost::end(Insert) ); + ::boost::algorithm::detail::insert( Input, At, ::boost::begin(Insert), ::boost::end(Insert) ); } // erase helper ---------------------------------------------------// @@ -184,11 +184,11 @@ namespace boost { { if(From!=To) { - replace( Input, From, To, ::boost::begin(Insert), ::boost::end(Insert) ); + ::boost::algorithm::detail::replace( Input, From, To, ::boost::begin(Insert), ::boost::end(Insert) ); } else { - insert( Input, From, ::boost::begin(Insert), ::boost::end(Insert) ); + ::boost::algorithm::detail::insert( Input, From, ::boost::begin(Insert), ::boost::end(Insert) ); } } diff --git a/3rdParty/Boost/src/boost/algorithm/string/erase.hpp b/3rdParty/Boost/src/boost/algorithm/string/erase.hpp index b50323b..0951b8a 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/erase.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/erase.hpp @@ -54,11 +54,11 @@ namespace boost { BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>& SearchRange ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - range_finder(SearchRange), - empty_formatter(Input) ); + ::boost::algorithm::range_finder(SearchRange), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase range algorithm @@ -72,10 +72,10 @@ namespace boost { BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>& SearchRange ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - range_finder(SearchRange), - empty_formatter(Input) ); + ::boost::algorithm::range_finder(SearchRange), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase range algorithm @@ -93,10 +93,10 @@ namespace boost { BOOST_STRING_TYPENAME range_iterator<SequenceT>::type>& SearchRange ) { - find_format( + ::boost::algorithm::find_format( Input, - range_finder(SearchRange), - empty_formatter(Input) ); + ::boost::algorithm::range_finder(SearchRange), + ::boost::algorithm::empty_formatter(Input) ); } // erase_first --------------------------------------------------------// @@ -124,11 +124,11 @@ namespace boost { const Range1T& Input, const Range2T& Search ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - first_finder(Search), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase first algorithm @@ -140,10 +140,10 @@ namespace boost { const SequenceT& Input, const RangeT& Search ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - first_finder(Search), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase first algorithm @@ -159,10 +159,10 @@ namespace boost { SequenceT& Input, const RangeT& Search ) { - find_format( + ::boost::algorithm::find_format( Input, - first_finder(Search), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::empty_formatter(Input) ); } // erase_first ( case insensitive ) ------------------------------------// @@ -193,11 +193,11 @@ namespace boost { const Range2T& Search, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - first_finder(Search, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase first algorithm ( case insensitive ) @@ -210,10 +210,10 @@ namespace boost { const RangeT& Search, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - first_finder(Search, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase first algorithm ( case insensitive ) @@ -231,10 +231,10 @@ namespace boost { const RangeT& Search, const std::locale& Loc=std::locale() ) { - find_format( + ::boost::algorithm::find_format( Input, - first_finder(Search, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } // erase_last --------------------------------------------------------// @@ -262,11 +262,11 @@ namespace boost { const Range1T& Input, const Range2T& Search ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - last_finder(Search), - empty_formatter(Input) ); + ::boost::algorithm::last_finder(Search), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase last algorithm @@ -278,10 +278,10 @@ namespace boost { const SequenceT& Input, const RangeT& Search ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - last_finder(Search), - empty_formatter(Input) ); + ::boost::algorithm::last_finder(Search), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase last algorithm @@ -297,10 +297,10 @@ namespace boost { SequenceT& Input, const RangeT& Search ) { - find_format( + ::boost::algorithm::find_format( Input, - last_finder(Search), - empty_formatter(Input) ); + ::boost::algorithm::last_finder(Search), + ::boost::algorithm::empty_formatter(Input) ); } // erase_last ( case insensitive ) ------------------------------------// @@ -331,11 +331,11 @@ namespace boost { const Range2T& Search, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - last_finder(Search, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::last_finder(Search, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase last algorithm ( case insensitive ) @@ -348,10 +348,10 @@ namespace boost { const RangeT& Search, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - last_finder(Search, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::last_finder(Search, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase last algorithm ( case insensitive ) @@ -369,10 +369,10 @@ namespace boost { const RangeT& Search, const std::locale& Loc=std::locale() ) { - find_format( + ::boost::algorithm::find_format( Input, - last_finder(Search, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::last_finder(Search, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } // erase_nth --------------------------------------------------------------------// @@ -404,11 +404,11 @@ namespace boost { const Range2T& Search, int Nth ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - nth_finder(Search, Nth), - empty_formatter(Input) ); + ::boost::algorithm::nth_finder(Search, Nth), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase nth algorithm @@ -421,10 +421,10 @@ namespace boost { const RangeT& Search, int Nth ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - nth_finder(Search, Nth), - empty_formatter(Input) ); + ::boost::algorithm::nth_finder(Search, Nth), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase nth algorithm @@ -443,10 +443,10 @@ namespace boost { const RangeT& Search, int Nth ) { - find_format( + ::boost::algorithm::find_format( Input, - nth_finder(Search, Nth), - empty_formatter(Input) ); + ::boost::algorithm::nth_finder(Search, Nth), + ::boost::algorithm::empty_formatter(Input) ); } // erase_nth ( case insensitive ) ---------------------------------------------// @@ -480,11 +480,11 @@ namespace boost { int Nth, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - nth_finder(Search, Nth, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase nth algorithm @@ -498,9 +498,9 @@ namespace boost { int Nth, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - nth_finder(Search, Nth, is_iequal(Loc)), + ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), empty_formatter(Input) ); } @@ -522,10 +522,10 @@ namespace boost { int Nth, const std::locale& Loc=std::locale() ) { - find_format( + ::boost::algorithm::find_format( Input, - nth_finder(Search, Nth, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } @@ -555,11 +555,11 @@ namespace boost { const Range1T& Input, const Range2T& Search ) { - return find_format_all_copy( + return ::boost::algorithm::find_format_all_copy( Output, Input, - first_finder(Search), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase all algorithm @@ -571,10 +571,10 @@ namespace boost { const SequenceT& Input, const RangeT& Search ) { - return find_format_all_copy( + return ::boost::algorithm::find_format_all_copy( Input, - first_finder(Search), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase all algorithm @@ -590,10 +590,10 @@ namespace boost { SequenceT& Input, const RangeT& Search ) { - find_format_all( + ::boost::algorithm::find_format_all( Input, - first_finder(Search), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::empty_formatter(Input) ); } // erase_all ( case insensitive ) ------------------------------------// @@ -624,11 +624,11 @@ namespace boost { const Range2T& Search, const std::locale& Loc=std::locale() ) { - return find_format_all_copy( + return ::boost::algorithm::find_format_all_copy( Output, Input, - first_finder(Search, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase all algorithm ( case insensitive ) @@ -641,10 +641,10 @@ namespace boost { const RangeT& Search, const std::locale& Loc=std::locale() ) { - return find_format_all_copy( + return ::boost::algorithm::find_format_all_copy( Input, - first_finder(Search, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } //! Erase all algorithm ( case insensitive ) @@ -662,10 +662,10 @@ namespace boost { const RangeT& Search, const std::locale& Loc=std::locale() ) { - find_format_all( + ::boost::algorithm::find_format_all( Input, - first_finder(Search, is_iequal(Loc)), - empty_formatter(Input) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::empty_formatter(Input) ); } // erase_head --------------------------------------------------------------------// @@ -696,11 +696,11 @@ namespace boost { const RangeT& Input, int N ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - head_finder(N), - empty_formatter( Input ) ); + ::boost::algorithm::head_finder(N), + ::boost::algorithm::empty_formatter( Input ) ); } //! Erase head algorithm @@ -712,10 +712,10 @@ namespace boost { const SequenceT& Input, int N ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - head_finder(N), - empty_formatter( Input ) ); + ::boost::algorithm::head_finder(N), + ::boost::algorithm::empty_formatter( Input ) ); } //! Erase head algorithm @@ -734,10 +734,10 @@ namespace boost { SequenceT& Input, int N ) { - find_format( + ::boost::algorithm::find_format( Input, - head_finder(N), - empty_formatter( Input ) ); + ::boost::algorithm::head_finder(N), + ::boost::algorithm::empty_formatter( Input ) ); } // erase_tail --------------------------------------------------------------------// @@ -768,11 +768,11 @@ namespace boost { const RangeT& Input, int N ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - tail_finder(N), - empty_formatter( Input ) ); + ::boost::algorithm::tail_finder(N), + ::boost::algorithm::empty_formatter( Input ) ); } //! Erase tail algorithm @@ -784,10 +784,10 @@ namespace boost { const SequenceT& Input, int N ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - tail_finder(N), - empty_formatter( Input ) ); + ::boost::algorithm::tail_finder(N), + ::boost::algorithm::empty_formatter( Input ) ); } //! Erase tail algorithm @@ -806,10 +806,10 @@ namespace boost { SequenceT& Input, int N ) { - find_format( + ::boost::algorithm::find_format( Input, - tail_finder(N), - empty_formatter( Input ) ); + ::boost::algorithm::tail_finder(N), + ::boost::algorithm::empty_formatter( Input ) ); } } // namespace algorithm diff --git a/3rdParty/Boost/src/boost/algorithm/string/find_format.hpp b/3rdParty/Boost/src/boost/algorithm/string/find_format.hpp index 7cbaf34..ef03739 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/find_format.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/find_format.hpp @@ -62,15 +62,18 @@ namespace boost { FormatterT Formatter ) { // Concept check - function_requires< - FinderConcept<FinderT, - BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(); - function_requires< + BOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> + )); + BOOST_CONCEPT_ASSERT(( FormatterConcept< FormatterT, - FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(); + FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> + )); - iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(as_literal(Input)); + iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input)); return detail::find_format_copy_impl( Output, @@ -93,13 +96,16 @@ namespace boost { FormatterT Formatter ) { // Concept check - function_requires< - FinderConcept<FinderT, - BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >(); - function_requires< + BOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> + )); + BOOST_CONCEPT_ASSERT(( FormatterConcept< FormatterT, - FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >(); + FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> + )); return detail::find_format_copy_impl( Input, @@ -126,13 +132,16 @@ namespace boost { FormatterT Formatter) { // Concept check - function_requires< - FinderConcept<FinderT, - BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >(); - function_requires< + BOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> + )); + BOOST_CONCEPT_ASSERT(( FormatterConcept< FormatterT, - FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >(); + FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> + )); detail::find_format_impl( Input, @@ -172,15 +181,18 @@ namespace boost { FormatterT Formatter) { // Concept check - function_requires< - FinderConcept<FinderT, - BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(); - function_requires< + BOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> + )); + BOOST_CONCEPT_ASSERT(( FormatterConcept< FormatterT, - FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(); + FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> + )); - iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(as_literal(Input)); + iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input)); return detail::find_format_all_copy_impl( Output, @@ -204,13 +216,16 @@ namespace boost { FormatterT Formatter ) { // Concept check - function_requires< - FinderConcept<FinderT, - BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >(); - function_requires< + BOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> + )); + BOOST_CONCEPT_ASSERT(( FormatterConcept< FormatterT, - FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >(); + FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> + )); return detail::find_format_all_copy_impl( Input, @@ -239,13 +254,16 @@ namespace boost { FormatterT Formatter ) { // Concept check - function_requires< - FinderConcept<FinderT, - BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >(); - function_requires< + BOOST_CONCEPT_ASSERT(( + FinderConcept< + FinderT, + BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> + )); + BOOST_CONCEPT_ASSERT(( FormatterConcept< FormatterT, - FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> >(); + FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type> + )); detail::find_format_all_impl( Input, diff --git a/3rdParty/Boost/src/boost/algorithm/string/finder.hpp b/3rdParty/Boost/src/boost/algorithm/string/finder.hpp index c936ddb..4c7ac38 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/finder.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/finder.hpp @@ -56,7 +56,7 @@ namespace boost { detail::first_finderF< BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type, - is_equal>( as_literal(Search), is_equal() ) ; + is_equal>( ::boost::as_literal(Search), is_equal() ) ; } //! "First" finder @@ -74,7 +74,7 @@ namespace boost { detail::first_finderF< BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type, - PredicateT>( as_literal(Search), Comp ); + PredicateT>( ::boost::as_literal(Search), Comp ); } //! "Last" finder @@ -97,7 +97,7 @@ namespace boost { detail::last_finderF< BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type, - is_equal>( as_literal(Search), is_equal() ); + is_equal>( ::boost::as_literal(Search), is_equal() ); } //! "Last" finder /*! @@ -113,7 +113,7 @@ namespace boost { detail::last_finderF< BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type, - PredicateT>( as_literal(Search), Comp ) ; + PredicateT>( ::boost::as_literal(Search), Comp ) ; } //! "Nth" finder @@ -139,7 +139,7 @@ namespace boost { detail::nth_finderF< BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type, - is_equal>( as_literal(Search), Nth, is_equal() ) ; + is_equal>( ::boost::as_literal(Search), Nth, is_equal() ) ; } //! "Nth" finder /*! @@ -158,7 +158,7 @@ namespace boost { detail::nth_finderF< BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type, - PredicateT>( as_literal(Search), Nth, Comp ); + PredicateT>( ::boost::as_literal(Search), Nth, Comp ); } //! "Head" finder diff --git a/3rdParty/Boost/src/boost/algorithm/string/formatter.hpp b/3rdParty/Boost/src/boost/algorithm/string/formatter.hpp index e04a50f..50006df 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/formatter.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/formatter.hpp @@ -50,7 +50,7 @@ namespace boost { { return detail::const_formatF< iterator_range< - BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(as_literal(Format)); + BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(::boost::as_literal(Format)); } //! Identity formatter diff --git a/3rdParty/Boost/src/boost/algorithm/string/replace.hpp b/3rdParty/Boost/src/boost/algorithm/string/replace.hpp index 1c59ec7..f2d201f 100644 --- a/3rdParty/Boost/src/boost/algorithm/string/replace.hpp +++ b/3rdParty/Boost/src/boost/algorithm/string/replace.hpp @@ -61,11 +61,11 @@ namespace boost { range_const_iterator<Range1T>::type>& SearchRange, const Range2T& Format) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - range_finder(SearchRange), - const_formatter(Format)); + ::boost::algorithm::range_finder(SearchRange), + ::boost::algorithm::const_formatter(Format)); } //! Replace range algorithm @@ -80,10 +80,10 @@ namespace boost { range_const_iterator<SequenceT>::type>& SearchRange, const RangeT& Format) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - range_finder(SearchRange), - const_formatter(Format)); + ::boost::algorithm::range_finder(SearchRange), + ::boost::algorithm::const_formatter(Format)); } //! Replace range algorithm @@ -103,10 +103,10 @@ namespace boost { range_iterator<SequenceT>::type>& SearchRange, const RangeT& Format) { - find_format( + ::boost::algorithm::find_format( Input, - range_finder(SearchRange), - const_formatter(Format)); + ::boost::algorithm::range_finder(SearchRange), + ::boost::algorithm::const_formatter(Format)); } // replace_first --------------------------------------------------------------------// @@ -138,11 +138,11 @@ namespace boost { const Range2T& Search, const Range3T& Format) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - first_finder(Search), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::const_formatter(Format) ); } //! Replace first algorithm @@ -155,10 +155,10 @@ namespace boost { const Range1T& Search, const Range2T& Format ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - first_finder(Search), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::const_formatter(Format) ); } //! Replace first algorithm @@ -176,10 +176,10 @@ namespace boost { const Range1T& Search, const Range2T& Format ) { - find_format( + ::boost::algorithm::find_format( Input, - first_finder(Search), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::const_formatter(Format) ); } // replace_first ( case insensitive ) ---------------------------------------------// @@ -214,11 +214,11 @@ namespace boost { const Range3T& Format, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - first_finder(Search, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } //! Replace first algorithm ( case insensitive ) @@ -232,10 +232,10 @@ namespace boost { const Range1T& Format, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - first_finder(Search, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } //! Replace first algorithm ( case insensitive ) @@ -256,10 +256,10 @@ namespace boost { const Range2T& Format, const std::locale& Loc=std::locale() ) { - find_format( + ::boost::algorithm::find_format( Input, - first_finder(Search, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } // replace_last --------------------------------------------------------------------// @@ -291,11 +291,11 @@ namespace boost { const Range2T& Search, const Range3T& Format ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - last_finder(Search), - const_formatter(Format) ); + ::boost::algorithm::last_finder(Search), + ::boost::algorithm::const_formatter(Format) ); } //! Replace last algorithm @@ -308,10 +308,10 @@ namespace boost { const Range1T& Search, const Range2T& Format ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - last_finder(Search), - const_formatter(Format) ); + ::boost::algorithm::last_finder(Search), + ::boost::algorithm::const_formatter(Format) ); } //! Replace last algorithm @@ -329,10 +329,10 @@ namespace boost { const Range1T& Search, const Range2T& Format ) { - find_format( + ::boost::algorithm::find_format( Input, - last_finder(Search), - const_formatter(Format) ); + ::boost::algorithm::last_finder(Search), + ::boost::algorithm::const_formatter(Format) ); } // replace_last ( case insensitive ) -----------------------------------------------// @@ -367,11 +367,11 @@ namespace boost { const Range3T& Format, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - last_finder(Search, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::last_finder(Search, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } //! Replace last algorithm ( case insensitive ) @@ -385,10 +385,10 @@ namespace boost { const Range2T& Format, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - last_finder(Search, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::last_finder(Search, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } //! Replace last algorithm ( case insensitive ) @@ -410,10 +410,10 @@ namespace boost { const Range2T& Format, const std::locale& Loc=std::locale() ) { - find_format( + ::boost::algorithm::find_format( Input, - last_finder(Search, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::last_finder(Search, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } // replace_nth --------------------------------------------------------------------// @@ -448,11 +448,11 @@ namespace boost { int Nth, const Range3T& Format ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - nth_finder(Search, Nth), - const_formatter(Format) ); + ::boost::algorithm::nth_finder(Search, Nth), + ::boost::algorithm::const_formatter(Format) ); } //! Replace nth algorithm @@ -466,10 +466,10 @@ namespace boost { int Nth, const Range2T& Format ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - nth_finder(Search, Nth), - const_formatter(Format) ); + ::boost::algorithm::nth_finder(Search, Nth), + ::boost::algorithm::const_formatter(Format) ); } //! Replace nth algorithm @@ -490,10 +490,10 @@ namespace boost { int Nth, const Range2T& Format ) { - find_format( + ::boost::algorithm::find_format( Input, - nth_finder(Search, Nth), - const_formatter(Format) ); + ::boost::algorithm::nth_finder(Search, Nth), + ::boost::algorithm::const_formatter(Format) ); } // replace_nth ( case insensitive ) -----------------------------------------------// @@ -531,11 +531,11 @@ namespace boost { const Range3T& Format, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - nth_finder(Search, Nth, is_iequal(Loc) ), - const_formatter(Format) ); + ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc) ), + ::boost::algorithm::const_formatter(Format) ); } //! Replace nth algorithm ( case insensitive ) @@ -550,10 +550,10 @@ namespace boost { const Range2T& Format, const std::locale& Loc=std::locale() ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - nth_finder(Search, Nth, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } //! Replace nth algorithm ( case insensitive ) @@ -577,10 +577,10 @@ namespace boost { const Range2T& Format, const std::locale& Loc=std::locale() ) { - find_format( + ::boost::algorithm::find_format( Input, - nth_finder(Search, Nth, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } // replace_all --------------------------------------------------------------------// @@ -612,11 +612,11 @@ namespace boost { const Range2T& Search, const Range3T& Format ) { - return find_format_all_copy( + return ::boost::algorithm::find_format_all_copy( Output, Input, - first_finder(Search), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::const_formatter(Format) ); } //! Replace all algorithm @@ -629,10 +629,10 @@ namespace boost { const Range1T& Search, const Range2T& Format ) { - return find_format_all_copy( + return ::boost::algorithm::find_format_all_copy( Input, - first_finder(Search), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::const_formatter(Format) ); } //! Replace all algorithm @@ -651,10 +651,10 @@ namespace boost { const Range1T& Search, const Range2T& Format ) { - find_format_all( + ::boost::algorithm::find_format_all( Input, - first_finder(Search), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search), + ::boost::algorithm::const_formatter(Format) ); } // replace_all ( case insensitive ) -----------------------------------------------// @@ -689,11 +689,11 @@ namespace boost { const Range3T& Format, const std::locale& Loc=std::locale() ) { - return find_format_all_copy( + return ::boost::algorithm::find_format_all_copy( Output, Input, - first_finder(Search, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } //! Replace all algorithm ( case insensitive ) @@ -707,10 +707,10 @@ namespace boost { const Range2T& Format, const std::locale& Loc=std::locale() ) { - return find_format_all_copy( + return ::boost::algorithm::find_format_all_copy( Input, - first_finder(Search, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } //! Replace all algorithm ( case insensitive ) @@ -731,10 +731,10 @@ namespace boost { const Range2T& Format, const std::locale& Loc=std::locale() ) { - find_format_all( + ::boost::algorithm::find_format_all( Input, - first_finder(Search, is_iequal(Loc)), - const_formatter(Format) ); + ::boost::algorithm::first_finder(Search, is_iequal(Loc)), + ::boost::algorithm::const_formatter(Format) ); } // replace_head --------------------------------------------------------------------// @@ -769,11 +769,11 @@ namespace boost { int N, const Range2T& Format ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - head_finder(N), - const_formatter(Format) ); + ::boost::algorithm::head_finder(N), + ::boost::algorithm::const_formatter(Format) ); } //! Replace head algorithm @@ -786,10 +786,10 @@ namespace boost { int N, const RangeT& Format ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - head_finder(N), - const_formatter(Format) ); + ::boost::algorithm::head_finder(N), + ::boost::algorithm::const_formatter(Format) ); } //! Replace head algorithm @@ -811,10 +811,10 @@ namespace boost { int N, const RangeT& Format ) { - find_format( + ::boost::algorithm::find_format( Input, - head_finder(N), - const_formatter(Format) ); + ::boost::algorithm::head_finder(N), + ::boost::algorithm::const_formatter(Format) ); } // replace_tail --------------------------------------------------------------------// @@ -849,11 +849,11 @@ namespace boost { int N, const Range2T& Format ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Output, Input, - tail_finder(N), - const_formatter(Format) ); + ::boost::algorithm::tail_finder(N), + ::boost::algorithm::const_formatter(Format) ); } //! Replace tail algorithm @@ -866,10 +866,10 @@ namespace boost { int N, const RangeT& Format ) { - return find_format_copy( + return ::boost::algorithm::find_format_copy( Input, - tail_finder(N), - const_formatter(Format) ); + ::boost::algorithm::tail_finder(N), + ::boost::algorithm::const_formatter(Format) ); } //! Replace tail algorithm @@ -891,10 +891,10 @@ namespace boost { int N, const RangeT& Format ) { - find_format( + ::boost::algorithm::find_format( Input, - tail_finder(N), - const_formatter(Format) ); + ::boost::algorithm::tail_finder(N), + ::boost::algorithm::const_formatter(Format) ); } } // namespace algorithm diff --git a/3rdParty/Boost/src/boost/aligned_storage.hpp b/3rdParty/Boost/src/boost/aligned_storage.hpp index cfaf787..ce277ab 100644 --- a/3rdParty/Boost/src/boost/aligned_storage.hpp +++ b/3rdParty/Boost/src/boost/aligned_storage.hpp @@ -54,6 +54,14 @@ struct aligned_storage_imp , type_with_alignment<alignment_> >::type align_; } data_; + void* address() const { return const_cast<aligned_storage_imp*>(this); } +}; + +template< std::size_t alignment_ > +struct aligned_storage_imp<0u,alignment_> +{ + /* intentionally empty */ + void* address() const { return 0; } }; }} // namespace detail::aligned_storage @@ -62,12 +70,15 @@ template < std::size_t size_ , std::size_t alignment_ = std::size_t(-1) > -class aligned_storage +class aligned_storage : +#ifndef __BORLANDC__ + private +#else + public +#endif + detail::aligned_storage::aligned_storage_imp<size_, alignment_> { -private: // representation - - detail::aligned_storage::aligned_storage_imp<size_, alignment_> data_; - + public: // constants typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type; @@ -118,14 +129,14 @@ public: // accessors void* address() { - return this; + return static_cast<type*>(this)->address(); } #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) const void* address() const { - return this; + return static_cast<const type*>(this)->address(); } #else // MSVC6 diff --git a/3rdParty/Boost/src/boost/any.hpp b/3rdParty/Boost/src/boost/any.hpp index 47773dc..a8c654c 100644 --- a/3rdParty/Boost/src/boost/any.hpp +++ b/3rdParty/Boost/src/boost/any.hpp @@ -19,6 +19,17 @@ #include <boost/throw_exception.hpp> #include <boost/static_assert.hpp> +// See boost/python/type_id.hpp +// TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp +# if (defined(__GNUC__) && __GNUC__ >= 3) \ + || defined(_AIX) \ + || ( defined(__sgi) && defined(__host_mips)) \ + || (defined(__hpux) && defined(__HP_aCC)) \ + || (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC)) +# define BOOST_AUX_ANY_TYPE_ID_NAME +#include <cstring> +# endif + namespace boost { class any @@ -164,9 +175,14 @@ namespace boost template<typename ValueType> ValueType * any_cast(any * operand) { - return operand && operand->type() == typeid(ValueType) - ? &static_cast<any::holder<ValueType> *>(operand->content)->held - : 0; + return operand && +#ifdef BOOST_AUX_ANY_TYPE_ID_NAME + std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0 +#else + operand->type() == typeid(ValueType) +#endif + ? &static_cast<any::holder<ValueType> *>(operand->content)->held + : 0; } template<typename ValueType> diff --git a/3rdParty/Boost/src/boost/array.hpp b/3rdParty/Boost/src/boost/array.hpp index 52218aa..d58b93a 100644 --- a/3rdParty/Boost/src/boost/array.hpp +++ b/3rdParty/Boost/src/boost/array.hpp @@ -24,9 +24,17 @@ #ifndef BOOST_ARRAY_HPP #define BOOST_ARRAY_HPP +#include <boost/detail/workaround.hpp> + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +# pragma warning(push) +# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe +#endif + #include <cstddef> #include <stdexcept> #include <boost/assert.hpp> +#include <boost/swap.hpp> // Handles broken standard libraries better than <iterator> #include <boost/detail/iterator.hpp> @@ -131,7 +139,8 @@ namespace boost { // swap (note: linear complexity) void swap (array<T,N>& y) { - std::swap_ranges(begin(),end(),y.begin()); + for (size_type i = 0; i < N; ++i) + boost::swap(elems[i],y.elems[i]); } // direct access to data (read-only) @@ -209,19 +218,19 @@ namespace boost { } // operator[] - reference operator[](size_type i) + reference operator[](size_type /*i*/) { return failed_rangecheck(); } - const_reference operator[](size_type i) const + const_reference operator[](size_type /*i*/) const { return failed_rangecheck(); } // at() with range check - reference at(size_type i) { return failed_rangecheck(); } - const_reference at(size_type i) const { return failed_rangecheck(); } + reference at(size_type /*i*/) { return failed_rangecheck(); } + const_reference at(size_type /*i*/) const { return failed_rangecheck(); } // front() and back() reference front() @@ -250,7 +259,7 @@ namespace boost { static size_type max_size() { return 0; } enum { static_size = 0 }; - void swap (array<T,0>& y) { + void swap (array<T,0>& /*y*/) { } // direct access to data (read-only) @@ -318,4 +327,9 @@ namespace boost { } /* namespace boost */ + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +# pragma warning(pop) +#endif + #endif /*BOOST_ARRAY_HPP*/ diff --git a/3rdParty/Boost/src/boost/asio.hpp b/3rdParty/Boost/src/boost/asio.hpp index 5d8b43b..f94e0d6 100644 --- a/3rdParty/Boost/src/boost/asio.hpp +++ b/3rdParty/Boost/src/boost/asio.hpp @@ -2,7 +2,7 @@ // asio.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp index 8fa870b..3b3dedb 100644 --- a/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_datagram_socket.hpp @@ -2,7 +2,7 @@ // basic_datagram_socket.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp b/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp index 65256b8..1284daa 100644 --- a/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_deadline_timer.hpp @@ -2,7 +2,7 @@ // basic_deadline_timer.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -35,6 +35,10 @@ namespace asio { * The basic_deadline_timer class template provides the ability to perform a * blocking or asynchronous wait for a timer to expire. * + * A deadline timer is always in one of two states: "expired" or "not expired". + * If the wait() or async_wait() function is called on an expired timer, the + * wait operation will complete immediately. + * * Most applications will use the boost::asio::deadline_timer typedef. * * @par Thread Safety @@ -193,6 +197,16 @@ public: * @return The number of asynchronous operations that were cancelled. * * @throws boost::system::system_error Thrown on failure. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t cancel() { @@ -213,6 +227,16 @@ public: * @param ec Set to indicate what error occurred, if any. * * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when cancel() is called, then the + * handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t cancel(boost::system::error_code& ec) { @@ -240,6 +264,16 @@ public: * @return The number of asynchronous operations that were cancelled. * * @throws boost::system::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t expires_at(const time_type& expiry_time) { @@ -261,6 +295,16 @@ public: * @param ec Set to indicate what error occurred, if any. * * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_at() is called, then + * the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t expires_at(const time_type& expiry_time, boost::system::error_code& ec) @@ -289,6 +333,16 @@ public: * @return The number of asynchronous operations that were cancelled. * * @throws boost::system::system_error Thrown on failure. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t expires_from_now(const duration_type& expiry_time) { @@ -310,6 +364,16 @@ public: * @param ec Set to indicate what error occurred, if any. * * @return The number of asynchronous operations that were cancelled. + * + * @note If the timer has already expired when expires_from_now() is called, + * then the handlers for asynchronous wait operations will: + * + * @li have already been invoked; or + * + * @li have been queued for invocation in the near future. + * + * These handlers can no longer be cancelled, and therefore are passed an + * error code that indicates the successful completion of the wait operation. */ std::size_t expires_from_now(const duration_type& expiry_time, boost::system::error_code& ec) diff --git a/3rdParty/Boost/src/boost/asio/basic_io_object.hpp b/3rdParty/Boost/src/boost/asio/basic_io_object.hpp index 1cbf9bb..3cb6b68 100644 --- a/3rdParty/Boost/src/boost/asio/basic_io_object.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_io_object.hpp @@ -2,7 +2,7 @@ // basic_io_object.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp index 1ba5558..09810d4 100644 --- a/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_raw_socket.hpp @@ -2,7 +2,7 @@ // basic_raw_socket.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp b/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp index 339d5df..539119a 100644 --- a/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_serial_port.hpp @@ -2,7 +2,7 @@ // basic_serial_port.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/basic_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_socket.hpp index c991132..6b89623 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket.hpp @@ -2,7 +2,7 @@ // basic_socket.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp b/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp index afa0d63..d23dc33 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket_acceptor.hpp @@ -2,7 +2,7 @@ // basic_socket_acceptor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp b/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp index b0ae259..e4c7ec1 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket_iostream.hpp @@ -2,7 +2,7 @@ // basic_socket_iostream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,6 +18,12 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#include <boost/asio/detail/pop_options.hpp> + +#if !defined(BOOST_NO_IOSTREAM) + +#include <boost/asio/detail/push_options.hpp> #include <boost/preprocessor/arithmetic/inc.hpp> #include <boost/preprocessor/repetition/enum_binary_params.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> @@ -145,6 +151,8 @@ public: #undef BOOST_ASIO_PRIVATE_CTR_DEF #undef BOOST_ASIO_PRIVATE_CONNECT_DEF +#endif // defined(BOOST_NO_IOSTREAM) + #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_BASIC_SOCKET_IOSTREAM_HPP diff --git a/3rdParty/Boost/src/boost/asio/basic_socket_streambuf.hpp b/3rdParty/Boost/src/boost/asio/basic_socket_streambuf.hpp index 9977be6..9e96401 100644 --- a/3rdParty/Boost/src/boost/asio/basic_socket_streambuf.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_socket_streambuf.hpp @@ -2,7 +2,7 @@ // basic_socket_streambuf.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,6 +18,12 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#include <boost/asio/detail/pop_options.hpp> + +#if !defined(BOOST_NO_IOSTREAM) + +#include <boost/asio/detail/push_options.hpp> #include <streambuf> #include <boost/array.hpp> #include <boost/preprocessor/arithmetic/inc.hpp> @@ -282,6 +288,8 @@ private: #undef BOOST_ASIO_PRIVATE_CONNECT_DEF +#endif // !defined(BOOST_NO_IOSTREAM) + #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_BASIC_SOCKET_STREAMBUF_HPP diff --git a/3rdParty/Boost/src/boost/asio/basic_stream_socket.hpp b/3rdParty/Boost/src/boost/asio/basic_stream_socket.hpp index c020369..15658bc 100644 --- a/3rdParty/Boost/src/boost/asio/basic_stream_socket.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_stream_socket.hpp @@ -2,7 +2,7 @@ // basic_stream_socket.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/basic_streambuf.hpp b/3rdParty/Boost/src/boost/asio/basic_streambuf.hpp index db0e0c5..e5f8a8d 100644 --- a/3rdParty/Boost/src/boost/asio/basic_streambuf.hpp +++ b/3rdParty/Boost/src/boost/asio/basic_streambuf.hpp @@ -2,7 +2,7 @@ // basic_streambuf.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,13 +18,20 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#include <boost/asio/detail/pop_options.hpp> + +#if !defined(BOOST_NO_IOSTREAM) + +#include <boost/asio/detail/push_options.hpp> #include <algorithm> #include <cstring> -#include <limits> #include <memory> #include <stdexcept> #include <streambuf> #include <vector> +#include <boost/limits.hpp> +#include <boost/throw_exception.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffer.hpp> @@ -89,7 +96,7 @@ namespace asio { * boost::asio::streambuf b; * * // reserve 512 bytes in output sequence - * boost::asio::streambuf::const_buffers_type bufs = b.prepare(512); + * boost::asio::streambuf::mutable_buffers_type bufs = b.prepare(512); * * size_t n = sock.receive(bufs); * @@ -318,7 +325,8 @@ protected: } else { - throw std::length_error("boost::asio::streambuf too long"); + std::length_error ex("boost::asio::streambuf too long"); + boost::throw_exception(ex); } } @@ -337,4 +345,6 @@ private: #include <boost/asio/detail/pop_options.hpp> +#endif // !defined(BOOST_NO_IOSTREAM) + #endif // BOOST_ASIO_BASIC_STREAMBUF_HPP diff --git a/3rdParty/Boost/src/boost/asio/buffer.hpp b/3rdParty/Boost/src/boost/asio/buffer.hpp index 056d712..3fe8192 100644 --- a/3rdParty/Boost/src/boost/asio/buffer.hpp +++ b/3rdParty/Boost/src/boost/asio/buffer.hpp @@ -2,7 +2,7 @@ // buffer.hpp // ~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -432,12 +432,12 @@ public: ~buffer_debug_check() { -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) - // MSVC's string iterator checking may crash in a std::string::iterator +#if BOOST_WORKAROUND(BOOST_MSVC, == 1400) + // MSVC 8's string iterator checking may crash in a std::string::iterator // object's destructor when the iterator points to an already-destroyed // std::string object, unless the iterator is cleared first. iter_ = Iterator(); -#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#endif // BOOST_WORKAROUND(BOOST_MSVC, == 1400) } void operator()() diff --git a/3rdParty/Boost/src/boost/asio/buffered_read_stream.hpp b/3rdParty/Boost/src/boost/asio/buffered_read_stream.hpp index 742123b..d7bf6ff 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_read_stream.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_read_stream.hpp @@ -2,7 +2,7 @@ // buffered_read_stream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -21,7 +21,7 @@ #include <cstddef> #include <cstring> #include <boost/config.hpp> -#include <boost/type_traits.hpp> +#include <boost/type_traits/remove_reference.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffered_read_stream_fwd.hpp> @@ -230,8 +230,21 @@ public: template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers) { + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::mutable_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + return 0; + if (storage_.empty()) fill(); + return copy(buffers); } @@ -242,8 +255,22 @@ public: boost::system::error_code& ec) { ec = boost::system::error_code(); + + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::mutable_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + return 0; + if (storage_.empty() && !fill(ec)) return 0; + return copy(buffers); } @@ -306,7 +333,21 @@ public: void async_read_some(const MutableBufferSequence& buffers, ReadHandler handler) { - if (storage_.empty()) + typename MutableBufferSequence::const_iterator iter = buffers.begin(); + typename MutableBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::mutable_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + { + get_io_service().post(detail::bind_handler( + handler, boost::system::error_code(), 0)); + } + else if (storage_.empty()) { async_fill(read_some_handler<MutableBufferSequence, ReadHandler>( get_io_service(), storage_, buffers, handler)); diff --git a/3rdParty/Boost/src/boost/asio/buffered_read_stream_fwd.hpp b/3rdParty/Boost/src/boost/asio/buffered_read_stream_fwd.hpp index da9765e..8eb24f8 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_read_stream_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_read_stream_fwd.hpp @@ -2,7 +2,7 @@ // buffered_read_stream_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/buffered_stream.hpp b/3rdParty/Boost/src/boost/asio/buffered_stream.hpp index e1b8d38..0cbc280 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_stream.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_stream.hpp @@ -2,7 +2,7 @@ // buffered_stream.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/buffered_stream_fwd.hpp b/3rdParty/Boost/src/boost/asio/buffered_stream_fwd.hpp index 7641235..066f52c 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_stream_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_stream_fwd.hpp @@ -2,7 +2,7 @@ // buffered_stream_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/buffered_write_stream.hpp b/3rdParty/Boost/src/boost/asio/buffered_write_stream.hpp index 1d06541..fb38b25 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_write_stream.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_write_stream.hpp @@ -2,7 +2,7 @@ // buffered_write_stream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -21,7 +21,7 @@ #include <cstddef> #include <cstring> #include <boost/config.hpp> -#include <boost/type_traits.hpp> +#include <boost/type_traits/remove_reference.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffered_write_stream_fwd.hpp> @@ -187,8 +187,21 @@ public: template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers) { + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::const_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + return 0; + if (storage_.size() == storage_.capacity()) flush(); + return copy(buffers); } @@ -199,8 +212,22 @@ public: boost::system::error_code& ec) { ec = boost::system::error_code(); + + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::const_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + return 0; + if (storage_.size() == storage_.capacity() && !flush(ec)) return 0; + return copy(buffers); } @@ -264,7 +291,21 @@ public: void async_write_some(const ConstBufferSequence& buffers, WriteHandler handler) { - if (storage_.size() == storage_.capacity()) + typename ConstBufferSequence::const_iterator iter = buffers.begin(); + typename ConstBufferSequence::const_iterator end = buffers.end(); + size_t total_buffer_size = 0; + for (; iter != end; ++iter) + { + boost::asio::const_buffer buffer(*iter); + total_buffer_size += boost::asio::buffer_size(buffer); + } + + if (total_buffer_size == 0) + { + get_io_service().post(detail::bind_handler( + handler, boost::system::error_code(), 0)); + } + else if (storage_.size() == storage_.capacity()) { async_flush(write_some_handler<ConstBufferSequence, WriteHandler>( get_io_service(), storage_, buffers, handler)); diff --git a/3rdParty/Boost/src/boost/asio/buffered_write_stream_fwd.hpp b/3rdParty/Boost/src/boost/asio/buffered_write_stream_fwd.hpp index 4774e89..74cdb83 100644 --- a/3rdParty/Boost/src/boost/asio/buffered_write_stream_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/buffered_write_stream_fwd.hpp @@ -2,7 +2,7 @@ // buffered_write_stream_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/buffers_iterator.hpp b/3rdParty/Boost/src/boost/asio/buffers_iterator.hpp index f9d61da..0d29213 100644 --- a/3rdParty/Boost/src/boost/asio/buffers_iterator.hpp +++ b/3rdParty/Boost/src/boost/asio/buffers_iterator.hpp @@ -2,7 +2,7 @@ // buffers_iterator.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/completion_condition.hpp b/3rdParty/Boost/src/boost/asio/completion_condition.hpp index c317c02..747591c 100644 --- a/3rdParty/Boost/src/boost/asio/completion_condition.hpp +++ b/3rdParty/Boost/src/boost/asio/completion_condition.hpp @@ -2,7 +2,7 @@ // completion_condition.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/datagram_socket_service.hpp b/3rdParty/Boost/src/boost/asio/datagram_socket_service.hpp index 8cc6617..93deddc 100644 --- a/3rdParty/Boost/src/boost/asio/datagram_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/datagram_socket_service.hpp @@ -2,7 +2,7 @@ // datagram_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -24,12 +24,23 @@ #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/reactive_socket_service.hpp> -#include <boost/asio/detail/win_iocp_socket_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/deadline_timer.hpp b/3rdParty/Boost/src/boost/asio/deadline_timer.hpp index a62a2ce..7f8d1e3 100644 --- a/3rdParty/Boost/src/boost/asio/deadline_timer.hpp +++ b/3rdParty/Boost/src/boost/asio/deadline_timer.hpp @@ -2,7 +2,7 @@ // deadline_timer.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -28,7 +28,7 @@ namespace boost { namespace asio { -/// Typedef for the typical usage of timer. +/// Typedef for the typical usage of timer. Uses a UTC clock. typedef basic_deadline_timer<boost::posix_time::ptime> deadline_timer; } // namespace asio diff --git a/3rdParty/Boost/src/boost/asio/deadline_timer_service.hpp b/3rdParty/Boost/src/boost/asio/deadline_timer_service.hpp index dccd139..90e7482 100644 --- a/3rdParty/Boost/src/boost/asio/deadline_timer_service.hpp +++ b/3rdParty/Boost/src/boost/asio/deadline_timer_service.hpp @@ -2,7 +2,7 @@ // deadline_timer_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -25,11 +25,19 @@ #include <boost/asio/io_service.hpp> #include <boost/asio/time_traits.hpp> #include <boost/asio/detail/deadline_timer_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/win_iocp_io_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_io_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/detail/bind_handler.hpp b/3rdParty/Boost/src/boost/asio/detail/bind_handler.hpp index 3a9ad01..e161893 100644 --- a/3rdParty/Boost/src/boost/asio/detail/bind_handler.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/bind_handler.hpp @@ -2,7 +2,7 @@ // bind_handler.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -54,7 +54,7 @@ inline void* asio_handler_allocate(std::size_t size, binder1<Handler, Arg1>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1> @@ -62,7 +62,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder1<Handler, Arg1>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1> @@ -70,7 +70,7 @@ inline void asio_handler_invoke(const Function& function, binder1<Handler, Arg1>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1> @@ -112,7 +112,7 @@ inline void* asio_handler_allocate(std::size_t size, binder2<Handler, Arg1, Arg2>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2> @@ -120,7 +120,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder2<Handler, Arg1, Arg2>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1, typename Arg2> @@ -128,7 +128,7 @@ inline void asio_handler_invoke(const Function& function, binder2<Handler, Arg1, Arg2>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2> @@ -173,7 +173,7 @@ inline void* asio_handler_allocate(std::size_t size, binder3<Handler, Arg1, Arg2, Arg3>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3> @@ -181,7 +181,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder3<Handler, Arg1, Arg2, Arg3>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1, typename Arg2, @@ -190,7 +190,7 @@ inline void asio_handler_invoke(const Function& function, binder3<Handler, Arg1, Arg2, Arg3>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3> @@ -239,7 +239,7 @@ inline void* asio_handler_allocate(std::size_t size, binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3, @@ -248,7 +248,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1, typename Arg2, @@ -257,7 +257,7 @@ inline void asio_handler_invoke(const Function& function, binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3, @@ -311,7 +311,7 @@ inline void* asio_handler_allocate(std::size_t size, binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3, @@ -320,7 +320,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler, typename Arg1, typename Arg2, @@ -329,7 +329,7 @@ inline void asio_handler_invoke(const Function& function, binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } template <typename Handler, typename Arg1, typename Arg2, typename Arg3, diff --git a/3rdParty/Boost/src/boost/asio/detail/buffer_resize_guard.hpp b/3rdParty/Boost/src/boost/asio/detail/buffer_resize_guard.hpp index 63d957c..af67c46 100644 --- a/3rdParty/Boost/src/boost/asio/detail/buffer_resize_guard.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/buffer_resize_guard.hpp @@ -2,7 +2,7 @@ // buffer_resize_guard.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,8 +18,8 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <limits> #include <boost/config.hpp> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> namespace boost { diff --git a/3rdParty/Boost/src/boost/asio/detail/buffered_stream_storage.hpp b/3rdParty/Boost/src/boost/asio/detail/buffered_stream_storage.hpp index f20bf27..9b83426 100644 --- a/3rdParty/Boost/src/boost/asio/detail/buffered_stream_storage.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/buffered_stream_storage.hpp @@ -2,7 +2,7 @@ // buffered_stream_storage.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/call_stack.hpp b/3rdParty/Boost/src/boost/asio/detail/call_stack.hpp index 0096741..0d7d52c 100644 --- a/3rdParty/Boost/src/boost/asio/detail/call_stack.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/call_stack.hpp @@ -2,7 +2,7 @@ // call_stack.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/consuming_buffers.hpp b/3rdParty/Boost/src/boost/asio/detail/consuming_buffers.hpp index 0ed811d..bf04b1b 100644 --- a/3rdParty/Boost/src/boost/asio/detail/consuming_buffers.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/consuming_buffers.hpp @@ -2,7 +2,7 @@ // consuming_buffers.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -20,9 +20,9 @@ #include <boost/asio/detail/push_options.hpp> #include <algorithm> #include <cstddef> -#include <limits> #include <boost/config.hpp> #include <boost/iterator/iterator_facade.hpp> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffer.hpp> diff --git a/3rdParty/Boost/src/boost/asio/detail/deadline_timer_service.hpp b/3rdParty/Boost/src/boost/asio/detail/deadline_timer_service.hpp index 16206a7..7885c9a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/deadline_timer_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/deadline_timer_service.hpp @@ -2,7 +2,7 @@ // deadline_timer_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/descriptor_ops.hpp b/3rdParty/Boost/src/boost/asio/detail/descriptor_ops.hpp index 2ee1988..c4969f7 100644 --- a/3rdParty/Boost/src/boost/asio/detail/descriptor_ops.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/descriptor_ops.hpp @@ -2,7 +2,7 @@ // descriptor_ops.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor.hpp b/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor.hpp index 8739085..7315384 100644 --- a/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor.hpp @@ -2,7 +2,7 @@ // dev_poll_reactor.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -366,23 +366,26 @@ private: // Write the pending event registration changes to the /dev/poll descriptor. std::size_t events_size = sizeof(::pollfd) * pending_event_changes_.size(); - errno = 0; - int result = ::write(dev_poll_fd_, - &pending_event_changes_[0], events_size); - if (result != static_cast<int>(events_size)) + if (events_size > 0) { - for (std::size_t i = 0; i < pending_event_changes_.size(); ++i) + errno = 0; + int result = ::write(dev_poll_fd_, + &pending_event_changes_[0], events_size); + if (result != static_cast<int>(events_size)) { - int descriptor = pending_event_changes_[i].fd; - boost::system::error_code ec = boost::system::error_code( - errno, boost::asio::error::get_system_category()); - read_op_queue_.perform_all_operations(descriptor, ec); - write_op_queue_.perform_all_operations(descriptor, ec); - except_op_queue_.perform_all_operations(descriptor, ec); + for (std::size_t i = 0; i < pending_event_changes_.size(); ++i) + { + int descriptor = pending_event_changes_[i].fd; + boost::system::error_code ec = boost::system::error_code( + errno, boost::asio::error::get_system_category()); + read_op_queue_.perform_all_operations(descriptor, ec); + write_op_queue_.perform_all_operations(descriptor, ec); + except_op_queue_.perform_all_operations(descriptor, ec); + } } + pending_event_changes_.clear(); + pending_event_change_index_.clear(); } - pending_event_changes_.clear(); - pending_event_change_index_.clear(); int timeout = block ? get_timeout() : 0; wait_in_progress_ = true; @@ -399,9 +402,6 @@ private: lock.lock(); wait_in_progress_ = false; - // Block signals while performing operations. - boost::asio::detail::signal_blocker sb; - // Dispatch the waiting events. for (int i = 0; i < num_events; ++i) { @@ -435,7 +435,6 @@ private: more_writes = write_op_queue_.has_operation(descriptor); if ((events[i].events & (POLLERR | POLLHUP)) != 0 - && (events[i].events & ~(POLLERR | POLLHUP)) == 0 && !more_except && !more_reads && !more_writes) { // If we have an event and no operations associated with the diff --git a/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor_fwd.hpp index 3308575..d890fa8 100644 --- a/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/dev_poll_reactor_fwd.hpp @@ -2,7 +2,7 @@ // dev_poll_reactor_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/epoll_reactor.hpp b/3rdParty/Boost/src/boost/asio/detail/epoll_reactor.hpp index 2770c6a..6c6bfe3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/epoll_reactor.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/epoll_reactor.hpp @@ -2,7 +2,7 @@ // epoll_reactor.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -472,9 +472,6 @@ private: lock.lock(); wait_in_progress_ = false; - // Block signals while performing operations. - boost::asio::detail::signal_blocker sb; - // Dispatch the waiting events. for (int i = 0; i < num_events; ++i) { diff --git a/3rdParty/Boost/src/boost/asio/detail/epoll_reactor_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/epoll_reactor_fwd.hpp index 567a966..9659dd4 100644 --- a/3rdParty/Boost/src/boost/asio/detail/epoll_reactor_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/epoll_reactor_fwd.hpp @@ -2,7 +2,7 @@ // epoll_reactor_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/event.hpp b/3rdParty/Boost/src/boost/asio/detail/event.hpp index 67a0118..89f9896 100644 --- a/3rdParty/Boost/src/boost/asio/detail/event.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/event.hpp @@ -2,7 +2,7 @@ // event.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/eventfd_select_interrupter.hpp b/3rdParty/Boost/src/boost/asio/detail/eventfd_select_interrupter.hpp index cac8405..4749ec9 100644 --- a/3rdParty/Boost/src/boost/asio/detail/eventfd_select_interrupter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/eventfd_select_interrupter.hpp @@ -2,7 +2,7 @@ // eventfd_select_interrupter.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -24,14 +24,14 @@ #include <boost/system/system_error.hpp> #include <boost/asio/detail/pop_options.hpp> -#if defined(linux) +#if defined(__linux__) # if !defined(BOOST_ASIO_DISABLE_EVENTFD) # include <linux/version.h> # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) # define BOOST_ASIO_HAS_EVENTFD # endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) # endif // !defined(BOOST_ASIO_DISABLE_EVENTFD) -#endif // defined(linux) +#endif // defined(__linux__) #if defined(BOOST_ASIO_HAS_EVENTFD) @@ -108,21 +108,32 @@ public: { if (write_descriptor_ == read_descriptor_) { - // Only perform one read. The kernel maintains an atomic counter. - uint64_t counter(0); - int bytes_read = ::read(read_descriptor_, &counter, sizeof(uint64_t)); - bool was_interrupted = (bytes_read > 0); - return was_interrupted; + for (;;) + { + // Only perform one read. The kernel maintains an atomic counter. + uint64_t counter(0); + errno = 0; + int bytes_read = ::read(read_descriptor_, &counter, sizeof(uint64_t)); + if (bytes_read < 0 && errno == EINTR) + continue; + bool was_interrupted = (bytes_read > 0); + return was_interrupted; + } } else { - // Clear all data from the pipe. - char data[1024]; - int bytes_read = ::read(read_descriptor_, data, sizeof(data)); - bool was_interrupted = (bytes_read > 0); - while (bytes_read == sizeof(data)) - bytes_read = ::read(read_descriptor_, data, sizeof(data)); - return was_interrupted; + for (;;) + { + // Clear all data from the pipe. + char data[1024]; + int bytes_read = ::read(read_descriptor_, data, sizeof(data)); + if (bytes_read < 0 && errno == EINTR) + continue; + bool was_interrupted = (bytes_read > 0); + while (bytes_read == sizeof(data)) + bytes_read = ::read(read_descriptor_, data, sizeof(data)); + return was_interrupted; + } } } diff --git a/3rdParty/Boost/src/boost/asio/detail/fd_set_adapter.hpp b/3rdParty/Boost/src/boost/asio/detail/fd_set_adapter.hpp index 3fff01e..059362e 100644 --- a/3rdParty/Boost/src/boost/asio/detail/fd_set_adapter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/fd_set_adapter.hpp @@ -2,7 +2,7 @@ // fd_set_adapter.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/handler_alloc_helpers.hpp b/3rdParty/Boost/src/boost/asio/detail/handler_alloc_helpers.hpp index bfc918b..d385972 100644 --- a/3rdParty/Boost/src/boost/asio/detail/handler_alloc_helpers.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/handler_alloc_helpers.hpp @@ -2,7 +2,7 @@ // handler_alloc_helpers.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -19,6 +19,7 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/detail/workaround.hpp> +#include <boost/utility/addressof.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/handler_alloc_hook.hpp> @@ -30,24 +31,26 @@ namespace boost_asio_handler_alloc_helpers { template <typename Handler> -inline void* allocate(std::size_t s, Handler* h) +inline void* allocate(std::size_t s, Handler& h) { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ + || BOOST_WORKAROUND(__GNUC__, < 3) return ::operator new(s); #else using namespace boost::asio; - return asio_handler_allocate(s, h); + return asio_handler_allocate(s, boost::addressof(h)); #endif } template <typename Handler> -inline void deallocate(void* p, std::size_t s, Handler* h) +inline void deallocate(void* p, std::size_t s, Handler& h) { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ + || BOOST_WORKAROUND(__GNUC__, < 3) ::operator delete(p); #else using namespace boost::asio; - asio_handler_deallocate(p, s, h); + asio_handler_deallocate(p, s, boost::addressof(h)); #endif } @@ -85,7 +88,7 @@ public: raw_handler_ptr(handler_type& handler) : handler_(handler), pointer_(static_cast<pointer_type>( - boost_asio_handler_alloc_helpers::allocate(value_size, &handler_))) + boost_asio_handler_alloc_helpers::allocate(value_size, handler_))) { } @@ -95,7 +98,7 @@ public: { if (pointer_) boost_asio_handler_alloc_helpers::deallocate( - pointer_, value_size, &handler_); + pointer_, value_size, handler_); } private: @@ -239,7 +242,7 @@ public: { pointer_->value_type::~value_type(); boost_asio_handler_alloc_helpers::deallocate( - pointer_, value_size, &handler_); + pointer_, value_size, handler_); pointer_ = 0; } } diff --git a/3rdParty/Boost/src/boost/asio/detail/handler_base_from_member.hpp b/3rdParty/Boost/src/boost/asio/detail/handler_base_from_member.hpp index 4bd95ed..4e471e3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/handler_base_from_member.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/handler_base_from_member.hpp @@ -2,7 +2,7 @@ // handler_base_from_member.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -50,7 +50,7 @@ inline void* asio_handler_allocate(std::size_t size, handler_base_from_member<Handler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Handler> @@ -58,7 +58,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, handler_base_from_member<Handler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Handler> @@ -66,7 +66,7 @@ inline void asio_handler_invoke(const Function& function, handler_base_from_member<Handler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail diff --git a/3rdParty/Boost/src/boost/asio/detail/handler_invoke_helpers.hpp b/3rdParty/Boost/src/boost/asio/detail/handler_invoke_helpers.hpp index 4da384a..8952d8d 100644 --- a/3rdParty/Boost/src/boost/asio/detail/handler_invoke_helpers.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/handler_invoke_helpers.hpp @@ -2,7 +2,7 @@ // handler_invoke_helpers.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -19,6 +19,7 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/detail/workaround.hpp> +#include <boost/utility/addressof.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/handler_invoke_hook.hpp> @@ -29,14 +30,15 @@ namespace boost_asio_handler_invoke_helpers { template <typename Function, typename Context> -inline void invoke(const Function& function, Context* context) +inline void invoke(const Function& function, Context& context) { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ + || BOOST_WORKAROUND(__GNUC__, < 3) Function tmp(function); tmp(); #else using namespace boost::asio; - asio_handler_invoke(function, context); + asio_handler_invoke(function, boost::addressof(context)); #endif } diff --git a/3rdParty/Boost/src/boost/asio/detail/handler_queue.hpp b/3rdParty/Boost/src/boost/asio/detail/handler_queue.hpp index ccc1b0c..c1fb988 100644 --- a/3rdParty/Boost/src/boost/asio/detail/handler_queue.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/handler_queue.hpp @@ -2,7 +2,7 @@ // handler_queue.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -189,7 +189,7 @@ private: ptr.reset(); // Make the upcall. - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } static void do_destroy(handler* base) diff --git a/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp b/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp index 923ae57..c620da7 100644 --- a/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp @@ -2,7 +2,7 @@ // hash_map.hpp // ~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -215,6 +215,9 @@ private: // Re-initialise the hash from the values already contained in the list. void rehash(std::size_t num_buckets) { + if (num_buckets == buckets_.size()) + return; + iterator end = values_.end(); // Update number of buckets and initialise all buckets to empty. @@ -231,9 +234,13 @@ private: { buckets_[bucket].first = buckets_[bucket].last = iter++; } + else if (++buckets_[bucket].last == iter) + { + ++iter; + } else { - values_.splice(++buckets_[bucket].last, values_, iter++); + values_.splice(buckets_[bucket].last, values_, iter++); --buckets_[bucket].last; } } @@ -275,6 +282,8 @@ private: // The type for a bucket in the hash table. struct bucket_type { + bucket_type() {} + bucket_type(const bucket_type&) { /* noop */ } iterator first; iterator last; }; diff --git a/3rdParty/Boost/src/boost/asio/detail/indirect_handler_queue.hpp b/3rdParty/Boost/src/boost/asio/detail/indirect_handler_queue.hpp index 2775078..72b1030 100644 --- a/3rdParty/Boost/src/boost/asio/detail/indirect_handler_queue.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/indirect_handler_queue.hpp @@ -2,7 +2,7 @@ // indirect_handler_queue.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -236,7 +236,7 @@ private: ptr.reset(); // Make the upcall. - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } static void do_destroy(handler* base) diff --git a/3rdParty/Boost/src/boost/asio/detail/io_control.hpp b/3rdParty/Boost/src/boost/asio/detail/io_control.hpp index 6730dc3..5021c2e 100644 --- a/3rdParty/Boost/src/boost/asio/detail/io_control.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/io_control.hpp @@ -2,7 +2,7 @@ // io_control.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor.hpp b/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor.hpp index 179b7d4..ea8e285 100644 --- a/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor.hpp @@ -2,7 +2,7 @@ // kqueue_reactor.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -442,9 +442,6 @@ private: lock.lock(); wait_in_progress_ = false; - // Block signals while performing operations. - boost::asio::detail::signal_blocker sb; - // Dispatch the waiting events. for (int i = 0; i < num_events; ++i) { diff --git a/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor_fwd.hpp index e3df284..b2751bf 100644 --- a/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/kqueue_reactor_fwd.hpp @@ -2,7 +2,7 @@ // kqueue_reactor_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -19,9 +19,11 @@ #include <boost/asio/detail/push_options.hpp> #if !defined(BOOST_ASIO_DISABLE_KQUEUE) -#if defined(__MACH__) && defined(__APPLE__) -// Define this to indicate that epoll is supported on the target platform. +#if (defined(__MACH__) && defined(__APPLE__)) \ + || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) + +// Define this to indicate that kqueue is supported on the target platform. #define BOOST_ASIO_HAS_KQUEUE 1 namespace boost { @@ -35,7 +37,9 @@ class kqueue_reactor; } // namespace asio } // namespace boost -#endif // defined(__MACH__) && defined(__APPLE__) +#endif // (defined(__MACH__) && defined(__APPLE__)) + // || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) + #endif // !defined(BOOST_ASIO_DISABLE_KQUEUE) #include <boost/asio/detail/pop_options.hpp> diff --git a/3rdParty/Boost/src/boost/asio/detail/mutex.hpp b/3rdParty/Boost/src/boost/asio/detail/mutex.hpp index 4f64a28..fc7ed83 100644 --- a/3rdParty/Boost/src/boost/asio/detail/mutex.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/mutex.hpp @@ -2,7 +2,7 @@ // mutex.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/noncopyable.hpp b/3rdParty/Boost/src/boost/asio/detail/noncopyable.hpp index 3a09538..b3a6e7c 100644 --- a/3rdParty/Boost/src/boost/asio/detail/noncopyable.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/noncopyable.hpp @@ -2,7 +2,7 @@ // noncopyable.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/null_event.hpp b/3rdParty/Boost/src/boost/asio/detail/null_event.hpp index 4b667e7..184f753 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_event.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_event.hpp @@ -2,7 +2,7 @@ // null_event.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/null_mutex.hpp b/3rdParty/Boost/src/boost/asio/detail/null_mutex.hpp index 64bf871..bdf5617 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_mutex.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_mutex.hpp @@ -2,7 +2,7 @@ // null_mutex.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/null_signal_blocker.hpp b/3rdParty/Boost/src/boost/asio/detail/null_signal_blocker.hpp index 1fc65c8..7fe5c10 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_signal_blocker.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_signal_blocker.hpp @@ -2,7 +2,7 @@ // null_signal_blocker.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/null_thread.hpp b/3rdParty/Boost/src/boost/asio/detail/null_thread.hpp index 5aed211..0a508f3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_thread.hpp @@ -2,7 +2,7 @@ // null_thread.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/null_tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/null_tss_ptr.hpp index ba4b8f8..7c35b15 100644 --- a/3rdParty/Boost/src/boost/asio/detail/null_tss_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/null_tss_ptr.hpp @@ -2,7 +2,7 @@ // null_tss_ptr.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/old_win_sdk_compat.hpp b/3rdParty/Boost/src/boost/asio/detail/old_win_sdk_compat.hpp index 5f0aba1..5f84182 100644 --- a/3rdParty/Boost/src/boost/asio/detail/old_win_sdk_compat.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/old_win_sdk_compat.hpp @@ -2,7 +2,7 @@ // old_win_sdk_compat.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp b/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp index 51b8c02..7f9e122 100644 --- a/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/pipe_select_interrupter.hpp @@ -2,7 +2,7 @@ // pipe_select_interrupter.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -79,12 +79,17 @@ public: // Reset the select interrupt. Returns true if the call was interrupted. bool reset() { - char data[1024]; - int bytes_read = ::read(read_descriptor_, data, sizeof(data)); - bool was_interrupted = (bytes_read > 0); - while (bytes_read == sizeof(data)) - bytes_read = ::read(read_descriptor_, data, sizeof(data)); - return was_interrupted; + for (;;) + { + char data[1024]; + int bytes_read = ::read(read_descriptor_, data, sizeof(data)); + if (bytes_read < 0 && errno == EINTR) + continue; + bool was_interrupted = (bytes_read > 0); + while (bytes_read == sizeof(data)) + bytes_read = ::read(read_descriptor_, data, sizeof(data)); + return was_interrupted; + } } // Get the read descriptor to be passed to select. diff --git a/3rdParty/Boost/src/boost/asio/detail/pop_options.hpp b/3rdParty/Boost/src/boost/asio/detail/pop_options.hpp index 7f56662..a26b203 100644 --- a/3rdParty/Boost/src/boost/asio/detail/pop_options.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/pop_options.hpp @@ -2,7 +2,7 @@ // pop_options.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/posix_event.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_event.hpp index f838342..20c0fe3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_event.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_event.hpp @@ -2,7 +2,7 @@ // posix_event.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/posix_fd_set_adapter.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_fd_set_adapter.hpp index 121b396..09fc28d 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_fd_set_adapter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_fd_set_adapter.hpp @@ -2,7 +2,7 @@ // posix_fd_set_adapter.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/posix_mutex.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_mutex.hpp index 219d6d0..e7209c1 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_mutex.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_mutex.hpp @@ -2,7 +2,7 @@ // posix_mutex.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/posix_signal_blocker.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_signal_blocker.hpp index f8234fb..aebe39b 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_signal_blocker.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_signal_blocker.hpp @@ -2,7 +2,7 @@ // posix_signal_blocker.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/posix_thread.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_thread.hpp index 1e38618..41d8bc9 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_thread.hpp @@ -2,7 +2,7 @@ // posix_thread.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -37,7 +37,7 @@ namespace boost { namespace asio { namespace detail { -extern "C" void* asio_detail_posix_thread_function(void* arg); +extern "C" void* boost_asio_detail_posix_thread_function(void* arg); class posix_thread : private noncopyable @@ -50,7 +50,7 @@ public: { std::auto_ptr<func_base> arg(new func<Function>(f)); int error = ::pthread_create(&thread_, 0, - asio_detail_posix_thread_function, arg.get()); + boost_asio_detail_posix_thread_function, arg.get()); if (error != 0) { boost::system::system_error e( @@ -80,7 +80,7 @@ public: } private: - friend void* asio_detail_posix_thread_function(void* arg); + friend void* boost_asio_detail_posix_thread_function(void* arg); class func_base { @@ -112,7 +112,7 @@ private: bool joined_; }; -inline void* asio_detail_posix_thread_function(void* arg) +inline void* boost_asio_detail_posix_thread_function(void* arg) { std::auto_ptr<posix_thread::func_base> f( static_cast<posix_thread::func_base*>(arg)); diff --git a/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp index f53c2dc..c83df96 100644 --- a/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/posix_tss_ptr.hpp @@ -2,7 +2,7 @@ // posix_tss_ptr.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/push_options.hpp b/3rdParty/Boost/src/boost/asio/detail/push_options.hpp index 47524b2..cb0e902 100644 --- a/3rdParty/Boost/src/boost/asio/detail/push_options.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/push_options.hpp @@ -2,7 +2,7 @@ // push_options.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp b/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp index ad828aa..61f676b 100644 --- a/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/reactive_descriptor_service.hpp @@ -2,7 +2,7 @@ // reactive_descriptor_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -348,16 +348,23 @@ public: boost::asio::buffer_size(buffer)); } - // Write the data. - int bytes = descriptor_ops::gather_write(descriptor_, bufs, i, ec); + for (;;) + { + // Write the data. + int bytes = descriptor_ops::gather_write(descriptor_, bufs, i, ec); - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -600,18 +607,25 @@ public: boost::asio::buffer_size(buffer)); } - // Read some data. - int bytes = descriptor_ops::scatter_read(descriptor_, bufs, i, ec); - if (bytes == 0) - ec = boost::asio::error::eof; + for (;;) + { + // Read some data. + int bytes = descriptor_ops::scatter_read(descriptor_, bufs, i, ec); + if (bytes == 0) + ec = boost::asio::error::eof; - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, diff --git a/3rdParty/Boost/src/boost/asio/detail/reactive_serial_port_service.hpp b/3rdParty/Boost/src/boost/asio/detail/reactive_serial_port_service.hpp index 0beff14..cd163e9 100644 --- a/3rdParty/Boost/src/boost/asio/detail/reactive_serial_port_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/reactive_serial_port_service.hpp @@ -2,7 +2,7 @@ // reactive_serial_port_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/detail/reactive_socket_service.hpp b/3rdParty/Boost/src/boost/asio/detail/reactive_socket_service.hpp index 54b8cbd..95d39dd 100644 --- a/3rdParty/Boost/src/boost/asio/detail/reactive_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/reactive_socket_service.hpp @@ -2,7 +2,7 @@ // reactive_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -275,12 +275,21 @@ public: return false; } +#if defined(SIOCATMARK) boost::asio::detail::ioctl_arg_type value = 0; socket_ops::ioctl(impl.socket_, SIOCATMARK, &value, ec); -#if defined(ENOTTY) +# if defined(ENOTTY) if (ec.value() == ENOTTY) ec = boost::asio::error::not_socket; -#endif // defined(ENOTTY) +# endif // defined(ENOTTY) +#else // defined(SIOCATMARK) + int value = sockatmark(impl.socket_); + if (value == -1) + ec = boost::system::error_code(errno, + boost::asio::error::get_system_category()); + else + ec = boost::system::error_code(); +#endif // defined(SIOCATMARK) return ec ? false : value != 0; } @@ -644,16 +653,23 @@ public: boost::asio::buffer_size(buffer)); } - // Send the data. - int bytes = socket_ops::send(socket_, bufs, i, flags_, ec); + for (;;) + { + // Send the data. + int bytes = socket_ops::send(socket_, bufs, i, flags_, ec); - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -881,17 +897,24 @@ public: boost::asio::buffer_size(buffer)); } - // Send the data. - int bytes = socket_ops::sendto(socket_, bufs, i, flags_, - destination_.data(), destination_.size(), ec); + for (;;) + { + // Send the data. + int bytes = socket_ops::sendto(socket_, bufs, i, flags_, + destination_.data(), destination_.size(), ec); - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -1086,18 +1109,25 @@ public: boost::asio::buffer_size(buffer)); } - // Receive some data. - int bytes = socket_ops::recv(socket_, bufs, i, flags_, ec); - if (bytes == 0 && protocol_type_ == SOCK_STREAM) - ec = boost::asio::error::eof; + for (;;) + { + // Receive some data. + int bytes = socket_ops::recv(socket_, bufs, i, flags_, ec); + if (bytes == 0 && protocol_type_ == SOCK_STREAM) + ec = boost::asio::error::eof; - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -1331,21 +1361,28 @@ public: boost::asio::buffer_size(buffer)); } - // Receive some data. - std::size_t addr_len = sender_endpoint_.capacity(); - int bytes = socket_ops::recvfrom(socket_, bufs, i, flags_, - sender_endpoint_.data(), &addr_len, ec); - if (bytes == 0 && protocol_type_ == SOCK_STREAM) - ec = boost::asio::error::eof; - - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; - - sender_endpoint_.resize(addr_len); - bytes_transferred = (bytes < 0 ? 0 : bytes); - return true; + for (;;) + { + // Receive some data. + std::size_t addr_len = sender_endpoint_.capacity(); + int bytes = socket_ops::recvfrom(socket_, bufs, i, flags_, + sender_endpoint_.data(), &addr_len, ec); + if (bytes == 0 && protocol_type_ == SOCK_STREAM) + ec = boost::asio::error::eof; + + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + + sender_endpoint_.resize(addr_len); + bytes_transferred = (bytes < 0 ? 0 : bytes); + return true; + } } void complete(const boost::system::error_code& ec, @@ -1454,7 +1491,6 @@ public: for (;;) { // Try to complete the operation without blocking. - boost::system::error_code ec; socket_holder new_socket; std::size_t addr_len = 0; if (peer_endpoint) @@ -1536,43 +1572,50 @@ public: if (ec) return true; - // Accept the waiting connection. - socket_holder new_socket; - std::size_t addr_len = 0; - if (peer_endpoint_) + for (;;) { - addr_len = peer_endpoint_->capacity(); - new_socket.reset(socket_ops::accept(socket_, - peer_endpoint_->data(), &addr_len, ec)); - } - else - { - new_socket.reset(socket_ops::accept(socket_, 0, 0, ec)); - } + // Accept the waiting connection. + socket_holder new_socket; + std::size_t addr_len = 0; + if (peer_endpoint_) + { + addr_len = peer_endpoint_->capacity(); + new_socket.reset(socket_ops::accept(socket_, + peer_endpoint_->data(), &addr_len, ec)); + } + else + { + new_socket.reset(socket_ops::accept(socket_, 0, 0, ec)); + } - // Check if we need to run the operation again. - if (ec == boost::asio::error::would_block - || ec == boost::asio::error::try_again) - return false; - if (ec == boost::asio::error::connection_aborted - && !enable_connection_aborted_) - return false; + // Retry operation if interrupted by signal. + if (ec == boost::asio::error::interrupted) + continue; + + // Check if we need to run the operation again. + if (ec == boost::asio::error::would_block + || ec == boost::asio::error::try_again) + return false; + if (ec == boost::asio::error::connection_aborted + && !enable_connection_aborted_) + return false; #if defined(EPROTO) - if (ec.value() == EPROTO && !enable_connection_aborted_) - return false; + if (ec.value() == EPROTO && !enable_connection_aborted_) + return false; #endif // defined(EPROTO) - // Transfer ownership of the new socket to the peer object. - if (!ec) - { - if (peer_endpoint_) - peer_endpoint_->resize(addr_len); - peer_.assign(protocol_, new_socket.get(), ec); + // Transfer ownership of the new socket to the peer object. if (!ec) - new_socket.release(); - } + { + if (peer_endpoint_) + peer_endpoint_->resize(addr_len); + peer_.assign(protocol_, new_socket.get(), ec); + if (!ec) + new_socket.release(); + } - return true; + return true; + } } void complete(const boost::system::error_code& ec, std::size_t) diff --git a/3rdParty/Boost/src/boost/asio/detail/reactor_op_queue.hpp b/3rdParty/Boost/src/boost/asio/detail/reactor_op_queue.hpp index 0fbbf23..46f0c10 100644 --- a/3rdParty/Boost/src/boost/asio/detail/reactor_op_queue.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/reactor_op_queue.hpp @@ -2,7 +2,7 @@ // reactor_op_queue.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/resolver_service.hpp b/3rdParty/Boost/src/boost/asio/detail/resolver_service.hpp index 9b0aac9..3270cd6 100644 --- a/3rdParty/Boost/src/boost/asio/detail/resolver_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/resolver_service.hpp @@ -2,7 +2,7 @@ // resolver_service.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp b/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp index 1dd2842..c319263 100644 --- a/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp @@ -2,7 +2,7 @@ // scoped_lock.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/select_interrupter.hpp b/3rdParty/Boost/src/boost/asio/detail/select_interrupter.hpp index 8bb952c..f844881 100644 --- a/3rdParty/Boost/src/boost/asio/detail/select_interrupter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/select_interrupter.hpp @@ -2,7 +2,7 @@ // select_interrupter.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -21,9 +21,12 @@ #include <boost/config.hpp> #include <boost/asio/detail/pop_options.hpp> -#include <boost/asio/detail/eventfd_select_interrupter.hpp> -#include <boost/asio/detail/pipe_select_interrupter.hpp> -#include <boost/asio/detail/socket_select_interrupter.hpp> +#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) +# include <boost/asio/detail/socket_select_interrupter.hpp> +#else +# include <boost/asio/detail/eventfd_select_interrupter.hpp> +# include <boost/asio/detail/pipe_select_interrupter.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/detail/select_reactor.hpp b/3rdParty/Boost/src/boost/asio/detail/select_reactor.hpp index 77caf54..ba8b5d3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/select_reactor.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/select_reactor.hpp @@ -2,7 +2,7 @@ // select_reactor.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -369,9 +369,6 @@ private: lock.lock(); select_in_progress_ = false; - // Block signals while dispatching operations. - boost::asio::detail::signal_blocker sb; - // Reset the interrupter. if (retval > 0 && read_fds.is_set(interrupter_.read_descriptor())) interrupter_.reset(); diff --git a/3rdParty/Boost/src/boost/asio/detail/select_reactor_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/select_reactor_fwd.hpp index 3bd5d86..b48e0f0 100644 --- a/3rdParty/Boost/src/boost/asio/detail/select_reactor_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/select_reactor_fwd.hpp @@ -2,7 +2,7 @@ // select_reactor_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/service_base.hpp b/3rdParty/Boost/src/boost/asio/detail/service_base.hpp index f01cdaf..66c2af3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/service_base.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/service_base.hpp @@ -2,7 +2,7 @@ // service_base.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/service_id.hpp b/3rdParty/Boost/src/boost/asio/detail/service_id.hpp index f249ddf..ac0f4d1 100644 --- a/3rdParty/Boost/src/boost/asio/detail/service_id.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/service_id.hpp @@ -2,7 +2,7 @@ // service_id.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp b/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp index 6b25663..b648939 100644 --- a/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/service_registry.hpp @@ -2,7 +2,7 @@ // service_registry.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/service_registry_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/service_registry_fwd.hpp index e32647b..4031b1a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/service_registry_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/service_registry_fwd.hpp @@ -2,7 +2,7 @@ // service_registry_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/signal_blocker.hpp b/3rdParty/Boost/src/boost/asio/detail/signal_blocker.hpp index a770549..db11fe4 100644 --- a/3rdParty/Boost/src/boost/asio/detail/signal_blocker.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/signal_blocker.hpp @@ -2,7 +2,7 @@ // signal_blocker.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/signal_init.hpp b/3rdParty/Boost/src/boost/asio/detail/signal_init.hpp index e5a3d37..50e06b8 100644 --- a/3rdParty/Boost/src/boost/asio/detail/signal_init.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/signal_init.hpp @@ -2,7 +2,7 @@ // signal_init.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/socket_holder.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_holder.hpp index be144a6..5d6012b 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_holder.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_holder.hpp @@ -2,7 +2,7 @@ // socket_holder.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/socket_ops.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_ops.hpp index 4969017..475162a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_ops.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_ops.hpp @@ -2,7 +2,7 @@ // socket_ops.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -1388,8 +1388,9 @@ inline int gai_echeck(const char* host, const char* service, break; case AF_INET: case AF_INET6: - if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM) - return EAI_SOCKTYPE; + if (service != 0 && service[0] != '\0') + if (socktype != 0 && socktype != SOCK_STREAM && socktype != SOCK_DGRAM) + return EAI_SOCKTYPE; break; default: return EAI_FAMILY; diff --git a/3rdParty/Boost/src/boost/asio/detail/socket_option.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_option.hpp index c0d7b74..e31aae4 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_option.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_option.hpp @@ -2,7 +2,7 @@ // socket_option.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -21,6 +21,7 @@ #include <cstddef> #include <stdexcept> #include <boost/config.hpp> +#include <boost/throw_exception.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/detail/socket_types.hpp> @@ -122,7 +123,10 @@ public: case sizeof(value_): break; default: - throw std::length_error("boolean socket option resize"); + { + std::length_error ex("boolean socket option resize"); + boost::throw_exception(ex); + } } } @@ -200,7 +204,10 @@ public: void resize(const Protocol&, std::size_t s) { if (s != sizeof(value_)) - throw std::length_error("integer socket option resize"); + { + std::length_error ex("integer socket option resize"); + boost::throw_exception(ex); + } } private: @@ -294,7 +301,10 @@ public: void resize(const Protocol&, std::size_t s) { if (s != sizeof(value_)) - throw std::length_error("linger socket option resize"); + { + std::length_error ex("linger socket option resize"); + boost::throw_exception(ex); + } } private: diff --git a/3rdParty/Boost/src/boost/asio/detail/socket_select_interrupter.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_select_interrupter.hpp index a767ba0..a538ae5 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_select_interrupter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_select_interrupter.hpp @@ -2,7 +2,7 @@ // socket_select_interrupter.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -72,6 +72,11 @@ public: boost::throw_exception(e); } + // Some broken firewalls on Windows will intermittently cause getsockname to + // return 0.0.0.0 when the socket is actually bound to 127.0.0.1. We + // explicitly specify the target address here to work around this problem. + addr.sin_addr.s_addr = inet_addr("127.0.0.1"); + if (socket_ops::listen(acceptor.get(), SOMAXCONN, ec) == socket_error_retval) { diff --git a/3rdParty/Boost/src/boost/asio/detail/socket_types.hpp b/3rdParty/Boost/src/boost/asio/detail/socket_types.hpp index c7b6a75..7395ee4 100644 --- a/3rdParty/Boost/src/boost/asio/detail/socket_types.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/socket_types.hpp @@ -2,7 +2,7 @@ // socket_types.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -163,7 +163,11 @@ typedef int socket_type; const int invalid_socket = -1; const int socket_error_retval = -1; const int max_addr_v4_str_len = INET_ADDRSTRLEN; +#if defined(INET6_ADDRSTRLEN) const int max_addr_v6_str_len = INET6_ADDRSTRLEN + 1 + IF_NAMESIZE; +#else // defined(INET6_ADDRSTRLEN) +const int max_addr_v6_str_len = 256; +#endif // defined(INET6_ADDRSTRLEN) typedef sockaddr socket_addr_type; typedef in_addr in4_addr_type; # if defined(__hpux) diff --git a/3rdParty/Boost/src/boost/asio/detail/strand_service.hpp b/3rdParty/Boost/src/boost/asio/detail/strand_service.hpp index 2c89a61..b228cec 100644 --- a/3rdParty/Boost/src/boost/asio/detail/strand_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/strand_service.hpp @@ -2,7 +2,7 @@ // strand_service.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -20,8 +20,8 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/aligned_storage.hpp> #include <boost/assert.hpp> -#include <boost/detail/atomic_count.hpp> -#include <boost/intrusive_ptr.hpp> +#include <boost/functional/hash.hpp> +#include <boost/scoped_ptr.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/io_service.hpp> @@ -49,20 +49,12 @@ public: // The underlying implementation of a strand. class strand_impl { -#if defined (__BORLANDC__) public: -#else - private: -#endif - void add_ref() - { - ++ref_count_; - } - - void release() + strand_impl() + : current_handler_(0), + first_waiter_(0), + last_waiter_(0) { - if (--ref_count_ == 0) - delete this; } private: @@ -71,55 +63,9 @@ public: friend class post_next_waiter_on_exit; friend class invoke_current_handler; - strand_impl(strand_service& owner) - : owner_(owner), - current_handler_(0), - first_waiter_(0), - last_waiter_(0), - ref_count_(0) - { - // Insert implementation into linked list of all implementations. - boost::asio::detail::mutex::scoped_lock lock(owner_.mutex_); - next_ = owner_.impl_list_; - prev_ = 0; - if (owner_.impl_list_) - owner_.impl_list_->prev_ = this; - owner_.impl_list_ = this; - } - - ~strand_impl() - { - // Remove implementation from linked list of all implementations. - boost::asio::detail::mutex::scoped_lock lock(owner_.mutex_); - if (owner_.impl_list_ == this) - owner_.impl_list_ = next_; - if (prev_) - prev_->next_ = next_; - if (next_) - next_->prev_= prev_; - next_ = 0; - prev_ = 0; - lock.unlock(); - - if (current_handler_) - { - current_handler_->destroy(); - } - - while (first_waiter_) - { - handler_base* next = first_waiter_->next_; - first_waiter_->destroy(); - first_waiter_ = next; - } - } - // Mutex to protect access to internal data. boost::asio::detail::mutex mutex_; - // The service that owns this implementation. - strand_service& owner_; - // The handler that is ready to execute. If this pointer is non-null then it // indicates that a handler holds the lock. handler_base* current_handler_; @@ -137,30 +83,11 @@ public: #else handler_storage_type handler_storage_; #endif - - // Pointers to adjacent socket implementations in linked list. - strand_impl* next_; - strand_impl* prev_; - - // The reference count on the strand implementation. - boost::detail::atomic_count ref_count_; - -#if !defined(__BORLANDC__) - friend void intrusive_ptr_add_ref(strand_impl* p) - { - p->add_ref(); - } - - friend void intrusive_ptr_release(strand_impl* p) - { - p->release(); - } -#endif }; friend class strand_impl; - typedef boost::intrusive_ptr<strand_impl> implementation_type; + typedef strand_impl* implementation_type; // Base class for all handler types. class handler_base @@ -328,10 +255,10 @@ public: ptr.reset(); // Indicate that this strand is executing on the current thread. - call_stack<strand_impl>::context ctx(impl.get()); + call_stack<strand_impl>::context ctx(impl); // Make the upcall. - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } static void do_destroy(handler_base* base) @@ -361,7 +288,7 @@ public: explicit strand_service(boost::asio::io_service& io_service) : boost::asio::detail::service_base<strand_service>(io_service), mutex_(), - impl_list_(0) + salt_(0) { } @@ -370,24 +297,25 @@ public: { // Construct a list of all handlers to be destroyed. boost::asio::detail::mutex::scoped_lock lock(mutex_); - strand_impl* impl = impl_list_; handler_base* first_handler = 0; - while (impl) + for (std::size_t i = 0; i < num_implementations; ++i) { - if (impl->current_handler_) + if (strand_impl* impl = implementations_[i].get()) { - impl->current_handler_->next_ = first_handler; - first_handler = impl->current_handler_; - impl->current_handler_ = 0; - } - if (impl->first_waiter_) - { - impl->last_waiter_->next_ = first_handler; - first_handler = impl->first_waiter_; - impl->first_waiter_ = 0; - impl->last_waiter_ = 0; + if (impl->current_handler_) + { + impl->current_handler_->next_ = first_handler; + first_handler = impl->current_handler_; + impl->current_handler_ = 0; + } + if (impl->first_waiter_) + { + impl->last_waiter_->next_ = first_handler; + first_handler = impl->first_waiter_; + impl->first_waiter_ = 0; + impl->last_waiter_ = 0; + } } - impl = impl->next_; } // Destroy all handlers without holding the lock. @@ -403,22 +331,30 @@ public: // Construct a new strand implementation. void construct(implementation_type& impl) { - impl = implementation_type(new strand_impl(*this)); + std::size_t index = boost::hash_value(&impl); + boost::hash_combine(index, salt_++); + index = index % num_implementations; + + boost::asio::detail::mutex::scoped_lock lock(mutex_); + + if (!implementations_[index]) + implementations_[index].reset(new strand_impl); + impl = implementations_[index].get(); } // Destroy a strand implementation. void destroy(implementation_type& impl) { - implementation_type().swap(impl); + impl = 0; } // Request the io_service to invoke the given handler. template <typename Handler> void dispatch(implementation_type& impl, Handler handler) { - if (call_stack<strand_impl>::contains(impl.get())) + if (call_stack<strand_impl>::contains(impl)) { - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } else { @@ -496,37 +432,24 @@ public: } private: - // Mutex to protect access to the linked list of implementations. + // Mutex to protect access to the array of implementations. boost::asio::detail::mutex mutex_; + // Number of implementations shared between all strand objects. + enum { num_implementations = 193 }; + // The head of a linked list of all implementations. - strand_impl* impl_list_; + boost::scoped_ptr<strand_impl> implementations_[num_implementations]; + + // Extra value used when hashing to prevent recycled memory locations from + // getting the same strand implementation. + std::size_t salt_; }; } // namespace detail } // namespace asio } // namespace boost -#if defined(__BORLANDC__) - -namespace boost { - -inline void intrusive_ptr_add_ref( - boost::asio::detail::strand_service::strand_impl* p) -{ - p->add_ref(); -} - -inline void intrusive_ptr_release( - boost::asio::detail::strand_service::strand_impl* p) -{ - p->release(); -} - -} // namespace boost - -#endif // defined(__BORLANDC__) - #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_DETAIL_STRAND_SERVICE_HPP diff --git a/3rdParty/Boost/src/boost/asio/detail/task_io_service.hpp b/3rdParty/Boost/src/boost/asio/detail/task_io_service.hpp index eeae6b0..ddfea72 100644 --- a/3rdParty/Boost/src/boost/asio/detail/task_io_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/task_io_service.hpp @@ -2,7 +2,7 @@ // task_io_service.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -177,7 +177,7 @@ public: void dispatch(Handler handler) { if (call_stack<task_io_service>::contains(this)) - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); else post(handler); } diff --git a/3rdParty/Boost/src/boost/asio/detail/task_io_service_2lock.hpp b/3rdParty/Boost/src/boost/asio/detail/task_io_service_2lock.hpp index bd406cb..71bceef 100644 --- a/3rdParty/Boost/src/boost/asio/detail/task_io_service_2lock.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/task_io_service_2lock.hpp @@ -2,7 +2,7 @@ // task_io_service_2lock.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -50,7 +50,7 @@ public: : boost::asio::detail::service_base<task_io_service<Task> >(io_service), front_mutex_(), back_mutex_(), - task_(&use_service<Task>(io_service)), + task_(0), outstanding_work_(0), front_stopped_(false), back_stopped_(false), @@ -207,7 +207,7 @@ public: void dispatch(Handler handler) { if (call_stack<task_io_service>::contains(this)) - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); else post(handler); } diff --git a/3rdParty/Boost/src/boost/asio/detail/task_io_service_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/task_io_service_fwd.hpp index 6dc8955..60a0790 100644 --- a/3rdParty/Boost/src/boost/asio/detail/task_io_service_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/task_io_service_fwd.hpp @@ -2,7 +2,7 @@ // task_io_service_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/thread.hpp b/3rdParty/Boost/src/boost/asio/detail/thread.hpp index 3db5805..24a7a8c 100644 --- a/3rdParty/Boost/src/boost/asio/detail/thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/thread.hpp @@ -2,7 +2,7 @@ // thread.hpp // ~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/throw_error.hpp b/3rdParty/Boost/src/boost/asio/detail/throw_error.hpp index 0786c40..e9406a7 100644 --- a/3rdParty/Boost/src/boost/asio/detail/throw_error.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/throw_error.hpp @@ -2,7 +2,7 @@ // throw_error.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/timer_queue.hpp b/3rdParty/Boost/src/boost/asio/detail/timer_queue.hpp index f5370e5..35c8a77 100644 --- a/3rdParty/Boost/src/boost/asio/detail/timer_queue.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/timer_queue.hpp @@ -2,7 +2,7 @@ // timer_queue.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -20,10 +20,10 @@ #include <boost/asio/detail/push_options.hpp> #include <cstddef> #include <functional> -#include <limits> #include <memory> #include <vector> #include <boost/config.hpp> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/error.hpp> @@ -67,8 +67,10 @@ public: heap_.reserve(heap_.size() + 1); // Create a new timer object. - std::auto_ptr<timer<Handler> > new_timer( - new timer<Handler>(time, handler, token)); + typedef timer<Handler> timer_type; + typedef handler_alloc_traits<Handler, timer_type> alloc_traits; + raw_handler_ptr<alloc_traits> raw_ptr(handler); + handler_ptr<alloc_traits> new_timer(raw_ptr, time, handler, token); // Insert the new timer into the hash. typedef typename hash_map<void*, timer_base*>::iterator iterator; @@ -78,12 +80,12 @@ public: if (!result.second) { result.first->second->prev_ = new_timer.get(); - new_timer->next_ = result.first->second; + new_timer.get()->next_ = result.first->second; result.first->second = new_timer.get(); } // Put the timer at the correct position in the heap. - new_timer->heap_index_ = heap_.size(); + new_timer.get()->heap_index_ = heap_.size(); heap_.push_back(new_timer.get()); up_heap(heap_.size() - 1); bool is_first = (heap_[0] == new_timer.get()); diff --git a/3rdParty/Boost/src/boost/asio/detail/timer_queue_base.hpp b/3rdParty/Boost/src/boost/asio/detail/timer_queue_base.hpp index 1d986c0..cd6a0d3 100644 --- a/3rdParty/Boost/src/boost/asio/detail/timer_queue_base.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/timer_queue_base.hpp @@ -2,7 +2,7 @@ // timer_queue_base.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/tss_ptr.hpp index 2cfd641..9af4965 100644 --- a/3rdParty/Boost/src/boost/asio/detail/tss_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/tss_ptr.hpp @@ -2,7 +2,7 @@ // tss_ptr.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_event.hpp b/3rdParty/Boost/src/boost/asio/detail/win_event.hpp index d0a135e..637b580 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_event.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_event.hpp @@ -2,7 +2,7 @@ // win_event.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_fd_set_adapter.hpp b/3rdParty/Boost/src/boost/asio/detail/win_fd_set_adapter.hpp index 9127a41..11c1e15 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_fd_set_adapter.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_fd_set_adapter.hpp @@ -2,7 +2,7 @@ // win_fd_set_adapter.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_handle_service.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_handle_service.hpp index fd204de..6998d57 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_handle_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_handle_service.hpp @@ -2,7 +2,7 @@ // win_iocp_handle_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -357,6 +357,7 @@ public: DWORD last_error = ::GetLastError(); ec = boost::system::error_code(last_error, boost::asio::error::get_system_category()); + return 0; } ec = boost::system::error_code(); @@ -414,7 +415,7 @@ public: boost::system::error_code ec(last_error, boost::asio::error::get_system_category()); boost_asio_handler_invoke_helpers::invoke( - bind_handler(handler, ec, bytes_transferred), &handler); + bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -456,13 +457,6 @@ public: void async_write_some_at(implementation_type& impl, boost::uint64_t offset, const ConstBufferSequence& buffers, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) impl.safe_cancellation_thread_id_ = ::GetCurrentThreadId(); @@ -475,6 +469,13 @@ public: raw_handler_ptr<alloc_traits> raw_ptr(handler); handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Find first buffer of non-zero length. boost::asio::const_buffer buffer; typename ConstBufferSequence::const_iterator iter = buffers.begin(); @@ -489,10 +490,8 @@ public: // A request to write 0 bytes on a handle is a no-op. if (boost::asio::buffer_size(buffer) == 0) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code error; - iocp_service_.post(bind_handler(handler, error, 0)); + ptr.get()->on_immediate_completion(0, 0); + ptr.release(); return; } @@ -509,14 +508,12 @@ public: // Check if the operation completed immediately. if (!ok && last_error != ERROR_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -604,6 +601,7 @@ public: ec = boost::system::error_code(last_error, boost::asio::error::get_system_category()); } + return 0; } ec = boost::system::error_code(); @@ -669,7 +667,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - bind_handler(handler, ec, bytes_transferred), &handler); + bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -714,13 +712,6 @@ public: void async_read_some_at(implementation_type& impl, boost::uint64_t offset, const MutableBufferSequence& buffers, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) impl.safe_cancellation_thread_id_ = ::GetCurrentThreadId(); @@ -733,6 +724,13 @@ public: raw_handler_ptr<alloc_traits> raw_ptr(handler); handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Find first buffer of non-zero length. boost::asio::mutable_buffer buffer; typename MutableBufferSequence::const_iterator iter = buffers.begin(); @@ -747,10 +745,8 @@ public: // A request to receive 0 bytes on a stream handle is a no-op. if (boost::asio::buffer_size(buffer) == 0) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code error; - iocp_service_.post(bind_handler(handler, error, 0)); + ptr.get()->on_immediate_completion(0, 0); + ptr.release(); return; } @@ -765,14 +761,12 @@ public: DWORD last_error = ::GetLastError(); if (!ok && last_error != ERROR_IO_PENDING && last_error != ERROR_MORE_DATA) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service.hpp index 5818542..1dfb9a1 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service.hpp @@ -2,7 +2,7 @@ // win_iocp_io_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -22,7 +22,7 @@ #if defined(BOOST_ASIO_HAS_IOCP) #include <boost/asio/detail/push_options.hpp> -#include <limits> +#include <boost/limits.hpp> #include <boost/throw_exception.hpp> #include <boost/system/system_error.hpp> #include <boost/asio/detail/pop_options.hpp> @@ -50,6 +50,8 @@ public: // This class inherits from OVERLAPPED so that we can downcast to get back to // the operation pointer from the LPOVERLAPPED out parameter of // GetQueuedCompletionStatus. + class operation; + friend class operation; class operation : public OVERLAPPED { @@ -59,7 +61,10 @@ public: operation(win_iocp_io_service& iocp_service, invoke_func_type invoke_func, destroy_func_type destroy_func) - : outstanding_operations_(&iocp_service.outstanding_operations_), + : iocp_service_(iocp_service), + ready_(0), + last_error_(~DWORD(0)), + bytes_transferred_(0), invoke_func_(invoke_func), destroy_func_(destroy_func) { @@ -69,12 +74,48 @@ public: OffsetHigh = 0; hEvent = 0; - ::InterlockedIncrement(outstanding_operations_); + ::InterlockedIncrement(&iocp_service_.outstanding_operations_); + } + + void reset() + { + Internal = 0; + InternalHigh = 0; + Offset = 0; + OffsetHigh = 0; + hEvent = 0; + ready_ = 0; + last_error_ = ~DWORD(0); + bytes_transferred_ = 0; + } + + void on_pending() + { + if (::InterlockedCompareExchange(&ready_, 1, 0) == 1) + iocp_service_.post_completion(this, last_error_, bytes_transferred_); } - void do_completion(DWORD last_error, size_t bytes_transferred) + void on_immediate_completion(DWORD last_error, DWORD bytes_transferred) { - invoke_func_(this, last_error, bytes_transferred); + ready_ = 1; + iocp_service_.post_completion(this, last_error, bytes_transferred); + } + + bool on_completion(DWORD last_error, DWORD bytes_transferred) + { + if (last_error_ == ~DWORD(0)) + { + last_error_ = last_error; + bytes_transferred_ = bytes_transferred; + } + + if (::InterlockedCompareExchange(&ready_, 1, 0) == 1) + { + invoke_func_(this, last_error_, bytes_transferred_); + return true; + } + + return false; } void destroy() @@ -86,16 +127,18 @@ public: // Prevent deletion through this type. ~operation() { - ::InterlockedDecrement(outstanding_operations_); + ::InterlockedDecrement(&iocp_service_.outstanding_operations_); } private: - long* outstanding_operations_; + win_iocp_io_service& iocp_service_; + long ready_; + DWORD last_error_; + DWORD bytes_transferred_; invoke_func_type invoke_func_; destroy_func_type destroy_func_; }; - // Constructor. win_iocp_io_service(boost::asio::io_service& io_service) : boost::asio::detail::service_base<win_iocp_io_service>(io_service), @@ -132,7 +175,7 @@ public: while (::InterlockedExchangeAdd(&outstanding_operations_, 0) > 0) { DWORD bytes_transferred = 0; -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) DWORD completion_key = 0; #else DWORD_PTR completion_key = 0; @@ -276,7 +319,7 @@ public: void dispatch(Handler handler) { if (call_stack<win_iocp_io_service>::contains(this)) - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); else post(handler); } @@ -296,15 +339,7 @@ public: handler_ptr<alloc_traits> ptr(raw_ptr, *this, handler); // Enqueue the operation on the I/O completion port. - if (!::PostQueuedCompletionStatus(iocp_.handle, 0, 0, ptr.get())) - { - DWORD last_error = ::GetLastError(); - boost::system::system_error e( - boost::system::error_code(last_error, - boost::asio::error::get_system_category()), - "pqcs"); - boost::throw_exception(e); - } + ptr.get()->on_immediate_completion(0, 0); // Operation has been successfully posted. ptr.release(); @@ -419,7 +454,7 @@ private: // Get the next operation from the queue. DWORD bytes_transferred = 0; -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) DWORD completion_key = 0; #else DWORD_PTR completion_key = 0; @@ -507,10 +542,11 @@ private: // Dispatch the operation. operation* op = static_cast<operation*>(overlapped); - op->do_completion(last_error, bytes_transferred); - - ec = boost::system::error_code(); - return 1; + if (op->on_completion(last_error, bytes_transferred)) + { + ec = boost::system::error_code(); + return 1; + } } else if (completion_key == transfer_timer_dispatching) { @@ -648,7 +684,7 @@ private: ptr.reset(); // Make the upcall. - boost_asio_handler_invoke_helpers::invoke(handler, &handler); + boost_asio_handler_invoke_helpers::invoke(handler, handler); } static void destroy_impl(operation* op) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service_fwd.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service_fwd.hpp index c9e6060..be413ec 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service_fwd.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_io_service_fwd.hpp @@ -2,7 +2,7 @@ // win_iocp_io_service_fwd.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_overlapped_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_overlapped_ptr.hpp index e8ab6b0..bb64014 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_overlapped_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_overlapped_ptr.hpp @@ -2,7 +2,7 @@ // win_iocp_overlapped_ptr.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -92,6 +92,9 @@ public: // Release ownership of the OVERLAPPED object. OVERLAPPED* release() { + if (ptr_) + ptr_->on_pending(); + OVERLAPPED* tmp = ptr_; ptr_ = 0; return tmp; @@ -104,8 +107,7 @@ public: if (ptr_) { ptr_->ec_ = ec; - ptr_->io_service_.post_completion(ptr_, 0, - static_cast<DWORD>(bytes_transferred)); + ptr_->on_immediate_completion(0, static_cast<DWORD>(bytes_transferred)); ptr_ = 0; } } @@ -171,7 +173,7 @@ private: // Make the upcall. boost_asio_handler_invoke_helpers::invoke( - bind_handler(handler, ec, bytes_transferred), &handler); + bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(win_iocp_io_service::operation* op) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_serial_port_service.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_serial_port_service.hpp index 57d56cf..4d6d2e9 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_serial_port_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_serial_port_service.hpp @@ -2,7 +2,7 @@ // win_iocp_serial_port_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/detail/win_iocp_socket_service.hpp b/3rdParty/Boost/src/boost/asio/detail/win_iocp_socket_service.hpp index 5192612..e0c0806 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_iocp_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_iocp_socket_service.hpp @@ -2,7 +2,7 @@ // win_iocp_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -789,7 +789,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec, bytes_transferred), &handler); + detail::bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -823,13 +823,6 @@ public: void async_send(implementation_type& impl, const ConstBufferSequence& buffers, socket_base::message_flags flags, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - #if defined(BOOST_ASIO_ENABLE_CANCELIO) // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) @@ -845,6 +838,13 @@ public: handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, impl.cancel_token_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; typename ConstBufferSequence::const_iterator iter = buffers.begin(); @@ -863,10 +863,8 @@ public: // A request to receive 0 bytes on a stream socket is a no-op. if (impl.protocol_.type() == SOCK_STREAM && total_buffer_size == 0) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code error; - iocp_service_.post(bind_handler(handler, error, 0)); + ptr.get()->on_immediate_completion(0, 0); + ptr.release(); return; } @@ -879,14 +877,12 @@ public: // Check if the operation completed immediately. if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1068,7 +1064,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec, bytes_transferred), &handler); + detail::bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -1102,13 +1098,6 @@ public: const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - #if defined(BOOST_ASIO_ENABLE_CANCELIO) // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) @@ -1123,6 +1112,13 @@ public: raw_handler_ptr<alloc_traits> raw_ptr(handler); handler_ptr<alloc_traits> ptr(raw_ptr, iocp_service_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; typename ConstBufferSequence::const_iterator iter = buffers.begin(); @@ -1145,14 +1141,12 @@ public: // Check if the operation completed immediately. if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1339,7 +1333,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec, bytes_transferred), &handler); + detail::bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -1375,13 +1369,6 @@ public: const MutableBufferSequence& buffers, socket_base::message_flags flags, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - #if defined(BOOST_ASIO_ENABLE_CANCELIO) // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) @@ -1398,6 +1385,13 @@ public: handler_ptr<alloc_traits> ptr(raw_ptr, protocol_type, iocp_service_, impl.cancel_token_, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; typename MutableBufferSequence::const_iterator iter = buffers.begin(); @@ -1415,10 +1409,8 @@ public: // A request to receive 0 bytes on a stream socket is a no-op. if (impl.protocol_.type() == SOCK_STREAM && total_buffer_size == 0) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code error; - iocp_service_.post(bind_handler(handler, error, 0)); + ptr.get()->on_immediate_completion(0, 0); + ptr.release(); return; } @@ -1430,14 +1422,12 @@ public: DWORD last_error = ::WSAGetLastError(); if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1482,14 +1472,12 @@ public: DWORD last_error = ::WSAGetLastError(); if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1672,7 +1660,7 @@ public: // Call the handler. boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec, bytes_transferred), &handler); + detail::bind_handler(handler, ec, bytes_transferred), handler); } static void destroy_impl(operation* op) @@ -1710,13 +1698,6 @@ public: const MutableBufferSequence& buffers, endpoint_type& sender_endp, socket_base::message_flags flags, Handler handler) { - if (!is_open(impl)) - { - this->get_io_service().post(bind_handler(handler, - boost::asio::error::bad_descriptor, 0)); - return; - } - #if defined(BOOST_ASIO_ENABLE_CANCELIO) // Update the ID of the thread from which cancellation is safe. if (impl.safe_cancellation_thread_id_ == 0) @@ -1733,6 +1714,13 @@ public: handler_ptr<alloc_traits> ptr(raw_ptr, protocol_type, iocp_service_, sender_endp, buffers, handler); + if (!is_open(impl)) + { + ptr.get()->on_immediate_completion(WSAEBADF, 0); + ptr.release(); + return; + } + // Copy buffers into WSABUF array. ::WSABUF bufs[max_buffers]; typename MutableBufferSequence::const_iterator iter = buffers.begin(); @@ -1754,14 +1742,12 @@ public: DWORD last_error = ::WSAGetLastError(); if (result != 0 && last_error != WSA_IO_PENDING) { - boost::asio::io_service::work work(this->get_io_service()); - ptr.reset(); - boost::system::error_code ec(last_error, - boost::asio::error::get_system_category()); - iocp_service_.post(bind_handler(handler, ec, bytes_transferred)); + ptr.get()->on_immediate_completion(last_error, bytes_transferred); + ptr.release(); } else { + ptr.get()->on_pending(); ptr.release(); } } @@ -1925,11 +1911,7 @@ public: && !ptr.get()->enable_connection_aborted_) { // Reset OVERLAPPED structure. - ptr.get()->Internal = 0; - ptr.get()->InternalHigh = 0; - ptr.get()->Offset = 0; - ptr.get()->OffsetHigh = 0; - ptr.get()->hEvent = 0; + ptr.get()->reset(); // Create a new socket for the next connection, since the AcceptEx call // fails with WSAEINVAL if we try to reuse the same socket. @@ -1954,7 +1936,7 @@ public: || last_error == WSAECONNABORTED) { // Post this handler so that operation will be restarted again. - ptr.get()->io_service_.post_completion(ptr.get(), last_error, 0); + ptr.get()->on_immediate_completion(last_error, 0); ptr.release(); return; } @@ -1966,6 +1948,7 @@ public: else { // Asynchronous operation has been successfully restarted. + ptr.get()->on_pending(); ptr.release(); return; } @@ -2038,7 +2021,7 @@ public: boost::system::error_code ec(last_error, boost::asio::error::get_system_category()); boost_asio_handler_invoke_helpers::invoke( - detail::bind_handler(handler, ec), &handler); + detail::bind_handler(handler, ec), handler); } static void destroy_impl(operation* op) @@ -2141,7 +2124,7 @@ public: // Post handler so that operation will be restarted again. We do not // perform the AcceptEx again here to avoid the possibility of starving // other handlers. - iocp_service_.post_completion(ptr.get(), last_error, 0); + ptr.get()->on_immediate_completion(last_error, 0); ptr.release(); } else @@ -2155,6 +2138,7 @@ public: } else { + ptr.get()->on_pending(); ptr.release(); } } diff --git a/3rdParty/Boost/src/boost/asio/detail/win_mutex.hpp b/3rdParty/Boost/src/boost/asio/detail/win_mutex.hpp index f5470c4..107d707 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_mutex.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_mutex.hpp @@ -2,7 +2,7 @@ // win_mutex.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_signal_blocker.hpp b/3rdParty/Boost/src/boost/asio/detail/win_signal_blocker.hpp index e9b4d37..6d70a16 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_signal_blocker.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_signal_blocker.hpp @@ -2,7 +2,7 @@ // win_signal_blocker.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/win_thread.hpp b/3rdParty/Boost/src/boost/asio/detail/win_thread.hpp index c8058d8..61c9b8a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_thread.hpp @@ -2,7 +2,7 @@ // win_thread.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -40,7 +40,7 @@ namespace detail { unsigned int __stdcall win_thread_function(void* arg); -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) void __stdcall apc_function(ULONG data); #else void __stdcall apc_function(ULONG_PTR data); @@ -156,7 +156,7 @@ public: private: friend unsigned int __stdcall win_thread_function(void* arg); -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) friend void __stdcall apc_function(ULONG); #else friend void __stdcall apc_function(ULONG_PTR); @@ -217,7 +217,7 @@ inline unsigned int __stdcall win_thread_function(void* arg) return 0; } -#if (WINVER < 0x0500) +#if defined(WINVER) && (WINVER < 0x0500) inline void __stdcall apc_function(ULONG) {} #else inline void __stdcall apc_function(ULONG_PTR) {} diff --git a/3rdParty/Boost/src/boost/asio/detail/win_tss_ptr.hpp b/3rdParty/Boost/src/boost/asio/detail/win_tss_ptr.hpp index 5c56454..fa04613 100644 --- a/3rdParty/Boost/src/boost/asio/detail/win_tss_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/win_tss_ptr.hpp @@ -2,7 +2,7 @@ // win_tss_ptr.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/wince_thread.hpp b/3rdParty/Boost/src/boost/asio/detail/wince_thread.hpp index 7b24ec2..1cb9a7a 100644 --- a/3rdParty/Boost/src/boost/asio/detail/wince_thread.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/wince_thread.hpp @@ -2,7 +2,7 @@ // wince_thread.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/winsock_init.hpp b/3rdParty/Boost/src/boost/asio/detail/winsock_init.hpp index 827cf58..186a8b5 100644 --- a/3rdParty/Boost/src/boost/asio/detail/winsock_init.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/winsock_init.hpp @@ -2,7 +2,7 @@ // winsock_init.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp b/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp index 64fc729..8f2f625 100644 --- a/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp @@ -2,7 +2,7 @@ // wrapped_handler.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,7 +18,7 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <boost/type_traits.hpp> +#include <boost/type_traits/add_reference.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/detail/bind_handler.hpp> @@ -158,7 +158,7 @@ inline void* asio_handler_allocate(std::size_t size, wrapped_handler<Dispatcher, Handler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename Dispatcher, typename Handler> @@ -166,7 +166,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, wrapped_handler<Dispatcher, Handler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename Dispatcher, typename Handler> @@ -183,7 +183,7 @@ inline void* asio_handler_allocate(std::size_t size, rewrapped_handler<Handler, Context>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->context_); + size, this_handler->context_); } template <typename Handler, typename Context> @@ -191,7 +191,7 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size, rewrapped_handler<Handler, Context>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->context_); + pointer, size, this_handler->context_); } template <typename Function, typename Handler, typename Context> @@ -199,7 +199,7 @@ inline void asio_handler_invoke(const Function& function, rewrapped_handler<Handler, Context>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->context_); + function, this_handler->context_); } } // namespace detail diff --git a/3rdParty/Boost/src/boost/asio/error.hpp b/3rdParty/Boost/src/boost/asio/error.hpp index 0101945..0dcb3dc 100644 --- a/3rdParty/Boost/src/boost/asio/error.hpp +++ b/3rdParty/Boost/src/boost/asio/error.hpp @@ -2,7 +2,7 @@ // error.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/handler_alloc_hook.hpp b/3rdParty/Boost/src/boost/asio/handler_alloc_hook.hpp index e949529..5dada4e 100644 --- a/3rdParty/Boost/src/boost/asio/handler_alloc_hook.hpp +++ b/3rdParty/Boost/src/boost/asio/handler_alloc_hook.hpp @@ -2,7 +2,7 @@ // handler_alloc_hook.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/handler_invoke_hook.hpp b/3rdParty/Boost/src/boost/asio/handler_invoke_hook.hpp index d70a717..184f449 100644 --- a/3rdParty/Boost/src/boost/asio/handler_invoke_hook.hpp +++ b/3rdParty/Boost/src/boost/asio/handler_invoke_hook.hpp @@ -2,7 +2,7 @@ // handler_invoke_hook.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -26,10 +26,9 @@ namespace asio { * io_service associated with the corresponding object (e.g. a socket or * deadline_timer). Certain guarantees are made on when the handler may be * invoked, in particular that a handler can only be invoked from a thread that - * is currently calling boost::asio::io_service::run() on the corresponding - * io_service object. Handlers may subsequently be invoked through other - * objects (such as boost::asio::strand objects) that provide additional - * guarantees. + * is currently calling @c run() on the corresponding io_service object. + * Handlers may subsequently be invoked through other objects (such as + * io_service::strand objects) that provide additional guarantees. * * When asynchronous operations are composed from other asynchronous * operations, all intermediate handlers should be invoked using the same diff --git a/3rdParty/Boost/src/boost/asio/impl/io_service.ipp b/3rdParty/Boost/src/boost/asio/impl/io_service.ipp index e936f36..9234dc4 100644 --- a/3rdParty/Boost/src/boost/asio/impl/io_service.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/io_service.ipp @@ -2,7 +2,7 @@ // io_service.ipp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,17 +18,27 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <limits> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> -#include <boost/asio/detail/dev_poll_reactor.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_registry.hpp> -#include <boost/asio/detail/task_io_service.hpp> #include <boost/asio/detail/throw_error.hpp> -#include <boost/asio/detail/win_iocp_io_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_io_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/task_io_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/task_io_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/task_io_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/task_io_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/impl/read.ipp b/3rdParty/Boost/src/boost/asio/impl/read.ipp index 453f697..05ea960 100644 --- a/3rdParty/Boost/src/boost/asio/impl/read.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/read.ipp @@ -2,7 +2,7 @@ // read.ipp // ~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -75,6 +75,8 @@ inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, return bytes_transferred; } +#if !defined(BOOST_NO_IOSTREAM) + template <typename SyncReadStream, typename Allocator, typename CompletionCondition> std::size_t read(SyncReadStream& s, @@ -122,6 +124,8 @@ inline std::size_t read(SyncReadStream& s, return bytes_transferred; } +#endif // !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncReadStream, typename MutableBufferSequence, @@ -174,7 +178,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename MutableBufferSequence, @@ -184,7 +188,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, @@ -195,7 +199,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -232,6 +236,8 @@ inline void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, async_read(s, buffers, transfer_all(), handler); } +#if !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncReadStream, typename Allocator, @@ -285,7 +291,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, @@ -295,7 +301,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, @@ -305,7 +311,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -341,6 +347,8 @@ inline void async_read(AsyncReadStream& s, async_read(s, b, transfer_all(), handler); } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/impl/read_at.ipp b/3rdParty/Boost/src/boost/asio/impl/read_at.ipp index bf8a36d..91fd014 100644 --- a/3rdParty/Boost/src/boost/asio/impl/read_at.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/read_at.ipp @@ -2,7 +2,7 @@ // read_at.ipp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -81,6 +81,8 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d, return bytes_transferred; } +#if !defined(BOOST_NO_IOSTREAM) + template <typename SyncRandomAccessReadDevice, typename Allocator, typename CompletionCondition> std::size_t read_at(SyncRandomAccessReadDevice& d, @@ -126,6 +128,8 @@ inline std::size_t read_at(SyncRandomAccessReadDevice& d, return bytes_transferred; } +#endif // !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncRandomAccessReadDevice, @@ -184,7 +188,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncRandomAccessReadDevice, @@ -195,7 +199,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncRandomAccessReadDevice, @@ -206,7 +210,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -245,6 +249,8 @@ inline void async_read_at(AsyncRandomAccessReadDevice& d, async_read_at(d, offset, buffers, transfer_all(), handler); } +#if !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncRandomAccessReadDevice, typename Allocator, @@ -301,7 +307,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncRandomAccessReadDevice, typename Allocator, @@ -311,7 +317,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncRandomAccessReadDevice, @@ -321,7 +327,7 @@ namespace detail CompletionCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -359,6 +365,8 @@ inline void async_read_at(AsyncRandomAccessReadDevice& d, async_read_at(d, offset, b, transfer_all(), handler); } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/impl/read_until.ipp b/3rdParty/Boost/src/boost/asio/impl/read_until.ipp index df4a568..0ee0de0 100644 --- a/3rdParty/Boost/src/boost/asio/impl/read_until.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/read_until.ipp @@ -2,7 +2,7 @@ // read_until.ipp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -19,9 +19,9 @@ #include <boost/asio/detail/push_options.hpp> #include <algorithm> -#include <limits> #include <string> #include <utility> +#include <boost/limits.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/buffer.hpp> @@ -404,7 +404,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, typename ReadHandler> @@ -413,7 +413,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, typename Allocator, @@ -423,7 +423,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -560,7 +560,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, typename ReadHandler> @@ -569,7 +569,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, @@ -579,7 +579,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -733,7 +733,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, typename ReadHandler> @@ -742,7 +742,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, typename Allocator, @@ -752,7 +752,7 @@ namespace detail Allocator, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -903,7 +903,7 @@ namespace detail Allocator, MatchCondition, ReadHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncReadStream, typename Allocator, @@ -913,7 +913,7 @@ namespace detail Allocator, MatchCondition, ReadHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncReadStream, typename Allocator, @@ -923,7 +923,7 @@ namespace detail Allocator, MatchCondition, ReadHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail diff --git a/3rdParty/Boost/src/boost/asio/impl/serial_port_base.ipp b/3rdParty/Boost/src/boost/asio/impl/serial_port_base.ipp index 0470ff2..2775a02 100644 --- a/3rdParty/Boost/src/boost/asio/impl/serial_port_base.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/serial_port_base.ipp @@ -2,7 +2,7 @@ // serial_port_base.ipp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -18,6 +18,10 @@ #include <boost/asio/detail/push_options.hpp> +#include <boost/asio/detail/push_options.hpp> +#include <boost/throw_exception.hpp> +#include <boost/asio/detail/pop_options.hpp> + namespace boost { namespace asio { @@ -206,7 +210,10 @@ inline serial_port_base::flow_control::flow_control( : value_(t) { if (t != none && t != software && t != hardware) - throw std::out_of_range("invalid flow_control value"); + { + std::out_of_range ex("invalid flow_control value"); + boost::throw_exception(ex); + } } inline serial_port_base::flow_control::type @@ -314,7 +321,10 @@ inline serial_port_base::parity::parity(serial_port_base::parity::type t) : value_(t) { if (t != none && t != odd && t != even) - throw std::out_of_range("invalid parity value"); + { + std::out_of_range ex("invalid parity value"); + boost::throw_exception(ex); + } } inline serial_port_base::parity::type serial_port_base::parity::value() const @@ -411,7 +421,10 @@ inline serial_port_base::stop_bits::stop_bits( : value_(t) { if (t != one && t != onepointfive && t != two) - throw std::out_of_range("invalid stop_bits value"); + { + std::out_of_range ex("invalid stop_bits value"); + boost::throw_exception(ex); + } } inline serial_port_base::stop_bits::type @@ -487,7 +500,10 @@ inline serial_port_base::character_size::character_size(unsigned int t) : value_(t) { if (t < 5 || t > 8) - throw std::out_of_range("invalid character_size value"); + { + std::out_of_range ex("invalid character_size value"); + boost::throw_exception(ex); + } } inline unsigned int serial_port_base::character_size::value() const diff --git a/3rdParty/Boost/src/boost/asio/impl/write.ipp b/3rdParty/Boost/src/boost/asio/impl/write.ipp index 4434a91..76bace3 100644 --- a/3rdParty/Boost/src/boost/asio/impl/write.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/write.ipp @@ -2,7 +2,7 @@ // write.ipp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -70,6 +70,8 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, return bytes_transferred; } +#if !defined(BOOST_NO_IOSTREAM) + template <typename SyncWriteStream, typename Allocator, typename CompletionCondition> std::size_t write(SyncWriteStream& s, @@ -103,6 +105,8 @@ inline std::size_t write(SyncWriteStream& s, return bytes_transferred; } +#endif // !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncWriteStream, typename ConstBufferSequence, @@ -155,7 +159,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncWriteStream, typename ConstBufferSequence, @@ -165,7 +169,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncWriteStream, @@ -176,7 +180,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -213,6 +217,8 @@ inline void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, async_write(s, buffers, transfer_all(), handler); } +#if !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncWriteStream, typename Allocator, @@ -246,7 +252,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncWriteStream, typename Allocator, @@ -256,7 +262,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncWriteStream, typename Allocator, @@ -266,7 +272,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -288,6 +294,8 @@ inline void async_write(AsyncWriteStream& s, async_write(s, b, transfer_all(), handler); } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/impl/write_at.ipp b/3rdParty/Boost/src/boost/asio/impl/write_at.ipp index ba00567..751229b 100644 --- a/3rdParty/Boost/src/boost/asio/impl/write_at.ipp +++ b/3rdParty/Boost/src/boost/asio/impl/write_at.ipp @@ -2,7 +2,7 @@ // write_at.ipp // ~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -76,6 +76,8 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d, return bytes_transferred; } +#if !defined(BOOST_NO_IOSTREAM) + template <typename SyncRandomAccessWriteDevice, typename Allocator, typename CompletionCondition> std::size_t write_at(SyncRandomAccessWriteDevice& d, @@ -111,6 +113,8 @@ inline std::size_t write_at(SyncRandomAccessWriteDevice& d, return bytes_transferred; } +#endif // !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence, @@ -167,7 +171,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncRandomAccessWriteDevice, typename ConstBufferSequence, @@ -177,7 +181,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncRandomAccessWriteDevice, @@ -188,7 +192,7 @@ namespace detail CompletionCondition, WriteHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -227,6 +231,8 @@ inline void async_write_at(AsyncRandomAccessWriteDevice& d, async_write_at(d, offset, buffers, transfer_all(), handler); } +#if !defined(BOOST_NO_IOSTREAM) + namespace detail { template <typename AsyncRandomAccessWriteDevice, typename Allocator, @@ -261,7 +267,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { return boost_asio_handler_alloc_helpers::allocate( - size, &this_handler->handler_); + size, this_handler->handler_); } template <typename AsyncRandomAccessWriteDevice, typename Allocator, @@ -271,7 +277,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { boost_asio_handler_alloc_helpers::deallocate( - pointer, size, &this_handler->handler_); + pointer, size, this_handler->handler_); } template <typename Function, typename AsyncRandomAccessWriteDevice, @@ -281,7 +287,7 @@ namespace detail Allocator, WriteHandler>* this_handler) { boost_asio_handler_invoke_helpers::invoke( - function, &this_handler->handler_); + function, this_handler->handler_); } } // namespace detail @@ -305,6 +311,8 @@ inline void async_write_at(AsyncRandomAccessWriteDevice& d, async_write_at(d, offset, b, transfer_all(), handler); } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/io_service.hpp b/3rdParty/Boost/src/boost/asio/io_service.hpp index e50224a..a34d874 100644 --- a/3rdParty/Boost/src/boost/asio/io_service.hpp +++ b/3rdParty/Boost/src/boost/asio/io_service.hpp @@ -2,7 +2,7 @@ // io_service.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -61,27 +61,36 @@ template <typename Service> bool has_service(io_service& ios); * * @par Thread Safety * @e Distinct @e objects: Safe.@n - * @e Shared @e objects: Safe, with the exception that calling reset() - * while there are unfinished run() calls results in undefined behaviour. + * @e Shared @e objects: Safe, with the exception that calling reset() while + * there are unfinished run(), run_one(), poll() or poll_one() calls results in + * undefined behaviour. * * @par Concepts: * Dispatcher. * + * @par Synchronous and asynchronous operations + * + * Synchronous operations on I/O objects implicitly run the io_service object + * for an individual operation. The io_service functions run(), run_one(), + * poll() or poll_one() must be called for the io_service to perform + * asynchronous operations on behalf of a C++ program. Notification that an + * asynchronous operation has completed is delivered by invocation of the + * associated handler. Handlers are invoked only by a thread that is currently + * calling any overload of run(), run_one(), poll() or poll_one() for the + * io_service. + * * @par Effect of exceptions thrown from handlers * * If an exception is thrown from a handler, the exception is allowed to - * propagate through the throwing thread's invocation of - * boost::asio::io_service::run(), boost::asio::io_service::run_one(), - * boost::asio::io_service::poll() or boost::asio::io_service::poll_one(). - * No other threads that are calling any of these functions are affected. It is - * then the responsibility of the application to catch the exception. + * propagate through the throwing thread's invocation of run(), run_one(), + * poll() or poll_one(). No other threads that are calling any of these + * functions are affected. It is then the responsibility of the application to + * catch the exception. * - * After the exception has been caught, the - * boost::asio::io_service::run(), boost::asio::io_service::run_one(), - * boost::asio::io_service::poll() or boost::asio::io_service::poll_one() - * call may be restarted @em without the need for an intervening call to - * boost::asio::io_service::reset(). This allows the thread to rejoin the - * io_service's thread pool without impacting any other threads in the pool. + * After the exception has been caught, the run(), run_one(), poll() or + * poll_one() call may be restarted @em without the need for an intervening + * call to reset(). This allows the thread to rejoin the io_service object's + * thread pool without impacting any other threads in the pool. * * For example: * @@ -104,7 +113,7 @@ template <typename Service> bool has_service(io_service& ios); * * @par Stopping the io_service from running out of work * - * Some applications may need to prevent an io_service's run() call from + * Some applications may need to prevent an io_service object's run() call from * returning when there is no more work to do. For example, the io_service may * be being run in a background thread that is launched prior to the * application's asynchronous operations. The run() call may be kept running by @@ -114,10 +123,10 @@ template <typename Service> bool has_service(io_service& ios); * boost::asio::io_service::work work(io_service); * ... @endcode * - * To effect a shutdown, the application will then need to call the io_service's - * stop() member function. This will cause the io_service run() call to return - * as soon as possible, abandoning unfinished operations and without permitting - * ready handlers to be dispatched. + * To effect a shutdown, the application will then need to call the io_service + * object's stop() member function. This will cause the io_service run() call + * to return as soon as possible, abandoning unfinished operations and without + * permitting ready handlers to be dispatched. * * Alternatively, if the application requires that all operations and handlers * be allowed to finish normally, the work object may be explicitly destroyed. @@ -127,6 +136,43 @@ template <typename Service> bool has_service(io_service& ios); * new boost::asio::io_service::work(io_service)); * ... * work.reset(); // Allow run() to exit. @endcode + * + * @par The io_service class and I/O services + * + * Class io_service implements an extensible, type-safe, polymorphic set of I/O + * services, indexed by service type. An object of class io_service must be + * initialised before I/O objects such as sockets, resolvers and timers can be + * used. These I/O objects are distinguished by having constructors that accept + * an @c io_service& parameter. + * + * I/O services exist to manage the logical interface to the operating system on + * behalf of the I/O objects. In particular, there are resources that are shared + * across a class of I/O objects. For example, timers may be implemented in + * terms of a single timer queue. The I/O services manage these shared + * resources. + * + * Access to the services of an io_service is via three function templates, + * use_service(), add_service() and has_service(). + * + * In a call to @c use_service<Service>(), the type argument chooses a service, + * making available all members of the named type. If @c Service is not present + * in an io_service, an object of type @c Service is created and added to the + * io_service. A C++ program can check if an io_service implements a + * particular service with the function template @c has_service<Service>(). + * + * Service objects may be explicitly added to an io_service using the function + * template @c add_service<Service>(). If the @c Service is already present, the + * service_already_exists exception is thrown. If the owner of the service is + * not the same object as the io_service parameter, the invalid_service_owner + * exception is thrown. + * + * Once a service reference is obtained from an io_service object by calling + * use_service(), that reference remains usable as long as the owning io_service + * object exists. + * + * All I/O service implementations have io_service::service as a public base + * class. Custom I/O services may be implemented by deriving from this class and + * then added to an io_service using the facilities described above. */ class io_service : private noncopyable @@ -169,9 +215,40 @@ public: explicit io_service(std::size_t concurrency_hint); /// Destructor. + /** + * On destruction, the io_service performs the following sequence of + * operations: + * + * @li For each service object @c svc in the io_service set, in reverse order + * of the beginning of service object lifetime, performs + * @c svc->shutdown_service(). + * + * @li Uninvoked handler objects that were scheduled for deferred invocation + * on the io_service, or any associated strand, are destroyed. + * + * @li For each service object @c svc in the io_service set, in reverse order + * of the beginning of service object lifetime, performs + * <tt>delete static_cast<io_service::service*>(svc)</tt>. + * + * @note The destruction sequence described above permits programs to + * simplify their resource management by using @c shared_ptr<>. Where an + * object's lifetime is tied to the lifetime of a connection (or some other + * sequence of asynchronous operations), a @c shared_ptr to the object would + * be bound into the handlers for all asynchronous operations associated with + * it. This works as follows: + * + * @li When a single connection ends, all associated asynchronous operations + * complete. The corresponding handler objects are destroyed, and all + * @c shared_ptr references to the objects are destroyed. + * + * @li To shut down the whole program, the io_service function stop() is + * called to terminate any run() calls as soon as possible. The io_service + * destructor defined above destroys all handlers, causing all @c shared_ptr + * references to all connection objects to be destroyed. + */ ~io_service(); - /// Run the io_service's event processing loop. + /// Run the io_service object's event processing loop. /** * The run() function blocks until all work has finished and there are no * more handlers to be dispatched, or until the io_service has been stopped. @@ -188,12 +265,16 @@ public: * * @throws boost::system::system_error Thrown on failure. * - * @note The poll() function may also be used to dispatch ready handlers, - * but without blocking. + * @note The run() function must not be called from a thread that is currently + * calling one of run(), run_one(), poll() or poll_one() on the same + * io_service object. + * + * The poll() function may also be used to dispatch ready handlers, but + * without blocking. */ std::size_t run(); - /// Run the io_service's event processing loop. + /// Run the io_service object's event processing loop. /** * The run() function blocks until all work has finished and there are no * more handlers to be dispatched, or until the io_service has been stopped. @@ -210,12 +291,17 @@ public: * * @return The number of handlers that were executed. * - * @note The poll() function may also be used to dispatch ready handlers, - * but without blocking. + * @note The run() function must not be called from a thread that is currently + * calling one of run(), run_one(), poll() or poll_one() on the same + * io_service object. + * + * The poll() function may also be used to dispatch ready handlers, but + * without blocking. */ std::size_t run(boost::system::error_code& ec); - /// Run the io_service's event processing loop to execute at most one handler. + /// Run the io_service object's event processing loop to execute at most one + /// handler. /** * The run_one() function blocks until one handler has been dispatched, or * until the io_service has been stopped. @@ -226,7 +312,8 @@ public: */ std::size_t run_one(); - /// Run the io_service's event processing loop to execute at most one handler. + /// Run the io_service object's event processing loop to execute at most one + /// handler. /** * The run_one() function blocks until one handler has been dispatched, or * until the io_service has been stopped. @@ -237,7 +324,8 @@ public: */ std::size_t run_one(boost::system::error_code& ec); - /// Run the io_service's event processing loop to execute ready handlers. + /// Run the io_service object's event processing loop to execute ready + /// handlers. /** * The poll() function runs handlers that are ready to run, without blocking, * until the io_service has been stopped or there are no more ready handlers. @@ -248,7 +336,8 @@ public: */ std::size_t poll(); - /// Run the io_service's event processing loop to execute ready handlers. + /// Run the io_service object's event processing loop to execute ready + /// handlers. /** * The poll() function runs handlers that are ready to run, without blocking, * until the io_service has been stopped or there are no more ready handlers. @@ -259,7 +348,8 @@ public: */ std::size_t poll(boost::system::error_code& ec); - /// Run the io_service's event processing loop to execute one ready handler. + /// Run the io_service object's event processing loop to execute one ready + /// handler. /** * The poll_one() function runs at most one handler that is ready to run, * without blocking. @@ -270,7 +360,8 @@ public: */ std::size_t poll_one(); - /// Run the io_service's event processing loop to execute one ready handler. + /// Run the io_service object's event processing loop to execute one ready + /// handler. /** * The poll_one() function runs at most one handler that is ready to run, * without blocking. @@ -281,7 +372,7 @@ public: */ std::size_t poll_one(boost::system::error_code& ec); - /// Stop the io_service's event processing loop. + /// Stop the io_service object's event processing loop. /** * This function does not block, but instead simply signals the io_service to * stop. All invocations of its run() or run_one() member functions should @@ -340,15 +431,15 @@ public: /// on the io_service. /** * This function is used to create a new handler function object that, when - * invoked, will automatically pass the wrapped handler to the io_service's - * dispatch function. + * invoked, will automatically pass the wrapped handler to the io_service + * object's dispatch function. * * @param handler The handler to be wrapped. The io_service will make a copy * of the handler object as required. The function signature of the handler * must be: @code void handler(A1 a1, ... An an); @endcode * * @return A function object that, when invoked, passes the wrapped handler to - * the io_service's dispatch function. Given a function object with the + * the io_service object's dispatch function. Given a function object with the * signature: * @code R f(A1 a1, ... An an); @endcode * If this function object is passed to the wrap function like so: @@ -430,9 +521,9 @@ private: /// Class to inform the io_service when it has work to do. /** * The work class is used to inform the io_service when work starts and - * finishes. This ensures that the io_service's run() function will not exit - * while work is underway, and that it does exit when there is no unfinished - * work remaining. + * finishes. This ensures that the io_service object's run() function will not + * exit while work is underway, and that it does exit when there is no + * unfinished work remaining. * * The work class is copy-constructible so that it may be used as a data member * in a handler class. It is not assignable. @@ -443,24 +534,24 @@ public: /// Constructor notifies the io_service that work is starting. /** * The constructor is used to inform the io_service that some work has begun. - * This ensures that the io_service's run() function will not exit while the - * work is underway. + * This ensures that the io_service object's run() function will not exit + * while the work is underway. */ explicit work(boost::asio::io_service& io_service); /// Copy constructor notifies the io_service that work is starting. /** * The constructor is used to inform the io_service that some work has begun. - * This ensures that the io_service's run() function will not exit while the - * work is underway. + * This ensures that the io_service object's run() function will not exit + * while the work is underway. */ work(const work& other); /// Destructor notifies the io_service that the work is complete. /** * The destructor is used to inform the io_service that some work has - * finished. Once the count of unfinished work reaches zero, the io_service's - * run() function is permitted to exit. + * finished. Once the count of unfinished work reaches zero, the io_service + * object's run() function is permitted to exit. */ ~work(); diff --git a/3rdParty/Boost/src/boost/asio/ip/address.hpp b/3rdParty/Boost/src/boost/asio/ip/address.hpp index 9f1836e..16113f0 100644 --- a/3rdParty/Boost/src/boost/asio/ip/address.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/address.hpp @@ -2,7 +2,7 @@ // address.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,7 +18,10 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <iosfwd> +#include <boost/config.hpp> +#if !defined(BOOST_NO_IOSTREAM) +# include <iosfwd> +#endif // !defined(BOOST_NO_IOSTREAM) #include <string> #include <boost/throw_exception.hpp> #include <boost/asio/detail/pop_options.hpp> @@ -250,6 +253,8 @@ private: boost::asio::ip::address_v6 ipv6_address_; }; +#if !defined(BOOST_NO_IOSTREAM) + /// Output an address as a string. /** * Used to output a human-readable string for a specified address. @@ -270,6 +275,8 @@ std::basic_ostream<Elem, Traits>& operator<<( return os; } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace ip } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp b/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp index 357edfa..e0088dc 100644 --- a/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/address_v4.hpp @@ -2,7 +2,7 @@ // address_v4.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,6 +18,10 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#if !defined(BOOST_NO_IOSTREAM) +# include <iosfwd> +#endif // !defined(BOOST_NO_IOSTREAM) #include <climits> #include <string> #include <stdexcept> @@ -269,6 +273,8 @@ private: boost::asio::detail::in4_addr_type addr_; }; +#if !defined(BOOST_NO_IOSTREAM) + /// Output an address as a string. /** * Used to output a human-readable string for a specified address. @@ -300,6 +306,8 @@ std::basic_ostream<Elem, Traits>& operator<<( return os; } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace ip } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp b/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp index 5f5f092..4105c8d 100644 --- a/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/address_v6.hpp @@ -2,7 +2,7 @@ // address_v6.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,6 +18,10 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> +#if !defined(BOOST_NO_IOSTREAM) +# include <iosfwd> +#endif // !defined(BOOST_NO_IOSTREAM) #include <cstring> #include <string> #include <stdexcept> @@ -383,6 +387,8 @@ private: unsigned long scope_id_; }; +#if !defined(BOOST_NO_IOSTREAM) + /// Output an address as a string. /** * Used to output a human-readable string for a specified address. @@ -414,6 +420,8 @@ std::basic_ostream<Elem, Traits>& operator<<( return os; } +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace ip } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp index 80aaf1e..f191a4c 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_endpoint.hpp @@ -2,7 +2,7 @@ // basic_endpoint.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,13 +18,16 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> +#include <boost/config.hpp> #include <boost/throw_exception.hpp> #include <boost/detail/workaround.hpp> #include <cstring> -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -# include <ostream> -#endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -#include <sstream> +#if !defined(BOOST_NO_IOSTREAM) +# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +# include <ostream> +# endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +# include <sstream> +#endif // !defined(BOOST_NO_IOSTREAM) #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/error.hpp> @@ -297,6 +300,8 @@ private: } data_; }; +#if !defined(BOOST_NO_IOSTREAM) + /// Output an endpoint as a string. /** * Used to output a human-readable string for a specified endpoint. @@ -368,6 +373,8 @@ std::basic_ostream<Elem, Traits>& operator<<( } #endif // BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#endif // !defined(BOOST_NO_IOSTREAM) + } // namespace ip } // namespace asio } // namespace boost diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp index d0e8eb8..c4f13ab 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver.hpp @@ -2,7 +2,7 @@ // basic_resolver.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp index ba0a020..f2ac595 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_entry.hpp @@ -2,7 +2,7 @@ // basic_resolver_entry.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp index d5860b7..90644a2 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_iterator.hpp @@ -2,7 +2,7 @@ // basic_resolver_iterator.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp index dd08525..e95362b 100644 --- a/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/basic_resolver_query.hpp @@ -2,7 +2,7 @@ // basic_resolver_query.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp b/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp index 40226fe..0c26864 100644 --- a/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/detail/socket_option.hpp @@ -2,7 +2,7 @@ // socket_option.hpp // ~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -21,6 +21,7 @@ #include <cstddef> #include <cstring> #include <boost/config.hpp> +#include <boost/throw_exception.hpp> #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/ip/address.hpp> @@ -142,8 +143,8 @@ public: { if (s != sizeof(ipv6_value_)) { - throw std::length_error( - "multicast_enable_loopback socket option resize"); + std::length_error ex("multicast_enable_loopback socket option resize"); + boost::throw_exception(ex); } ipv4_value_ = ipv6_value_ ? 1 : 0; } @@ -151,8 +152,8 @@ public: { if (s != sizeof(ipv4_value_)) { - throw std::length_error( - "multicast_enable_loopback socket option resize"); + std::length_error ex("multicast_enable_loopback socket option resize"); + boost::throw_exception(ex); } ipv6_value_ = ipv4_value_ ? 1 : 0; } @@ -237,7 +238,10 @@ public: void resize(const Protocol&, std::size_t s) { if (s != sizeof(value_)) - throw std::length_error("unicast hops socket option resize"); + { + std::length_error ex("unicast hops socket option resize"); + boost::throw_exception(ex); + } #if defined(__hpux) if (value_ < 0) value_ = value_ & 0xFF; @@ -271,7 +275,10 @@ public: explicit multicast_hops(int v) { if (v < 0 || v > 255) - throw std::out_of_range("multicast hops value out of range"); + { + std::out_of_range ex("multicast hops value out of range"); + boost::throw_exception(ex); + } ipv4_value_ = (ipv4_value_type)v; ipv6_value_ = v; } @@ -280,7 +287,10 @@ public: multicast_hops& operator=(int v) { if (v < 0 || v > 255) - throw std::out_of_range("multicast hops value out of range"); + { + std::out_of_range ex("multicast hops value out of range"); + boost::throw_exception(ex); + } ipv4_value_ = (ipv4_value_type)v; ipv6_value_ = v; return *this; @@ -344,7 +354,10 @@ public: if (protocol.family() == PF_INET6) { if (s != sizeof(ipv6_value_)) - throw std::length_error("multicast hops socket option resize"); + { + std::length_error ex("multicast hops socket option resize"); + boost::throw_exception(ex); + } if (ipv6_value_ < 0) ipv4_value_ = 0; else if (ipv6_value_ > 255) @@ -355,7 +368,10 @@ public: else { if (s != sizeof(ipv4_value_)) - throw std::length_error("multicast hops socket option resize"); + { + std::length_error ex("multicast hops socket option resize"); + boost::throw_exception(ex); + } ipv6_value_ = ipv4_value_; } } diff --git a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp index a21950e..fee245b 100644 --- a/3rdParty/Boost/src/boost/asio/ip/host_name.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/host_name.hpp @@ -2,7 +2,7 @@ // host_name.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/icmp.hpp b/3rdParty/Boost/src/boost/asio/ip/icmp.hpp index 1230128..b70d87d 100644 --- a/3rdParty/Boost/src/boost/asio/ip/icmp.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/icmp.hpp @@ -2,7 +2,7 @@ // icmp.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/multicast.hpp b/3rdParty/Boost/src/boost/asio/ip/multicast.hpp index 0f151cd..3aab7f0 100644 --- a/3rdParty/Boost/src/boost/asio/ip/multicast.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/multicast.hpp @@ -2,7 +2,7 @@ // multicast.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp b/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp index 67b5c80..d21b462 100644 --- a/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/resolver_query_base.hpp @@ -2,7 +2,7 @@ // resolver_query_base.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp b/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp index 17a9ac1..1cd12b9 100644 --- a/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/resolver_service.hpp @@ -2,7 +2,7 @@ // resolver_service.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/tcp.hpp b/3rdParty/Boost/src/boost/asio/ip/tcp.hpp index 4c282ab..a42c999 100644 --- a/3rdParty/Boost/src/boost/asio/ip/tcp.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/tcp.hpp @@ -2,7 +2,7 @@ // tcp.hpp // ~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -93,8 +93,10 @@ public: /// The TCP resolver type. typedef basic_resolver<tcp> resolver; +#if !defined(BOOST_NO_IOSTREAM) /// The TCP iostream type. typedef basic_socket_iostream<tcp> iostream; +#endif // !defined(BOOST_NO_IOSTREAM) /// Socket option for disabling the Nagle algorithm. /** diff --git a/3rdParty/Boost/src/boost/asio/ip/udp.hpp b/3rdParty/Boost/src/boost/asio/ip/udp.hpp index 886cad8..e1793c7 100644 --- a/3rdParty/Boost/src/boost/asio/ip/udp.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/udp.hpp @@ -2,7 +2,7 @@ // udp.hpp // ~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/unicast.hpp b/3rdParty/Boost/src/boost/asio/ip/unicast.hpp index f603fed..c97e6fd 100644 --- a/3rdParty/Boost/src/boost/asio/ip/unicast.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/unicast.hpp @@ -2,7 +2,7 @@ // unicast.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp b/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp index 203776d..9adcbff 100644 --- a/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp +++ b/3rdParty/Boost/src/boost/asio/ip/v6_only.hpp @@ -2,7 +2,7 @@ // v6_only.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/is_read_buffered.hpp b/3rdParty/Boost/src/boost/asio/is_read_buffered.hpp index 92dcc96..f0989a2 100644 --- a/3rdParty/Boost/src/boost/asio/is_read_buffered.hpp +++ b/3rdParty/Boost/src/boost/asio/is_read_buffered.hpp @@ -2,7 +2,7 @@ // is_read_buffered.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/is_write_buffered.hpp b/3rdParty/Boost/src/boost/asio/is_write_buffered.hpp index ba0bb3b..bcdf77d 100644 --- a/3rdParty/Boost/src/boost/asio/is_write_buffered.hpp +++ b/3rdParty/Boost/src/boost/asio/is_write_buffered.hpp @@ -2,7 +2,7 @@ // is_write_buffered.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/local/basic_endpoint.hpp b/3rdParty/Boost/src/boost/asio/local/basic_endpoint.hpp index dc927b7..1e4057f 100644 --- a/3rdParty/Boost/src/boost/asio/local/basic_endpoint.hpp +++ b/3rdParty/Boost/src/boost/asio/local/basic_endpoint.hpp @@ -2,7 +2,7 @@ // basic_endpoint.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Derived from a public domain implementation written by Daniel Casimiro. // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/local/connect_pair.hpp b/3rdParty/Boost/src/boost/asio/local/connect_pair.hpp index 39a5e2a..697a0d2 100644 --- a/3rdParty/Boost/src/boost/asio/local/connect_pair.hpp +++ b/3rdParty/Boost/src/boost/asio/local/connect_pair.hpp @@ -2,7 +2,7 @@ // connect_pair.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/local/datagram_protocol.hpp b/3rdParty/Boost/src/boost/asio/local/datagram_protocol.hpp index 75407c2..1441ee6 100644 --- a/3rdParty/Boost/src/boost/asio/local/datagram_protocol.hpp +++ b/3rdParty/Boost/src/boost/asio/local/datagram_protocol.hpp @@ -2,7 +2,7 @@ // datagram_protocol.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/local/stream_protocol.hpp b/3rdParty/Boost/src/boost/asio/local/stream_protocol.hpp index 8839661..f341a8b 100644 --- a/3rdParty/Boost/src/boost/asio/local/stream_protocol.hpp +++ b/3rdParty/Boost/src/boost/asio/local/stream_protocol.hpp @@ -2,7 +2,7 @@ // stream_protocol.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -72,8 +72,10 @@ public: /// The UNIX domain acceptor type. typedef basic_socket_acceptor<stream_protocol> acceptor; +#if !defined(BOOST_NO_IOSTREAM) /// The UNIX domain iostream type. typedef basic_socket_iostream<stream_protocol> iostream; +#endif // !defined(BOOST_NO_IOSTREAM) }; } // namespace local diff --git a/3rdParty/Boost/src/boost/asio/placeholders.hpp b/3rdParty/Boost/src/boost/asio/placeholders.hpp index 67fc18c..55b6fd7 100644 --- a/3rdParty/Boost/src/boost/asio/placeholders.hpp +++ b/3rdParty/Boost/src/boost/asio/placeholders.hpp @@ -2,7 +2,7 @@ // placeholders.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/posix/basic_descriptor.hpp b/3rdParty/Boost/src/boost/asio/posix/basic_descriptor.hpp index 023d5b3..ff9cb87 100644 --- a/3rdParty/Boost/src/boost/asio/posix/basic_descriptor.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/basic_descriptor.hpp @@ -2,7 +2,7 @@ // basic_descriptor.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/posix/basic_stream_descriptor.hpp b/3rdParty/Boost/src/boost/asio/posix/basic_stream_descriptor.hpp index 6559a68..d83a7f7 100644 --- a/3rdParty/Boost/src/boost/asio/posix/basic_stream_descriptor.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/basic_stream_descriptor.hpp @@ -2,7 +2,7 @@ // basic_stream_descriptor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/posix/descriptor_base.hpp b/3rdParty/Boost/src/boost/asio/posix/descriptor_base.hpp index 19a5727..ca93f4d 100644 --- a/3rdParty/Boost/src/boost/asio/posix/descriptor_base.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/descriptor_base.hpp @@ -2,7 +2,7 @@ // descriptor_base.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/posix/stream_descriptor.hpp b/3rdParty/Boost/src/boost/asio/posix/stream_descriptor.hpp index ff728e2..3b01618 100644 --- a/3rdParty/Boost/src/boost/asio/posix/stream_descriptor.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/stream_descriptor.hpp @@ -2,7 +2,7 @@ // stream_descriptor.hpp // ~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/posix/stream_descriptor_service.hpp b/3rdParty/Boost/src/boost/asio/posix/stream_descriptor_service.hpp index 0b6d55f..e64a617 100644 --- a/3rdParty/Boost/src/boost/asio/posix/stream_descriptor_service.hpp +++ b/3rdParty/Boost/src/boost/asio/posix/stream_descriptor_service.hpp @@ -2,7 +2,7 @@ // stream_descriptor_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -24,11 +24,7 @@ #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/reactive_descriptor_service.hpp> #if !defined(BOOST_ASIO_DISABLE_POSIX_STREAM_DESCRIPTOR) # if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) @@ -39,6 +35,20 @@ #if defined(BOOST_ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ || defined(GENERATING_DOCUMENTATION) +#if defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_descriptor_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_descriptor_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_descriptor_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_descriptor_service.hpp> +#endif + namespace boost { namespace asio { namespace posix { diff --git a/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp b/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp index ec7cc2a..1b5c03c 100644 --- a/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp @@ -2,7 +2,7 @@ // raw_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -24,12 +24,23 @@ #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/reactive_socket_service.hpp> -#include <boost/asio/detail/win_iocp_socket_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/read.hpp b/3rdParty/Boost/src/boost/asio/read.hpp index 0faeb02..8243d0f 100644 --- a/3rdParty/Boost/src/boost/asio/read.hpp +++ b/3rdParty/Boost/src/boost/asio/read.hpp @@ -2,7 +2,7 @@ // read.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -170,6 +170,8 @@ template <typename SyncReadStream, typename MutableBufferSequence, std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, CompletionCondition completion_condition, boost::system::error_code& ec); +#if !defined(BOOST_NO_IOSTREAM) + /// Attempt to read a certain amount of data from a stream before returning. /** * This function is used to read a certain number of bytes of data from a @@ -274,6 +276,8 @@ template <typename SyncReadStream, typename Allocator, std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ /** * @defgroup async_read boost::asio::async_read @@ -413,6 +417,8 @@ template <typename AsyncReadStream, typename MutableBufferSequence, void async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, CompletionCondition completion_condition, ReadHandler handler); +#if !defined(BOOST_NO_IOSTREAM) + /// Start an asynchronous operation to read a certain amount of data from a /// stream. /** @@ -516,6 +522,8 @@ template <typename AsyncReadStream, typename Allocator, void async_read(AsyncReadStream& s, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, ReadHandler handler); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ } // namespace asio diff --git a/3rdParty/Boost/src/boost/asio/read_at.hpp b/3rdParty/Boost/src/boost/asio/read_at.hpp index 5b1d5ea..133f143 100644 --- a/3rdParty/Boost/src/boost/asio/read_at.hpp +++ b/3rdParty/Boost/src/boost/asio/read_at.hpp @@ -2,7 +2,7 @@ // read_at.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -186,6 +186,8 @@ std::size_t read_at(SyncRandomAccessReadDevice& d, boost::uint64_t offset, const MutableBufferSequence& buffers, CompletionCondition completion_condition, boost::system::error_code& ec); +#if !defined(BOOST_NO_IOSTREAM) + /// Attempt to read a certain amount of data at the specified offset before /// returning. /** @@ -305,6 +307,8 @@ std::size_t read_at(SyncRandomAccessReadDevice& d, boost::uint64_t offset, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ /** * @defgroup async_read_at boost::asio::async_read_at @@ -449,6 +453,8 @@ void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset, const MutableBufferSequence& buffers, CompletionCondition completion_condition, ReadHandler handler); +#if !defined(BOOST_NO_IOSTREAM) + /// Start an asynchronous operation to read a certain amount of data at the /// specified offset. /** @@ -558,6 +564,8 @@ void async_read_at(AsyncRandomAccessReadDevice& d, boost::uint64_t offset, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, ReadHandler handler); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ } // namespace asio diff --git a/3rdParty/Boost/src/boost/asio/read_until.hpp b/3rdParty/Boost/src/boost/asio/read_until.hpp index 6144e60..2f50072 100644 --- a/3rdParty/Boost/src/boost/asio/read_until.hpp +++ b/3rdParty/Boost/src/boost/asio/read_until.hpp @@ -2,7 +2,7 @@ // read_until.hpp // ~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,8 +18,13 @@ #include <boost/asio/detail/push_options.hpp> #include <boost/asio/detail/push_options.hpp> -#include <cstddef> #include <boost/config.hpp> +#include <boost/asio/detail/pop_options.hpp> + +#if !defined(BOOST_NO_IOSTREAM) + +#include <boost/asio/detail/push_options.hpp> +#include <cstddef> #include <boost/regex.hpp> #include <boost/type_traits/is_function.hpp> #include <boost/type_traits/remove_pointer.hpp> @@ -836,6 +841,8 @@ void async_read_until(AsyncReadStream& s, #include <boost/asio/impl/read_until.ipp> +#endif // !defined(BOOST_NO_IOSTREAM) + #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_READ_UNTIL_HPP diff --git a/3rdParty/Boost/src/boost/asio/serial_port.hpp b/3rdParty/Boost/src/boost/asio/serial_port.hpp index 0be39e0..00546e8 100644 --- a/3rdParty/Boost/src/boost/asio/serial_port.hpp +++ b/3rdParty/Boost/src/boost/asio/serial_port.hpp @@ -2,7 +2,7 @@ // serial_port.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/serial_port_base.hpp b/3rdParty/Boost/src/boost/asio/serial_port_base.hpp index 98557cd..5f96639 100644 --- a/3rdParty/Boost/src/boost/asio/serial_port_base.hpp +++ b/3rdParty/Boost/src/boost/asio/serial_port_base.hpp @@ -2,7 +2,7 @@ // serial_port_base.hpp // ~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/3rdParty/Boost/src/boost/asio/serial_port_service.hpp b/3rdParty/Boost/src/boost/asio/serial_port_service.hpp index fe2ce94..3abd244 100644 --- a/3rdParty/Boost/src/boost/asio/serial_port_service.hpp +++ b/3rdParty/Boost/src/boost/asio/serial_port_service.hpp @@ -2,7 +2,7 @@ // serial_port_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/socket_acceptor_service.hpp b/3rdParty/Boost/src/boost/asio/socket_acceptor_service.hpp index ba78746..edca5b7 100644 --- a/3rdParty/Boost/src/boost/asio/socket_acceptor_service.hpp +++ b/3rdParty/Boost/src/boost/asio/socket_acceptor_service.hpp @@ -2,7 +2,7 @@ // socket_acceptor_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -20,12 +20,23 @@ #include <boost/asio/basic_socket.hpp> #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/reactive_socket_service.hpp> -#include <boost/asio/detail/win_iocp_socket_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/socket_base.hpp b/3rdParty/Boost/src/boost/asio/socket_base.hpp index 5a1b675..75015bf 100644 --- a/3rdParty/Boost/src/boost/asio/socket_base.hpp +++ b/3rdParty/Boost/src/boost/asio/socket_base.hpp @@ -2,7 +2,7 @@ // socket_base.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/strand.hpp b/3rdParty/Boost/src/boost/asio/strand.hpp index b130a84..a64d486 100644 --- a/3rdParty/Boost/src/boost/asio/strand.hpp +++ b/3rdParty/Boost/src/boost/asio/strand.hpp @@ -2,7 +2,7 @@ // strand.hpp // ~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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,6 +30,46 @@ namespace asio { * handlers with the guarantee that none of those handlers will execute * concurrently. * + * @par Order of handler invocation + * Given: + * + * @li a strand object @c s + * + * @li an object @c a meeting completion handler requirements + * + * @li an object @c a1 which is an arbitrary copy of @c a made by the + * implementation + * + * @li an object @c b meeting completion handler requirements + * + * @li an object @c b1 which is an arbitrary copy of @c b made by the + * implementation + * + * if any of the following conditions are true: + * + * @li @c s.post(a) happens-before @c s.post(b) + * + * @li @c s.post(a) happens-before @c s.dispatch(b), where the latter is + * performed outside the strand + * + * @li @c s.dispatch(a) happens-before @c s.post(b), where the former is + * performed outside the strand + * + * @li @c s.dispatch(a) happens-before @c s.dispatch(b), where both are + * performed outside the strand + * + * then @c asio_handler_invoke(a1, &a1) happens-before + * @c asio_handler_invoke(b1, &b1). + * + * Note that in the following case: + * @code async_op_1(..., s.wrap(a)); + * async_op_2(..., s.wrap(b)); @endcode + * the completion of the first async operation will perform @c s.dispatch(a), + * and the second will perform @c s.dispatch(b), but the order in which those + * are performed is unspecified. That is, you cannot state whether one + * happens-before the other. Therefore none of the above conditions are met and + * no ordering guarantee is made. + * * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Safe. diff --git a/3rdParty/Boost/src/boost/asio/stream_socket_service.hpp b/3rdParty/Boost/src/boost/asio/stream_socket_service.hpp index 502c293..6a8dd36 100644 --- a/3rdParty/Boost/src/boost/asio/stream_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/stream_socket_service.hpp @@ -2,7 +2,7 @@ // stream_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -24,12 +24,23 @@ #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> -#include <boost/asio/detail/epoll_reactor.hpp> -#include <boost/asio/detail/kqueue_reactor.hpp> -#include <boost/asio/detail/select_reactor.hpp> #include <boost/asio/detail/service_base.hpp> -#include <boost/asio/detail/win_iocp_socket_service.hpp> -#include <boost/asio/detail/reactive_socket_service.hpp> + +#if defined(BOOST_ASIO_HAS_IOCP) +# include <boost/asio/detail/win_iocp_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_EPOLL) +# include <boost/asio/detail/epoll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_KQUEUE) +# include <boost/asio/detail/kqueue_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#elif defined(BOOST_ASIO_HAS_DEV_POLL) +# include <boost/asio/detail/dev_poll_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#else +# include <boost/asio/detail/select_reactor.hpp> +# include <boost/asio/detail/reactive_socket_service.hpp> +#endif namespace boost { namespace asio { diff --git a/3rdParty/Boost/src/boost/asio/streambuf.hpp b/3rdParty/Boost/src/boost/asio/streambuf.hpp index 63c8a41..c112e64 100644 --- a/3rdParty/Boost/src/boost/asio/streambuf.hpp +++ b/3rdParty/Boost/src/boost/asio/streambuf.hpp @@ -2,7 +2,7 @@ // streambuf.hpp // ~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -19,6 +19,8 @@ #include <boost/asio/basic_streambuf.hpp> +#if !defined(BOOST_NO_IOSTREAM) + namespace boost { namespace asio { @@ -28,6 +30,8 @@ typedef basic_streambuf<> streambuf; } // namespace asio } // namespace boost +#endif // !defined(BOOST_NO_IOSTREAM) + #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_STREAMBUF_HPP diff --git a/3rdParty/Boost/src/boost/asio/time_traits.hpp b/3rdParty/Boost/src/boost/asio/time_traits.hpp index 097ece4..e0f40ca 100644 --- a/3rdParty/Boost/src/boost/asio/time_traits.hpp +++ b/3rdParty/Boost/src/boost/asio/time_traits.hpp @@ -2,7 +2,7 @@ // time_traits.hpp // ~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -43,7 +43,11 @@ struct time_traits<boost::posix_time::ptime> /// Get the current time. static time_type now() { +#if defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) return boost::posix_time::microsec_clock::universal_time(); +#else // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) + return boost::posix_time::second_clock::universal_time(); +#endif // defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) } /// Add a duration to a time. diff --git a/3rdParty/Boost/src/boost/asio/version.hpp b/3rdParty/Boost/src/boost/asio/version.hpp index bb10dc7..67e9171 100644 --- a/3rdParty/Boost/src/boost/asio/version.hpp +++ b/3rdParty/Boost/src/boost/asio/version.hpp @@ -2,7 +2,7 @@ // version.hpp // ~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -18,6 +18,6 @@ // BOOST_ASIO_VERSION % 100 is the sub-minor version // BOOST_ASIO_VERSION / 100 % 1000 is the minor version // BOOST_ASIO_VERSION / 100000 is the major version -#define BOOST_ASIO_VERSION 100402 // 1.4.2 +#define BOOST_ASIO_VERSION 100404 // 1.4.4 #endif // BOOST_ASIO_VERSION_HPP diff --git a/3rdParty/Boost/src/boost/asio/windows/basic_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/basic_handle.hpp index 96a7b90..7bbdb0d 100644 --- a/3rdParty/Boost/src/boost/asio/windows/basic_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/basic_handle.hpp @@ -2,7 +2,7 @@ // basic_handle.hpp // ~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/windows/basic_random_access_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/basic_random_access_handle.hpp index d6b63b1..06239df 100644 --- a/3rdParty/Boost/src/boost/asio/windows/basic_random_access_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/basic_random_access_handle.hpp @@ -2,7 +2,7 @@ // basic_random_access_handle.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/windows/basic_stream_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/basic_stream_handle.hpp index aaa8448..329cc6f 100644 --- a/3rdParty/Boost/src/boost/asio/windows/basic_stream_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/basic_stream_handle.hpp @@ -2,7 +2,7 @@ // basic_stream_handle.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/windows/overlapped_ptr.hpp b/3rdParty/Boost/src/boost/asio/windows/overlapped_ptr.hpp index e97c16e..5880272 100644 --- a/3rdParty/Boost/src/boost/asio/windows/overlapped_ptr.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/overlapped_ptr.hpp @@ -2,7 +2,7 @@ // overlapped_ptr.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/windows/random_access_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/random_access_handle.hpp index 38e79e9..7707aac 100644 --- a/3rdParty/Boost/src/boost/asio/windows/random_access_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/random_access_handle.hpp @@ -2,7 +2,7 @@ // random_access_handle.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/windows/random_access_handle_service.hpp b/3rdParty/Boost/src/boost/asio/windows/random_access_handle_service.hpp index 3b11223..fbbde67 100644 --- a/3rdParty/Boost/src/boost/asio/windows/random_access_handle_service.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/random_access_handle_service.hpp @@ -2,7 +2,7 @@ // random_access_handle_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/windows/stream_handle.hpp b/3rdParty/Boost/src/boost/asio/windows/stream_handle.hpp index b247197..8e9e467 100644 --- a/3rdParty/Boost/src/boost/asio/windows/stream_handle.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/stream_handle.hpp @@ -2,7 +2,7 @@ // stream_handle.hpp // ~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/windows/stream_handle_service.hpp b/3rdParty/Boost/src/boost/asio/windows/stream_handle_service.hpp index 29cdc95..c2224e4 100644 --- a/3rdParty/Boost/src/boost/asio/windows/stream_handle_service.hpp +++ b/3rdParty/Boost/src/boost/asio/windows/stream_handle_service.hpp @@ -2,7 +2,7 @@ // stream_handle_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) diff --git a/3rdParty/Boost/src/boost/asio/write.hpp b/3rdParty/Boost/src/boost/asio/write.hpp index 61d59a0..2b9d4b7 100644 --- a/3rdParty/Boost/src/boost/asio/write.hpp +++ b/3rdParty/Boost/src/boost/asio/write.hpp @@ -2,7 +2,7 @@ // write.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -169,6 +169,8 @@ template <typename SyncWriteStream, typename ConstBufferSequence, std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, CompletionCondition completion_condition, boost::system::error_code& ec); +#if !defined(BOOST_NO_IOSTREAM) + /// Write all of the supplied data to a stream before returning. /** * This function is used to write a certain number of bytes of data to a stream. @@ -279,6 +281,8 @@ template <typename SyncWriteStream, typename Allocator, std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ /** * @defgroup async_write boost::asio::async_write @@ -411,6 +415,8 @@ template <typename AsyncWriteStream, typename ConstBufferSequence, void async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, CompletionCondition completion_condition, WriteHandler handler); +#if !defined(BOOST_NO_IOSTREAM) + /// Start an asynchronous operation to write all of the supplied data to a /// stream. /** @@ -510,6 +516,8 @@ template <typename AsyncWriteStream, typename Allocator, void async_write(AsyncWriteStream& s, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, WriteHandler handler); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ } // namespace asio diff --git a/3rdParty/Boost/src/boost/asio/write_at.hpp b/3rdParty/Boost/src/boost/asio/write_at.hpp index 85efbc2..74f080a 100644 --- a/3rdParty/Boost/src/boost/asio/write_at.hpp +++ b/3rdParty/Boost/src/boost/asio/write_at.hpp @@ -2,7 +2,7 @@ // write_at.hpp // ~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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) @@ -182,6 +182,8 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, boost::uint64_t offset, const ConstBufferSequence& buffers, CompletionCondition completion_condition, boost::system::error_code& ec); +#if !defined(BOOST_NO_IOSTREAM) + /// Write all of the supplied data at the specified offset before returning. /** * This function is used to write a certain number of bytes of data to a random @@ -303,6 +305,8 @@ std::size_t write_at(SyncRandomAccessWriteDevice& d, boost::uint64_t offset, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, boost::system::error_code& ec); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ /** * @defgroup async_write_at boost::asio::async_write_at @@ -440,6 +444,8 @@ void async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset, const ConstBufferSequence& buffers, CompletionCondition completion_condition, WriteHandler handler); +#if !defined(BOOST_NO_IOSTREAM) + /// Start an asynchronous operation to write all of the supplied data at the /// specified offset. /** @@ -545,6 +551,8 @@ void async_write_at(AsyncRandomAccessWriteDevice& d, boost::uint64_t offset, basic_streambuf<Allocator>& b, CompletionCondition completion_condition, WriteHandler handler); +#endif // !defined(BOOST_NO_IOSTREAM) + /*@}*/ } // namespace asio diff --git a/3rdParty/Boost/src/boost/bind/bind.hpp b/3rdParty/Boost/src/boost/bind/bind.hpp index 1e5c9e0..a63d2a0 100644 --- a/3rdParty/Boost/src/boost/bind/bind.hpp +++ b/3rdParty/Boost/src/boost/bind/bind.hpp @@ -207,6 +207,13 @@ public: } }; +#ifdef BOOST_MSVC +// MSVC is bright enough to realise that the parameter rhs +// in operator==may be unused for some template argument types: +#pragma warning(push) +#pragma warning(disable:4100) +#endif + template< class A1 > class list1: private storage1< A1 > { private: @@ -846,6 +853,10 @@ public: } }; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + // bind_t #ifndef BOOST_NO_VOID_RETURNS @@ -1629,7 +1640,7 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl // data member pointers #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \ - || ( defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, <= 0x610 ) ) + || ( defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x620 ) ) ) template<class R, class T, class A1> _bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type > @@ -1654,7 +1665,14 @@ template< class M, class T > struct add_cref< M T::*, 0 > template< class M, class T > struct add_cref< M T::*, 1 > { +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4180) +#endif typedef M const & type; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif }; template< class R, class T > struct add_cref< R (T::*) (), 1 > diff --git a/3rdParty/Boost/src/boost/bind/mem_fn_template.hpp b/3rdParty/Boost/src/boost/bind/mem_fn_template.hpp index 1db0713..b26d585 100644 --- a/3rdParty/Boost/src/boost/bind/mem_fn_template.hpp +++ b/3rdParty/Boost/src/boost/bind/mem_fn_template.hpp @@ -51,14 +51,16 @@ public: template<class U> R operator()(U & u) const { - BOOST_MEM_FN_RETURN call(u, &u); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template<class U> R operator()(U const & u) const { - BOOST_MEM_FN_RETURN call(u, &u); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p); } #endif @@ -109,7 +111,8 @@ public: template<class U> R operator()(U const & u) const { - BOOST_MEM_FN_RETURN call(u, &u); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p); } R operator()(T const & t) const @@ -164,14 +167,16 @@ public: template<class U> R operator()(U & u, A1 a1) const { - BOOST_MEM_FN_RETURN call(u, &u, a1); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template<class U> R operator()(U const & u, A1 a1) const { - BOOST_MEM_FN_RETURN call(u, &u, a1); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1); } #endif @@ -223,7 +228,8 @@ public: template<class U> R operator()(U const & u, A1 a1) const { - BOOST_MEM_FN_RETURN call(u, &u, a1); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1); } R operator()(T const & t, A1 a1) const @@ -276,14 +282,16 @@ public: template<class U> R operator()(U & u, A1 a1, A2 a2) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template<class U> R operator()(U const & u, A1 a1, A2 a2) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2); } #endif @@ -333,7 +341,8 @@ public: template<class U> R operator()(U const & u, A1 a1, A2 a2) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2); } R operator()(T const & t, A1 a1, A2 a2) const @@ -386,14 +395,16 @@ public: template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); } #endif @@ -443,7 +454,8 @@ public: template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); } R operator()(T const & t, A1 a1, A2 a2, A3 a3) const @@ -496,14 +508,16 @@ public: template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); } #endif @@ -553,7 +567,8 @@ public: template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4) const @@ -606,14 +621,16 @@ public: template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); } #endif @@ -663,7 +680,8 @@ public: template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const @@ -716,14 +734,16 @@ public: template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); } #endif @@ -773,7 +793,8 @@ public: template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const @@ -826,14 +847,16 @@ public: template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); } #endif @@ -883,7 +906,8 @@ public: template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const @@ -936,14 +960,16 @@ public: template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); } #endif @@ -998,7 +1024,8 @@ public: template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const diff --git a/3rdParty/Boost/src/boost/config/compiler/borland.hpp b/3rdParty/Boost/src/boost/config/compiler/borland.hpp index c6413b3..6a7b988 100644 --- a/3rdParty/Boost/src/boost/config/compiler/borland.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/borland.hpp @@ -17,7 +17,7 @@ #endif // last known compiler version: -#if (__BORLANDC__ > 0x610) +#if (__BORLANDC__ > 0x613) //# if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" //# else @@ -66,7 +66,6 @@ // Borland C++ Builder 6 and below: #if (__BORLANDC__ <= 0x564) -# define BOOST_NO_INTEGRAL_INT64_T # ifdef NDEBUG // fix broken <cstring> so that Boost.test works: @@ -107,28 +106,30 @@ # endif #endif -// Borland C++ Builder 2007 December 2007 Update and below: -//#if (__BORLANDC__ <= 0x593) -#if (__BORLANDC__ <= 0x610) // Beman has asked Alisdair for more info +#if (__BORLANDC__ <= 0x613) // Beman has asked Alisdair for more info // we shouldn't really need this - but too many things choke // without it, this needs more investigation: # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS # define BOOST_NO_IS_ABSTRACT # define BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS +# define BOOST_NO_USING_TEMPLATE +# define BOOST_SP_NO_SP_CONVERTIBLE // Temporary workaround #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS #endif // Borland C++ Builder 2008 and below: -#if (__BORLANDC__ <= 0x601) +# define BOOST_NO_INTEGRAL_INT64_T # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -# define BOOST_ILLEGAL_CV_REFERENCES # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_TWO_PHASE_NAME_LOOKUP -# define BOOST_NO_USING_TEMPLATE # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE +# define BOOST_NO_NESTED_FRIENDSHIP +# define BOOST_NO_TYPENAME_WITH_CTOR +#if (__BORLANDC__ < 0x600) +# define BOOST_ILLEGAL_CV_REFERENCES #endif // @@ -141,7 +142,16 @@ // // C++0x Macros: // -#if defined( BOOST_CODEGEAR_0X_SUPPORT ) && (__BORLANDC__ >= 0x610) +#if !defined( BOOST_CODEGEAR_0X_SUPPORT ) || (__BORLANDC__ < 0x610) +# define BOOST_NO_CHAR16_T +# define BOOST_NO_CHAR32_T +# define BOOST_NO_DECLTYPE +# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS +# define BOOST_NO_EXTERN_TEMPLATE +# define BOOST_NO_RVALUE_REFERENCES +# define BOOST_NO_SCOPED_ENUMS +# define BOOST_NO_STATIC_ASSERT +#else # define BOOST_HAS_ALIGNOF # define BOOST_HAS_CHAR16_T # define BOOST_HAS_CHAR32_T @@ -150,35 +160,25 @@ # define BOOST_HAS_REF_QUALIFIER # define BOOST_HAS_RVALUE_REFS # define BOOST_HAS_STATIC_ASSERT - -# define BOOST_NO_EXTERN_TEMPLATE -# define BOOST_NO_SCOPED_ENUMS -# define BOOST_NO_VARIADIC_TEMPLATES -# define BOOST_NO_CONSTEXPR -# define BOOST_NO_DEFAULTED_FUNCTIONS -# define BOOST_NO_DELETED_FUNCTIONS -# define BOOST_NO_RAW_LITERALS -# define BOOST_NO_UNICODE_LITERALS // UTF-8 still not supported -#else -# define BOOST_NO_CHAR16_T -# define BOOST_NO_CHAR32_T -# define BOOST_NO_DECLTYPE -# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -# define BOOST_NO_EXTERN_TEMPLATE -# define BOOST_NO_SCOPED_ENUMS -# define BOOST_NO_STATIC_ASSERT -# define BOOST_NO_RVALUE_REFERENCES -# define BOOST_NO_VARIADIC_TEMPLATES -# define BOOST_NO_CONSTEXPR -# define BOOST_NO_DEFAULTED_FUNCTIONS -# define BOOST_NO_DELETED_FUNCTIONS -# define BOOST_NO_RAW_LITERALS -# define BOOST_NO_UNICODE_LITERALS #endif #define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_AUTO_MULTIDECLARATIONS +#define BOOST_NO_CONCEPTS +#define BOOST_NO_CONSTEXPR +#define BOOST_NO_DEFAULTED_FUNCTIONS +#define BOOST_NO_DELETED_FUNCTIONS +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS #define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR +#define BOOST_NO_RAW_LITERALS +#define BOOST_NO_RVALUE_REFERENCES +#define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_TEMPLATE_ALIASES +#define BOOST_NO_UNICODE_LITERALS // UTF-8 still not supported +#define BOOST_NO_VARIADIC_TEMPLATES #if __BORLANDC__ >= 0x590 # define BOOST_HAS_TR1_HASH @@ -236,7 +236,7 @@ // // ABI fixing headers: // -#if __BORLANDC__ < 0x600 // not implemented for version 6 compiler yet +#if __BORLANDC__ != 0x600 // not implemented for version 6 compiler yet #ifndef BOOST_ABI_PREFIX # define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp" #endif diff --git a/3rdParty/Boost/src/boost/config/compiler/codegear.hpp b/3rdParty/Boost/src/boost/config/compiler/codegear.hpp index 803d17a..698624e 100644 --- a/3rdParty/Boost/src/boost/config/compiler/codegear.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/codegear.hpp @@ -19,8 +19,8 @@ #endif // // versions check: -// last known and checked version is 0x610 -#if (__CODEGEARC__ > 0x610) +// last known and checked version is 0x620 +#if (__CODEGEARC__ > 0x620) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else @@ -29,20 +29,25 @@ #endif // CodeGear C++ Builder 2009 -#if (__CODEGEARC__ <= 0x610) -# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL +#if (__CODEGEARC__ <= 0x613) +# define BOOST_NO_INTEGRAL_INT64_T # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS -# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_PRIVATE_IN_AGGREGATE -# define BOOST_NO_TWO_PHASE_NAME_LOOKUP # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE -# define BOOST_NO_USING_TEMPLATE // we shouldn't really need this - but too many things choke // without it, this needs more investigation: # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +# define BOOST_SP_NO_SP_CONVERTIBLE +#endif + +// CodeGear C++ Builder 2010 +#if (__CODEGEARC__ <= 0x620) # define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type +# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL +# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member - +# define BOOST_NO_USING_TEMPLATE +# define BOOST_NO_TWO_PHASE_NAME_LOOKUP // Temporary hack, until specific MPL preprocessed headers are generated # define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS @@ -58,7 +63,6 @@ # endif #endif - // // C++0x macros: // @@ -73,18 +77,24 @@ // #define BOOST_HAS_STATIC_ASSERT #define BOOST_HAS_STD_TYPE_TRAITS -#define BOOST_NO_EXTERN_TEMPLATE -#define BOOST_NO_SCOPED_ENUMS -#define BOOST_NO_STATIC_ASSERT -#define BOOST_NO_RVALUE_REFERENCES -#define BOOST_NO_VARIADIC_TEMPLATES +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS +#define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS +#define BOOST_NO_RVALUE_REFERENCES +#define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS +#define BOOST_NO_VARIADIC_TEMPLATES // // TR1 macros: diff --git a/3rdParty/Boost/src/boost/config/compiler/common_edg.hpp b/3rdParty/Boost/src/boost/config/compiler/common_edg.hpp index 3e62bb0..9dc4cef 100644 --- a/3rdParty/Boost/src/boost/config/compiler/common_edg.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/common_edg.hpp @@ -43,11 +43,6 @@ # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #endif -#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG) -// No support for initializer lists -# define BOOST_NO_INITIALIZER_LISTS -#endif - // See also kai.hpp which checks a Kai-specific symbol for EH # if !defined(__KCC) && !defined(__EXCEPTIONS) # define BOOST_NO_EXCEPTIONS @@ -64,22 +59,34 @@ // // See above for BOOST_NO_LONG_LONG // +#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG) +// No support for initializer lists +# define BOOST_NO_INITIALIZER_LISTS +#endif + +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS #define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS + #ifdef c_plusplus // EDG has "long long" in non-strict mode // However, some libraries have insufficient "long long" support diff --git a/3rdParty/Boost/src/boost/config/compiler/digitalmars.hpp b/3rdParty/Boost/src/boost/config/compiler/digitalmars.hpp index 5984312..a01b4c2 100644 --- a/3rdParty/Boost/src/boost/config/compiler/digitalmars.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/digitalmars.hpp @@ -26,7 +26,6 @@ #define BOOST_NO_SFINAE #define BOOST_NO_USING_TEMPLATE #define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL -#define BOOST_NO_INITIALIZER_LISTS #endif // @@ -59,22 +58,29 @@ // // C++0x features // +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS #define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS + #if __DMC__ < 0x800 #error "Compiler not supported or configured - please reconfigure" #endif diff --git a/3rdParty/Boost/src/boost/config/compiler/gcc.hpp b/3rdParty/Boost/src/boost/config/compiler/gcc.hpp index 62bf45e..6cae94c 100644 --- a/3rdParty/Boost/src/boost/config/compiler/gcc.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/gcc.hpp @@ -64,6 +64,9 @@ // All problems to gcc-3.x and earlier here: // #define BOOST_NO_TWO_PHASE_NAME_LOOKUP +# ifdef __OPEN64__ +# define BOOST_NO_IS_ABSTRACT +# endif #endif #ifndef __EXCEPTIONS @@ -101,23 +104,18 @@ # endif #endif +// C++0x features not implemented in any GCC version // -// C++0x features -// - -#define BOOST_NO_CHAR16_T -#define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR -#define BOOST_NO_DEFAULTED_FUNCTIONS -#define BOOST_NO_DELETED_FUNCTIONS -#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS -#define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS -// See below for BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS +// C++0x features in 4.3.n and later +// #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__) // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are // passed on the command line, which in turn defines @@ -128,6 +126,7 @@ # define BOOST_HAS_VARIADIC_TMPL #else # define BOOST_NO_DECLTYPE +# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS # define BOOST_NO_RVALUE_REFERENCES # define BOOST_NO_STATIC_ASSERT @@ -140,9 +139,35 @@ # endif #endif -#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) -# define BOOST_NO_INITIALIZER_LISTS +// C++0x features in 4.4.n and later +// +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__) # define BOOST_NO_AUTO_DECLARATIONS +# define BOOST_NO_AUTO_MULTIDECLARATIONS +# define BOOST_NO_CHAR16_T +# define BOOST_NO_CHAR32_T +# define BOOST_NO_DEFAULTED_FUNCTIONS +# define BOOST_NO_DELETED_FUNCTIONS +# define BOOST_NO_INITIALIZER_LISTS +# define BOOST_NO_SCOPED_ENUMS +#endif + +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) +# define BOOST_NO_SFINAE_EXPR +#endif + +// C++0x features in 4.4.1 and later +// +#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40401) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_SCOPED_ENUMS before 4.4.1 +// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064 +# define BOOST_NO_SCOPED_ENUMS +#endif + +// C++0x features in 4.5.n and later +// +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #endif // ConceptGCC compiler: @@ -150,6 +175,8 @@ #ifdef __GXX_CONCEPTS__ # define BOOST_HAS_CONCEPTS # define BOOST_COMPILER "ConceptGCC version " __VERSION__ +#else +# define BOOST_NO_CONCEPTS #endif #ifndef BOOST_COMPILER @@ -163,8 +190,8 @@ # error "Compiler not configured - please reconfigure" #endif // -// last known and checked version is 4.3 (Pre-release): -#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 3)) +// last known and checked version is 4.4 (Pre-release): +#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 4)) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else diff --git a/3rdParty/Boost/src/boost/config/compiler/hp_acc.hpp b/3rdParty/Boost/src/boost/config/compiler/hp_acc.hpp index 0c3cc9a..98e7772 100644 --- a/3rdParty/Boost/src/boost/config/compiler/hp_acc.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/hp_acc.hpp @@ -90,22 +90,32 @@ // // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // +#if !defined(__EDG__) + +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS #define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS +#endif // // last known and checked version for HP-UX/ia64 is 61300 diff --git a/3rdParty/Boost/src/boost/config/compiler/intel.hpp b/3rdParty/Boost/src/boost/config/compiler/intel.hpp index e4d1b07..531242e 100644 --- a/3rdParty/Boost/src/boost/config/compiler/intel.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/intel.hpp @@ -99,7 +99,7 @@ # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # endif #endif -#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1100) +#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1110) // GCC or VC emulation: #define BOOST_NO_TWO_PHASE_NAME_LOOKUP #endif @@ -158,30 +158,8 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {}; #endif // -// C++0x features -// -// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG -// -#define BOOST_NO_CHAR16_T -#define BOOST_NO_CHAR32_T -#define BOOST_NO_CONSTEXPR -#define BOOST_NO_DECLTYPE -#define BOOST_NO_DEFAULTED_FUNCTIONS -#define BOOST_NO_DELETED_FUNCTIONS -#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define BOOST_NO_EXTERN_TEMPLATE -#define BOOST_NO_RAW_LITERALS -#define BOOST_NO_RVALUE_REFERENCES -#define BOOST_NO_SCOPED_ENUMS -#define BOOST_NO_STATIC_ASSERT -#define BOOST_NO_UNICODE_LITERALS -#define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS - -// // last known and checked version: -#if (BOOST_INTEL_CXX_VERSION > 1100) +#if (BOOST_INTEL_CXX_VERSION > 1110) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # elif defined(_MSC_VER) diff --git a/3rdParty/Boost/src/boost/config/compiler/kai.hpp b/3rdParty/Boost/src/boost/config/compiler/kai.hpp index de16f1a..ea06f9f 100644 --- a/3rdParty/Boost/src/boost/config/compiler/kai.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/kai.hpp @@ -21,8 +21,6 @@ # define BOOST_NO_EXCEPTIONS # endif -#define BOOST_COMPILER "Kai C++ version " BOOST_STRINGIZE(__KCC_VERSION) - // // last known and checked version is 4001: #if (__KCC_VERSION > 4001) diff --git a/3rdParty/Boost/src/boost/config/compiler/metrowerks.hpp b/3rdParty/Boost/src/boost/config/compiler/metrowerks.hpp index 5f6e0fe..aeba7f8 100644 --- a/3rdParty/Boost/src/boost/config/compiler/metrowerks.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/metrowerks.hpp @@ -39,10 +39,9 @@ // the "|| !defined(BOOST_STRICT_CONFIG)" part should apply to the last // tested version *only*: -# if(__MWERKS__ <= 0x3206) || !defined(BOOST_STRICT_CONFIG) // 9.5 +# if(__MWERKS__ <= 0x3207) || !defined(BOOST_STRICT_CONFIG) // 9.6 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_IS_ABSTRACT -# define BOOST_NO_INITIALIZER_LISTS # endif #if !__option(wchar_type) @@ -74,6 +73,8 @@ # define BOOST_COMPILER_VERSION 9.4 # elif __MWERKS__ == 0x3206 # define BOOST_COMPILER_VERSION 9.5 +# elif __MWERKS__ == 0x3207 +# define BOOST_COMPILER_VERSION 9.6 # else # define BOOST_COMPILER_VERSION __MWERKS__ # endif @@ -91,21 +92,28 @@ #else # define BOOST_NO_RVALUE_REFERENCES #endif +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS #define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) diff --git a/3rdParty/Boost/src/boost/config/compiler/mpw.hpp b/3rdParty/Boost/src/boost/config/compiler/mpw.hpp index 1d72406..4db14dd 100644 --- a/3rdParty/Boost/src/boost/config/compiler/mpw.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/mpw.hpp @@ -33,7 +33,6 @@ # define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */ -# define BOOST_NO_INITIALIZER_LISTS #endif // @@ -41,22 +40,29 @@ // // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS #define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS // // versions check: diff --git a/3rdParty/Boost/src/boost/config/compiler/pgi.hpp b/3rdParty/Boost/src/boost/config/compiler/pgi.hpp index ce09e2a..e40553e 100644 --- a/3rdParty/Boost/src/boost/config/compiler/pgi.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/pgi.hpp @@ -21,7 +21,6 @@ #define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #define BOOST_NO_TWO_PHASE_NAME_LOOKUP #define BOOST_NO_SWPRINTF -#define BOOST_NO_INITIALIZER_LISTS #else @@ -33,22 +32,29 @@ // // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS #define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS // // version check: diff --git a/3rdParty/Boost/src/boost/config/compiler/sgi_mipspro.hpp b/3rdParty/Boost/src/boost/config/compiler/sgi_mipspro.hpp index f6a86ad..9068831 100644 --- a/3rdParty/Boost/src/boost/config/compiler/sgi_mipspro.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/sgi_mipspro.hpp @@ -22,29 +22,6 @@ #undef BOOST_NO_SWPRINTF #undef BOOST_DEDUCED_TYPENAME -#define BOOST_NO_INITIALIZER_LISTS -// -// C++0x features -// -// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG -// -#define BOOST_NO_CHAR16_T -#define BOOST_NO_CHAR32_T -#define BOOST_NO_CONSTEXPR -#define BOOST_NO_DECLTYPE -#define BOOST_NO_DEFAULTED_FUNCTIONS -#define BOOST_NO_DELETED_FUNCTIONS -#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define BOOST_NO_EXTERN_TEMPLATE -#define BOOST_NO_RAW_LITERALS -#define BOOST_NO_RVALUE_REFERENCES -#define BOOST_NO_SCOPED_ENUMS -#define BOOST_NO_STATIC_ASSERT -#define BOOST_NO_UNICODE_LITERALS -#define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS - // // version check: // probably nothing to do here? diff --git a/3rdParty/Boost/src/boost/config/compiler/sunpro_cc.hpp b/3rdParty/Boost/src/boost/config/compiler/sunpro_cc.hpp index 6553a46..f518488 100644 --- a/3rdParty/Boost/src/boost/config/compiler/sunpro_cc.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/sunpro_cc.hpp @@ -74,7 +74,6 @@ // #define BOOST_NO_TWO_PHASE_NAME_LOOKUP #define BOOST_NO_ADL_BARRIER -#define BOOST_NO_INITIALIZER_LISTS // // C++0x features @@ -86,22 +85,29 @@ # define BOOST_NO_LONG_LONG #endif +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS #define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS // // Version diff --git a/3rdParty/Boost/src/boost/config/compiler/vacpp.hpp b/3rdParty/Boost/src/boost/config/compiler/vacpp.hpp index eb75cdb..01956d3 100644 --- a/3rdParty/Boost/src/boost/config/compiler/vacpp.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/vacpp.hpp @@ -47,7 +47,7 @@ #endif // // last known and checked version is 600: -#if (__IBMCPP__ > 600) +#if (__IBMCPP__ > 1010) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif @@ -61,22 +61,28 @@ // // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_LAMBDAS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS #define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS diff --git a/3rdParty/Boost/src/boost/config/compiler/visualc.hpp b/3rdParty/Boost/src/boost/config/compiler/visualc.hpp index 552e5bb..990901f 100644 --- a/3rdParty/Boost/src/boost/config/compiler/visualc.hpp +++ b/3rdParty/Boost/src/boost/config/compiler/visualc.hpp @@ -14,6 +14,12 @@ #define BOOST_MSVC _MSC_VER +#if _MSC_FULL_VER > 100000000 +# define BOOST_MSVC_FULL_VER _MSC_FULL_VER +#else +# define BOOST_MSVC_FULL_VER (_MSC_FULL_VER * 10) +#endif + // turn off the warnings before we #include anything #pragma warning( disable : 4503 ) // warning: decorated name length exceeded @@ -119,7 +125,7 @@ #if (_MSC_VER >= 1200) # define BOOST_HAS_MS_INT64 #endif -#if (_MSC_VER >= 1310) && defined(_MSC_EXTENSIONS) +#if (_MSC_VER >= 1310) && (defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1500)) # define BOOST_HAS_LONG_LONG #else # define BOOST_NO_LONG_LONG @@ -131,10 +137,10 @@ // disable Win32 API's if compiler extentions are // turned off: // -#ifndef _MSC_EXTENSIONS +#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32) # define BOOST_DISABLE_WIN32 #endif -#ifndef _CPPRTTI +#if !defined(_CPPRTTI) && !defined(BOOST_NO_RTTI) # define BOOST_NO_RTTI #endif @@ -142,31 +148,42 @@ // all versions support __declspec: // #define BOOST_HAS_DECLSPEC + // // C++0x features // // See above for BOOST_NO_LONG_LONG + +// C++ features supported by VC++ 10 (aka 2010) +// +#if _MSC_VER < 1600 +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_AUTO_MULTIDECLARATIONS +#define BOOST_NO_DECLTYPE +#define BOOST_NO_LAMBDAS +#define BOOST_NO_RVALUE_REFERENCES +#define BOOST_NO_STATIC_ASSERT +#endif // _MSC_VER < 1600 + +// C++0x features not supported by any versions #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T +#define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR -#define BOOST_NO_DECLTYPE #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_NULLPTR #define BOOST_NO_RAW_LITERALS #define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES -// MSVC 2010 CTP has some support for C++0x, but we still disable it until the compiler release -// #if _MSC_VER < 1600 -#define BOOST_NO_RVALUE_REFERENCES -#define BOOST_NO_STATIC_ASSERT -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS -// #endif // _MSC_VER < 1600 - // // prefix and suffix headers: // @@ -231,7 +248,7 @@ #error "Compiler not supported or configured - please reconfigure" #endif // -// last known and checked version is 1500 (VC9): +// last known and checked version is 1600 (VC10, aka 2010): #if (_MSC_VER > 1600) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" diff --git a/3rdParty/Boost/src/boost/config/platform/vxworks.hpp b/3rdParty/Boost/src/boost/config/platform/vxworks.hpp new file mode 100644 index 0000000..6ec5171 --- /dev/null +++ b/3rdParty/Boost/src/boost/config/platform/vxworks.hpp @@ -0,0 +1,31 @@ +// (C) Copyright Dustin Spicuzza 2009. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for most recent version. + +// vxWorks specific config options: + +#define BOOST_PLATFORM "vxWorks" + +#define BOOST_NO_CWCHAR +#define BOOST_NO_INTRINSIC_WCHAR_T + +#if defined(__GNUC__) && defined(__STRICT_ANSI__) +#define BOOST_NO_INT64_T +#endif + +#define BOOST_HAS_UNISTD_H + +// these allow posix_features to work, since vxWorks doesn't +// define them itself +#define _POSIX_TIMERS 1 +#define _POSIX_THREADS 1 + +// vxworks doesn't work with asio serial ports +#define BOOST_ASIO_DISABLE_SERIAL_PORT + +// boilerplate code: +#include <boost/config/posix_features.hpp> + diff --git a/3rdParty/Boost/src/boost/config/select_platform_config.hpp b/3rdParty/Boost/src/boost/config/select_platform_config.hpp index 4ce2c01..615bb06 100644 --- a/3rdParty/Boost/src/boost/config/select_platform_config.hpp +++ b/3rdParty/Boost/src/boost/config/select_platform_config.hpp @@ -61,6 +61,10 @@ // QNX: # define BOOST_PLATFORM_CONFIG "boost/config/platform/qnxnto.hpp" +#elif defined(__VXWORKS__) +// vxWorks: +# define BOOST_PLATFORM_CONFIG "boost/config/platform/vxworks.hpp" + #else # if defined(unix) \ diff --git a/3rdParty/Boost/src/boost/config/select_stdlib_config.hpp b/3rdParty/Boost/src/boost/config/select_stdlib_config.hpp index 13e5e4c..2a1430a 100644 --- a/3rdParty/Boost/src/boost/config/select_stdlib_config.hpp +++ b/3rdParty/Boost/src/boost/config/select_stdlib_config.hpp @@ -11,13 +11,10 @@ // locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed: -// we need to include a std lib header here in order to detect which -// library is in use, use <utility> as it's about the smallest -// of the std lib headers - do not rely on this header being included - -// users can short-circuit this header if they know whose std lib -// they are using. - -#include <boost/config/no_tr1/utility.hpp> +// First include <cstddef> to determine if some version of STLport is in use as the std lib +// (do not rely on this header being included since users can short-circuit this header +// if they know whose std lib they are using.) +#include <cstddef> #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) // STLPort library; this _must_ come first, otherwise since @@ -25,7 +22,17 @@ // can end up detecting that first rather than STLport: # define BOOST_STDLIB_CONFIG "boost/config/stdlib/stlport.hpp" -#elif defined(__LIBCOMO__) +#else + +// If our std lib was not some version of STLport, then include <utility> as it is about +// the smallest of the std lib headers that includes real C++ stuff. (Some std libs do not +// include their C++-related macros in <cstddef> so this additional include makes sure +// we get those definitions) +// (again do not rely on this header being included since users can short-circuit this +// header if they know whose std lib they are using.) +#include <boost/config/no_tr1/utility.hpp> + +#if defined(__LIBCOMO__) // Comeau STL: #define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcomo.hpp" @@ -64,5 +71,7 @@ #endif +#endif + diff --git a/3rdParty/Boost/src/boost/config/stdlib/dinkumware.hpp b/3rdParty/Boost/src/boost/config/stdlib/dinkumware.hpp index ff1aed9..ab77059 100644 --- a/3rdParty/Boost/src/boost/config/stdlib/dinkumware.hpp +++ b/3rdParty/Boost/src/boost/config/stdlib/dinkumware.hpp @@ -55,8 +55,10 @@ # define BOOST_HAS_MACRO_USE_FACET # ifndef _CPPLIB_VER // Updated Dinkum library defines this, and provides - // its own min and max definitions. -# define BOOST_NO_STD_MIN_MAX + // its own min and max definitions, as does MTA version. +# ifndef __MTA__ +# define BOOST_NO_STD_MIN_MAX +# endif # define BOOST_NO_MS_INT64_NUMERIC_LIMITS # endif #endif @@ -78,17 +80,42 @@ # define BOOST_NO_STD_ITERATOR_TRAITS #endif -// -// No std::unordered_* containers yet: -// -#define BOOST_NO_STD_UNORDERED - #if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310) // Intel C++ chokes over any non-trivial use of <locale> // this may be an overly restrictive define, but regex fails without it: # define BOOST_NO_STD_LOCALE #endif +// C++0x headers implemented in 520 (as shipped by Microsoft) +// +#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520 +# define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_CODECVT +# define BOOST_NO_0X_HDR_FORWARD_LIST +# define BOOST_NO_0X_HDR_INITIALIZER_LIST +# define BOOST_NO_0X_HDR_RANDOM +# define BOOST_NO_0X_HDR_REGEX +# define BOOST_NO_0X_HDR_SYSTEM_ERROR +# define BOOST_NO_0X_HDR_TYPE_TRAITS +# define BOOST_NO_STD_UNORDERED // deprecated; see following +# define BOOST_NO_0X_HDR_UNORDERED_MAP +# define BOOST_NO_0X_HDR_UNORDERED_SET +#endif + +// C++0x headers not yet implemented +// +# define BOOST_NO_0X_HDR_CHRONO +# define BOOST_NO_0X_HDR_CONCEPTS +# define BOOST_NO_0X_HDR_CONDITION_VARIABLE +# define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +# define BOOST_NO_0X_HDR_FUTURE +# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS +# define BOOST_NO_0X_HDR_MUTEX +# define BOOST_NO_0X_HDR_RATIO +# define BOOST_NO_0X_HDR_THREAD +# define BOOST_NO_0X_HDR_TUPLE + #ifdef _CPPLIB_VER # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER #else diff --git a/3rdParty/Boost/src/boost/config/stdlib/libcomo.hpp b/3rdParty/Boost/src/boost/config/stdlib/libcomo.hpp index 3114094..06731e3 100644 --- a/3rdParty/Boost/src/boost/config/stdlib/libcomo.hpp +++ b/3rdParty/Boost/src/boost/config/stdlib/libcomo.hpp @@ -32,10 +32,31 @@ # define BOOST_HAS_HASH # define BOOST_HAS_SLIST #endif + +// C++0x headers not yet implemented // -// We never have the new C++0x unordered containers: -// -#define BOOST_NO_STD_UNORDERED +# define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_CHRONO +# define BOOST_NO_0X_HDR_CODECVT +# define BOOST_NO_0X_HDR_CONCEPTS +# define BOOST_NO_0X_HDR_CONDITION_VARIABLE +# define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +# define BOOST_NO_0X_HDR_FORWARD_LIST +# define BOOST_NO_0X_HDR_FUTURE +# define BOOST_NO_0X_HDR_INITIALIZER_LIST +# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS +# define BOOST_NO_0X_HDR_MUTEX +# define BOOST_NO_0X_HDR_RANDOM +# define BOOST_NO_0X_HDR_RATIO +# define BOOST_NO_0X_HDR_REGEX +# define BOOST_NO_0X_HDR_SYSTEM_ERROR +# define BOOST_NO_0X_HDR_THREAD +# define BOOST_NO_0X_HDR_TUPLE +# define BOOST_NO_0X_HDR_TYPE_TRAITS +# define BOOST_NO_STD_UNORDERED // deprecated; see following +# define BOOST_NO_0X_HDR_UNORDERED_MAP +# define BOOST_NO_0X_HDR_UNORDERED_SET // // Intrinsic type_traits support. diff --git a/3rdParty/Boost/src/boost/config/stdlib/libstdcpp3.hpp b/3rdParty/Boost/src/boost/config/stdlib/libstdcpp3.hpp index 8e1c811..6a57319 100644 --- a/3rdParty/Boost/src/boost/config/stdlib/libstdcpp3.hpp +++ b/3rdParty/Boost/src/boost/config/stdlib/libstdcpp3.hpp @@ -77,7 +77,51 @@ # endif #endif -#ifndef __GXX_EXPERIMENTAL_CXX0X__ -# define BOOST_NO_STD_UNORDERED +// stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly +// __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++ +// developers. He also commented: +// +// "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in +// GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305. +// Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support +// than any release in the 4.2 series." +// +// Another resource for understanding stdlibc++ features is: +// http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x + +// C++0x headers in GCC 4.3.0 and later +// +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_RANDOM +# define BOOST_NO_0X_HDR_REGEX +# define BOOST_NO_0X_HDR_TUPLE +# define BOOST_NO_0X_HDR_TYPE_TRAITS +# define BOOST_NO_STD_UNORDERED // deprecated; see following +# define BOOST_NO_0X_HDR_UNORDERED_MAP +# define BOOST_NO_0X_HDR_UNORDERED_SET +#endif + +// C++0x headers in GCC 4.4.0 and later +// +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +# define BOOST_NO_0X_HDR_CHRONO +# define BOOST_NO_0X_HDR_CONDITION_VARIABLE +# define BOOST_NO_0X_HDR_FORWARD_LIST +# define BOOST_NO_0X_HDR_INITIALIZER_LIST +# define BOOST_NO_0X_HDR_MUTEX +# define BOOST_NO_0X_HDR_RATIO +# define BOOST_NO_0X_HDR_SYSTEM_ERROR +# define BOOST_NO_0X_HDR_THREAD #endif +// C++0x headers not yet implemented +// +# define BOOST_NO_0X_HDR_CODECVT +# define BOOST_NO_0X_HDR_CONCEPTS +# define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +# define BOOST_NO_0X_HDR_FUTURE +# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS + +// --- end --- diff --git a/3rdParty/Boost/src/boost/config/stdlib/modena.hpp b/3rdParty/Boost/src/boost/config/stdlib/modena.hpp index e488d13..7bd50ce 100644 --- a/3rdParty/Boost/src/boost/config/stdlib/modena.hpp +++ b/3rdParty/Boost/src/boost/config/stdlib/modena.hpp @@ -21,10 +21,31 @@ #ifndef MSIPL_WCHART #define BOOST_NO_STD_WSTRING #endif + +// C++0x headers not yet implemented // -// We never have the new C++0x unordered containers: -// -#define BOOST_NO_STD_UNORDERED +# define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_CHRONO +# define BOOST_NO_0X_HDR_CODECVT +# define BOOST_NO_0X_HDR_CONCEPTS +# define BOOST_NO_0X_HDR_CONDITION_VARIABLE +# define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +# define BOOST_NO_0X_HDR_FORWARD_LIST +# define BOOST_NO_0X_HDR_FUTURE +# define BOOST_NO_0X_HDR_INITIALIZER_LIST +# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS +# define BOOST_NO_0X_HDR_MUTEX +# define BOOST_NO_0X_HDR_RANDOM +# define BOOST_NO_0X_HDR_RATIO +# define BOOST_NO_0X_HDR_REGEX +# define BOOST_NO_0X_HDR_SYSTEM_ERROR +# define BOOST_NO_0X_HDR_THREAD +# define BOOST_NO_0X_HDR_TUPLE +# define BOOST_NO_0X_HDR_TYPE_TRAITS +# define BOOST_NO_STD_UNORDERED // deprecated; see following +# define BOOST_NO_0X_HDR_UNORDERED_MAP +# define BOOST_NO_0X_HDR_UNORDERED_SET #define BOOST_STDLIB "Modena C++ standard library" diff --git a/3rdParty/Boost/src/boost/config/stdlib/msl.hpp b/3rdParty/Boost/src/boost/config/stdlib/msl.hpp index 746878d..6bcd232 100644 --- a/3rdParty/Boost/src/boost/config/stdlib/msl.hpp +++ b/3rdParty/Boost/src/boost/config/stdlib/msl.hpp @@ -45,11 +45,31 @@ # define BOOST_NO_STD_USE_FACET # define BOOST_HAS_TWO_ARG_USE_FACET #endif -// -// We never have the new C++0x unordered containers: -// -#define BOOST_NO_STD_UNORDERED +// C++0x headers not yet implemented +// +# define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_CHRONO +# define BOOST_NO_0X_HDR_CODECVT +# define BOOST_NO_0X_HDR_CONCEPTS +# define BOOST_NO_0X_HDR_CONDITION_VARIABLE +# define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +# define BOOST_NO_0X_HDR_FORWARD_LIST +# define BOOST_NO_0X_HDR_FUTURE +# define BOOST_NO_0X_HDR_INITIALIZER_LIST +# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS +# define BOOST_NO_0X_HDR_MUTEX +# define BOOST_NO_0X_HDR_RANDOM +# define BOOST_NO_0X_HDR_RATIO +# define BOOST_NO_0X_HDR_REGEX +# define BOOST_NO_0X_HDR_SYSTEM_ERROR +# define BOOST_NO_0X_HDR_THREAD +# define BOOST_NO_0X_HDR_TUPLE +# define BOOST_NO_0X_HDR_TYPE_TRAITS +# define BOOST_NO_STD_UNORDERED // deprecated; see following +# define BOOST_NO_0X_HDR_UNORDERED_MAP +# define BOOST_NO_0X_HDR_UNORDERED_SET #define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__) diff --git a/3rdParty/Boost/src/boost/config/stdlib/roguewave.hpp b/3rdParty/Boost/src/boost/config/stdlib/roguewave.hpp index 3e58882..cba2f54 100644 --- a/3rdParty/Boost/src/boost/config/stdlib/roguewave.hpp +++ b/3rdParty/Boost/src/boost/config/stdlib/roguewave.hpp @@ -152,8 +152,28 @@ # endif #endif -// -// We never have the new C++0x unordered containers: -// -#define BOOST_NO_STD_UNORDERED +// C++0x headers not yet implemented +// +# define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_CHRONO +# define BOOST_NO_0X_HDR_CODECVT +# define BOOST_NO_0X_HDR_CONCEPTS +# define BOOST_NO_0X_HDR_CONDITION_VARIABLE +# define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +# define BOOST_NO_0X_HDR_FORWARD_LIST +# define BOOST_NO_0X_HDR_FUTURE +# define BOOST_NO_0X_HDR_INITIALIZER_LIST +# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS +# define BOOST_NO_0X_HDR_MUTEX +# define BOOST_NO_0X_HDR_RANDOM +# define BOOST_NO_0X_HDR_RATIO +# define BOOST_NO_0X_HDR_REGEX +# define BOOST_NO_0X_HDR_SYSTEM_ERROR +# define BOOST_NO_0X_HDR_THREAD +# define BOOST_NO_0X_HDR_TUPLE +# define BOOST_NO_0X_HDR_TYPE_TRAITS +# define BOOST_NO_STD_UNORDERED // deprecated; see following +# define BOOST_NO_0X_HDR_UNORDERED_MAP +# define BOOST_NO_0X_HDR_UNORDERED_SET diff --git a/3rdParty/Boost/src/boost/config/stdlib/sgi.hpp b/3rdParty/Boost/src/boost/config/stdlib/sgi.hpp index b493d49..c505008 100644 --- a/3rdParty/Boost/src/boost/config/stdlib/sgi.hpp +++ b/3rdParty/Boost/src/boost/config/stdlib/sgi.hpp @@ -76,7 +76,6 @@ // #define BOOST_HAS_HASH #define BOOST_HAS_SLIST -#define BOOST_NO_STD_UNORDERED // // If this is GNU libstdc++2, then no <limits> and no std::wstring: @@ -106,6 +105,31 @@ // #define BOOST_HAS_SGI_TYPE_TRAITS +// C++0x headers not yet implemented +// +# define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_CHRONO +# define BOOST_NO_0X_HDR_CODECVT +# define BOOST_NO_0X_HDR_CONCEPTS +# define BOOST_NO_0X_HDR_CONDITION_VARIABLE +# define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +# define BOOST_NO_0X_HDR_FORWARD_LIST +# define BOOST_NO_0X_HDR_FUTURE +# define BOOST_NO_0X_HDR_INITIALIZER_LIST +# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS +# define BOOST_NO_0X_HDR_MUTEX +# define BOOST_NO_0X_HDR_RANDOM +# define BOOST_NO_0X_HDR_RATIO +# define BOOST_NO_0X_HDR_REGEX +# define BOOST_NO_0X_HDR_SYSTEM_ERROR +# define BOOST_NO_0X_HDR_THREAD +# define BOOST_NO_0X_HDR_TUPLE +# define BOOST_NO_0X_HDR_TYPE_TRAITS +# define BOOST_NO_STD_UNORDERED // deprecated; see following +# define BOOST_NO_0X_HDR_UNORDERED_MAP +# define BOOST_NO_0X_HDR_UNORDERED_SET + #define BOOST_STDLIB "SGI standard library" diff --git a/3rdParty/Boost/src/boost/config/stdlib/stlport.hpp b/3rdParty/Boost/src/boost/config/stdlib/stlport.hpp index 82e4cff..3dfd529 100644 --- a/3rdParty/Boost/src/boost/config/stdlib/stlport.hpp +++ b/3rdParty/Boost/src/boost/config/stdlib/stlport.hpp @@ -61,9 +61,14 @@ # endif #endif -#if defined(_STLPORT_VERSION) && (_STLPORT_VERSION < 0x500) +#if defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x500) || (_STLPORT_VERSION >= 0x520)) # define BOOST_NO_STD_UNORDERED #endif + +#if defined(_STLPORT_VERSION) && (_STLPORT_VERSION >= 0x520) +# define BOOST_HAS_TR1_UNORDERED_SET +# define BOOST_HAS_TR1_UNORDERED_MAP +#endif // // Without member template support enabled, their are no template // iterate constructors, and no std::allocator: @@ -195,6 +200,31 @@ namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; namespace boost { using std::min; using std::max; } #endif +// C++0x headers not yet implemented +// +# define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_CHRONO +# define BOOST_NO_0X_HDR_CODECVT +# define BOOST_NO_0X_HDR_CONCEPTS +# define BOOST_NO_0X_HDR_CONDITION_VARIABLE +# define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +# define BOOST_NO_0X_HDR_FORWARD_LIST +# define BOOST_NO_0X_HDR_FUTURE +# define BOOST_NO_0X_HDR_INITIALIZER_LIST +# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS +# define BOOST_NO_0X_HDR_MUTEX +# define BOOST_NO_0X_HDR_RANDOM +# define BOOST_NO_0X_HDR_RATIO +# define BOOST_NO_0X_HDR_REGEX +# define BOOST_NO_0X_HDR_SYSTEM_ERROR +# define BOOST_NO_0X_HDR_THREAD +# define BOOST_NO_0X_HDR_TUPLE +# define BOOST_NO_0X_HDR_TYPE_TRAITS +# define BOOST_NO_STD_UNORDERED // deprecated; see following +# define BOOST_NO_0X_HDR_UNORDERED_MAP +# define BOOST_NO_0X_HDR_UNORDERED_SET + #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT) diff --git a/3rdParty/Boost/src/boost/config/stdlib/vacpp.hpp b/3rdParty/Boost/src/boost/config/stdlib/vacpp.hpp index c6c4566..c8d6d5a 100644 --- a/3rdParty/Boost/src/boost/config/stdlib/vacpp.hpp +++ b/3rdParty/Boost/src/boost/config/stdlib/vacpp.hpp @@ -11,7 +11,31 @@ #define BOOST_HAS_MACRO_USE_FACET #define BOOST_NO_STD_MESSAGES -#define BOOST_NO_STD_UNORDERED + +// C++0x headers not yet implemented +// +# define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_CHRONO +# define BOOST_NO_0X_HDR_CODECVT +# define BOOST_NO_0X_HDR_CONCEPTS +# define BOOST_NO_0X_HDR_CONDITION_VARIABLE +# define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +# define BOOST_NO_0X_HDR_FORWARD_LIST +# define BOOST_NO_0X_HDR_FUTURE +# define BOOST_NO_0X_HDR_INITIALIZER_LIST +# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS +# define BOOST_NO_0X_HDR_MUTEX +# define BOOST_NO_0X_HDR_RANDOM +# define BOOST_NO_0X_HDR_RATIO +# define BOOST_NO_0X_HDR_REGEX +# define BOOST_NO_0X_HDR_SYSTEM_ERROR +# define BOOST_NO_0X_HDR_THREAD +# define BOOST_NO_0X_HDR_TUPLE +# define BOOST_NO_0X_HDR_TYPE_TRAITS +# define BOOST_NO_STD_UNORDERED // deprecated; see following +# define BOOST_NO_0X_HDR_UNORDERED_MAP +# define BOOST_NO_0X_HDR_UNORDERED_SET #define BOOST_STDLIB "Visual Age default standard library" diff --git a/3rdParty/Boost/src/boost/config/suffix.hpp b/3rdParty/Boost/src/boost/config/suffix.hpp index ca80330..fa44986 100644 --- a/3rdParty/Boost/src/boost/config/suffix.hpp +++ b/3rdParty/Boost/src/boost/config/suffix.hpp @@ -306,6 +306,14 @@ # define BOOST_HASH_MAP_HEADER <hash_map> #endif +// +// Set BOOST_NO_INITIALIZER_LISTS if there is no library support. +// + +#if defined(BOOST_NO_0X_HDR_INITIALIZER_LIST) && !defined(BOOST_NO_INITIALIZER_LISTS) +# define BOOST_NO_INITIALIZER_LISTS +#endif + // BOOST_HAS_ABI_HEADERS // This macro gets set if we have headers that fix the ABI, // and prevent ODR violations when linking to external libraries: diff --git a/3rdParty/Boost/src/boost/cstdint.hpp b/3rdParty/Boost/src/boost/cstdint.hpp index d55a484..47e6a16 100644 --- a/3rdParty/Boost/src/boost/cstdint.hpp +++ b/3rdParty/Boost/src/boost/cstdint.hpp @@ -23,10 +23,25 @@ #ifndef BOOST_CSTDINT_HPP #define BOOST_CSTDINT_HPP -#include <boost/config.hpp> +// +// Since we always define the INT#_C macros as per C++0x, +// define __STDC_CONSTANT_MACROS so that <stdint.h> does the right +// thing if possible, and so that the user knows that the macros +// are actually defined as per C99. +// +#ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +#endif +#include <boost/config.hpp> -#ifdef BOOST_HAS_STDINT_H +// +// Note that GLIBC is a bit inconsistent about whether int64_t is defined or not +// depending upon what headers happen to have been included first... +// so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG. +// See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990 +// +#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG)) // The following #include is an implementation artifact; not part of interface. # ifdef __hpux @@ -220,6 +235,15 @@ namespace boost typedef unsigned short uint_least16_t; typedef unsigned short uint_fast16_t; # endif +# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) + // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified + // MTA / XMT does support the following non-standard integer types + typedef __short16 int16_t; + typedef __short16 int_least16_t; + typedef __short16 int_fast16_t; + typedef unsigned __short16 uint16_t; + typedef unsigned __short16 uint_least16_t; + typedef unsigned __short16 uint_fast16_t; # elif (USHRT_MAX == 0xffffffff) && defined(CRAY) // no 16-bit types on Cray: typedef short int_least16_t; @@ -246,6 +270,14 @@ namespace boost typedef unsigned int uint32_t; typedef unsigned int uint_least32_t; typedef unsigned int uint_fast32_t; +# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) + // Integers are 64 bits on the MTA / XMT + typedef __int32 int32_t; + typedef __int32 int_least32_t; + typedef __int32 int_fast32_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int32 uint_fast32_t; # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif @@ -326,19 +358,16 @@ namespace boost Macro definition section: -Define various INTXX_C macros only if -__STDC_CONSTANT_MACROS is defined. - -Undefine the macros if __STDC_CONSTANT_MACROS is -not defined and the macros are (cf <cassert>). - Added 23rd September 2000 (John Maddock). Modified 11th September 2001 to be excluded when BOOST_HAS_STDINT_H is defined (John Maddock). +Modified 11th Dec 2009 to always define the +INT#_C macros if they're not already defined (John Maddock). ******************************************************/ -#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H) +#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(INT8_C) +#include <limits.h> # define BOOST__STDC_CONSTANT_MACROS_DEFINED # if defined(BOOST_HAS_MS_INT64) // @@ -390,27 +419,40 @@ BOOST_HAS_STDINT_H is defined (John Maddock). // 64-bit types + intmax_t and uintmax_t ----------------------------------// # if defined(BOOST_HAS_LONG_LONG) && \ - (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) + (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX)) # if defined(__hpux) - // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions -# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ - (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || \ - (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) - + // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || \ + (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || \ + (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) || \ + (defined(_LLONG_MAX) && _LLONG_MAX == 18446744073709551615ULL) + +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif -# define INT64_C(value) value##LL -# define UINT64_C(value) value##uLL # elif ULONG_MAX != 0xffffffff -# if ULONG_MAX == 18446744073709551615 // 2**64 - 1 +# if ULONG_MAX == 18446744073709551615U // 2**64 - 1 # define INT64_C(value) value##L # define UINT64_C(value) value##uL # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif +# elif defined(BOOST_HAS_LONG_LONG) + // Usual macros not defined, work things out for ourselves: +# if(~0uLL == 18446744073709551615ULL) +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp # endif # ifdef BOOST_NO_INT64_T @@ -423,23 +465,7 @@ BOOST_HAS_STDINT_H is defined (John Maddock). # endif // Borland/Microsoft specific width suffixes - -#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) && !defined(BOOST_HAS_STDINT_H) -// -// undef all the macros: -// -# undef INT8_C -# undef INT16_C -# undef INT32_C -# undef INT64_C -# undef UINT8_C -# undef UINT16_C -# undef UINT32_C -# undef UINT64_C -# undef INTMAX_C -# undef UINTMAX_C - -#endif // __STDC_CONSTANT_MACROS_DEFINED etc. +#endif // INT#_C macros. diff --git a/3rdParty/Boost/src/boost/date_time/c_time.hpp b/3rdParty/Boost/src/boost/date_time/c_time.hpp index 42902a5..24ccfe5 100644 --- a/3rdParty/Boost/src/boost/date_time/c_time.hpp +++ b/3rdParty/Boost/src/boost/date_time/c_time.hpp @@ -2,11 +2,11 @@ #define DATE_TIME_C_TIME_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $ + * Author: Jeff Garland, Bart Garst + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ @@ -38,12 +38,14 @@ namespace std { using ::time_t; using ::time; using ::localtime; namespace boost { namespace date_time { //! Provides a uniform interface to some 'ctime' functions - /*! Provides a uniform interface to some ctime functions and - * their '_r' counterparts. The '_r' functions require a pointer to a - * user created std::tm struct whereas the regular functions use a - * staticly created struct and return a pointer to that. These wrapper - * functions require the user to create a std::tm struct and send in a - * pointer to it. A pointer to the user created struct will be returned. + /*! Provides a uniform interface to some ctime functions and + * their '_r' counterparts. The '_r' functions require a pointer to a + * user created std::tm struct whereas the regular functions use a + * staticly created struct and return a pointer to that. These wrapper + * functions require the user to create a std::tm struct and send in a + * pointer to it. This struct may be used to store the resulting time. + * The returned pointer may or may not point to this struct, however, + * it will point to the result of the corresponding function. * All functions do proper checking of the C function results and throw * exceptions on error. Therefore the functions will never return NULL. */ @@ -101,5 +103,5 @@ namespace date_time { #endif // BOOST_HAS_THREADS }; }} // namespaces - + #endif // DATE_TIME_C_TIME_HPP___ diff --git a/3rdParty/Boost/src/boost/date_time/date.hpp b/3rdParty/Boost/src/boost/date_time/date.hpp index beab047..1056fb6 100644 --- a/3rdParty/Boost/src/boost/date_time/date.hpp +++ b/3rdParty/Boost/src/boost/date_time/date.hpp @@ -2,43 +2,43 @@ #define DATE_TIME_DATE_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ -#include "boost/date_time/year_month_day.hpp" -#include "boost/date_time/special_defs.hpp" -#include "boost/operators.hpp" +#include <boost/operators.hpp> +#include <boost/date_time/year_month_day.hpp> +#include <boost/date_time/special_defs.hpp> namespace boost { namespace date_time { //!Representation of timepoint at the one day level resolution. - /*! + /*! The date template represents an interface shell for a date class that is based on a year-month-day system such as the gregorian or iso systems. It provides basic operations to enable calculation - and comparisons. + and comparisons. <b>Theory</b> - This date representation fundamentally departs from the C tm struct + This date representation fundamentally departs from the C tm struct approach. The goal for this type is to provide efficient date operations (add, subtract) and storage (minimize space to represent) in a concrete class. Thus, the date uses a count internally to - represent a particular date. The calendar parameter defines + represent a particular date. The calendar parameter defines the policies for converting the the year-month-day and internal counted form here. Applications that need to perform heavy formatting of the same date repeatedly will perform better by using the year-month-day representation. - + Internally the date uses a day number to represent the date. - This is a monotonic time representation. This representation + This is a monotonic time representation. This representation allows for fast comparison as well as simplifying - the creation of writing numeric operations. Essentially, the + the creation of writing numeric operations. Essentially, the internal day number is like adjusted julian day. The adjustment is determined by the Epoch date which is represented as day 1 of the calendar. Day 0 is reserved for negative infinity so that @@ -48,11 +48,11 @@ namespace date_time { day representations. */ - - template<class T, class calendar, class duration_type_> - class date : private - boost::less_than_comparable<T - , boost::equality_comparable<T + + template<class T, class calendar, class duration_type_> + class date : private + boost::less_than_comparable<T + , boost::equality_comparable<T > > { public: @@ -67,26 +67,26 @@ namespace date_time { typedef typename calendar::date_rep_type date_rep_type; typedef typename calendar::date_int_type date_int_type; typedef typename calendar::day_of_week_type day_of_week_type; - date(year_type y, month_type m, day_type d) + date(year_type y, month_type m, day_type d) : days_(calendar::day_number(ymd_type(y, m, d))) {} - date(const ymd_type& ymd) + date(const ymd_type& ymd) : days_(calendar::day_number(ymd)) - {} + {} //let the compiler write copy, assignment, and destructor year_type year() const { - ymd_type ymd = calendar::from_day_number(days_); + ymd_type ymd = calendar::from_day_number(days_); return ymd.year; } month_type month() const { - ymd_type ymd = calendar::from_day_number(days_); + ymd_type ymd = calendar::from_day_number(days_); return ymd.month; } day_type day() const { - ymd_type ymd = calendar::from_day_number(days_); + ymd_type ymd = calendar::from_day_number(days_); return ymd.day; } day_of_week_type day_of_week() const @@ -138,10 +138,21 @@ namespace date_time { } duration_type operator-(const date_type& d) const { - date_rep_type val = date_rep_type(days_) - date_rep_type(d.days_); - return duration_type(val.as_number()); + if (!this->is_special() && !d.is_special()) + { + // The duration underlying type may be wider than the date underlying type. + // Thus we calculate the difference in terms of two durations from some common fixed base date. + typedef typename duration_type::duration_rep_type duration_rep_type; + return duration_type(static_cast< duration_rep_type >(days_) - static_cast< duration_rep_type >(d.days_)); + } + else + { + // In this case the difference will be a special value, too + date_rep_type val = date_rep_type(days_) - date_rep_type(d.days_); + return duration_type(val.as_special()); + } } - + date_type operator-(const duration_type& dd) const { if(dd.is_special()) @@ -155,10 +166,10 @@ namespace date_time { *this = *this - dd; return date_type(days_); } - date_rep_type day_count() const + date_rep_type day_count() const { return days_; - }; + } //allow internal access from operators date_type operator+(const duration_type& dd) const { @@ -170,25 +181,25 @@ namespace date_time { } date_type operator+=(const duration_type& dd) { - *this = *this + dd; + *this = *this + dd; return date_type(days_); } //see reference protected: - /*! This is a private constructor which allows for the creation of new - dates. It is not exposed to users since that would require class + /*! This is a private constructor which allows for the creation of new + dates. It is not exposed to users since that would require class users to understand the inner workings of the date class. */ explicit date(date_int_type days) : days_(days) {}; explicit date(date_rep_type days) : days_(days.as_number()) {}; date_int_type days_; - + }; - + } } // namespace date_time diff --git a/3rdParty/Boost/src/boost/date_time/date_facet.hpp b/3rdParty/Boost/src/boost/date_time/date_facet.hpp index a592c11..3eda4c7 100644 --- a/3rdParty/Boost/src/boost/date_time/date_facet.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_facet.hpp @@ -2,11 +2,11 @@ #define _DATE_TIME_DATE_FACET__HPP___ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Martin Andrian, Jeff Garland, Bart Garst - * $Date: 2009-02-01 06:29:43 -0500 (Sun, 01 Feb 2009) $ + * $Date: 2009-06-04 07:40:18 -0400 (Thu, 04 Jun 2009) $ */ #include <locale> @@ -27,7 +27,7 @@ namespace boost { namespace date_time { - + /*! Class that provides format based I/O facet for date types. * * This class allows the formatting of dates by using format string. @@ -44,7 +44,7 @@ namespace boost { namespace date_time { * Default weekday format == %a */ template <class date_type, - class CharT, + class CharT, class OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > class date_facet : public std::locale::facet { public: @@ -81,9 +81,9 @@ namespace boost { namespace date_time { #if defined (__SUNPRO_CC) && defined (_RWSTD_VER) std::locale::id& __get_id (void) const { return id; } #endif - - explicit date_facet(::size_t a_ref = 0) - : std::locale::facet(a_ref), + + explicit date_facet(::size_t a_ref = 0) + : std::locale::facet(a_ref), //m_format(standard_format_specifier) m_format(default_date_format), m_month_format(short_month_format), @@ -92,22 +92,22 @@ namespace boost { namespace date_time { explicit date_facet(const char_type* format_str, const input_collection_type& short_names, - ::size_t ref_count = 0) - : std::locale::facet(ref_count), + ::size_t ref_count = 0) + : std::locale::facet(ref_count), m_format(format_str), m_month_format(short_month_format), m_weekday_format(short_weekday_format), - m_month_short_names(short_names) + m_month_short_names(short_names) {} - - explicit date_facet(const char_type* format_str, - period_formatter_type per_formatter = period_formatter_type(), + + explicit date_facet(const char_type* format_str, + period_formatter_type per_formatter = period_formatter_type(), special_values_formatter_type sv_formatter = special_values_formatter_type(), date_gen_formatter_type dg_formatter = date_gen_formatter_type(), ::size_t ref_count = 0) - : std::locale::facet(ref_count), - m_format(format_str), + : std::locale::facet(ref_count), + m_format(format_str), m_month_format(short_month_format), m_weekday_format(short_weekday_format), m_period_formatter(per_formatter), @@ -131,11 +131,11 @@ namespace boost { namespace date_time { void weekday_format(const char_type* const format_str) { m_weekday_format = format_str; } - + void period_formatter(period_formatter_type per_formatter) { m_period_formatter= per_formatter; } - void special_values_formatter(const special_values_formatter_type& svf) + void special_values_formatter(const special_values_formatter_type& svf) { m_special_values_formatter = svf; } @@ -164,24 +164,24 @@ namespace boost { namespace date_time { m_date_gen_formatter.elements(new_strings, beg_pos); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const date_type& d) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const date_type& d) const { - if (d.is_special()) { + if (d.is_special()) { return do_put_special(next, a_ios, fill_char, d.as_special()); } //The following line of code required the date to support a to_tm function return do_put_tm(next, a_ios, fill_char, to_tm(d), m_format); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const duration_type& dd) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const duration_type& dd) const { - if (dd.is_special()) { + if (dd.is_special()) { return do_put_special(next, a_ios, fill_char, dd.get_rep().as_special()); } @@ -199,164 +199,147 @@ namespace boost { namespace date_time { } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const month_type& m) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const month_type& m) const { - //if (d.is_special()) { + //if (d.is_special()) { // return do_put_special(next, a_ios, fill_char, d.as_special()); //} //The following line of code required the date to support a to_tm function - tm dtm; - init_tm(dtm); - dtm.tm_mon = m -1; + std::tm dtm = {}; + dtm.tm_mon = m - 1; return do_put_tm(next, a_ios, fill_char, dtm, m_month_format); } //! puts the day of month - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const day_type& day) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const day_type& day) const { - tm dtm; - init_tm(dtm); + std::tm dtm = {}; dtm.tm_mday = day.as_number(); char_type tmp[3] = {'%','d'}; string_type temp_format(tmp); return do_put_tm(next, a_ios, fill_char, dtm, temp_format); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const day_of_week_type& dow) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const day_of_week_type& dow) const { - //if (d.is_special()) { + //if (d.is_special()) { // return do_put_special(next, a_ios, fill_char, d.as_special()); //} //The following line of code required the date to support a to_tm function - tm dtm; - init_tm(dtm); + std::tm dtm = {}; dtm.tm_wday = dow; return do_put_tm(next, a_ios, fill_char, dtm, m_weekday_format); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const period_type& p) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const period_type& p) const { return m_period_formatter.put_period(next, a_ios, fill_char, p, *this); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const partial_date_type& pd) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const partial_date_type& pd) const { return m_date_gen_formatter.put_partial_date(next, a_ios, fill_char, pd, *this); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const nth_kday_type& nkd) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const nth_kday_type& nkd) const { return m_date_gen_formatter.put_nth_kday(next, a_ios, fill_char, nkd, *this); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const first_kday_type& fkd) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const first_kday_type& fkd) const { return m_date_gen_formatter.put_first_kday(next, a_ios, fill_char, fkd, *this); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const last_kday_type& lkd) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const last_kday_type& lkd) const { return m_date_gen_formatter.put_last_kday(next, a_ios, fill_char, lkd, *this); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const kday_before_type& fkb) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const kday_before_type& fkb) const { return m_date_gen_formatter.put_kday_before(next, a_ios, fill_char, fkb, *this); } - OutItrT put(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, - const kday_after_type& fka) const + OutItrT put(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, + const kday_after_type& fka) const { return m_date_gen_formatter.put_kday_after(next, a_ios, fill_char, fka, *this); } - + protected: - //! Helper function to initialize all fields in a tm struct - tm init_tm(tm& tm_value) const - { - tm_value.tm_sec = 0; /* seconds */ - tm_value.tm_min = 0; /* minutes */ - tm_value.tm_hour = 0; /* hours */ - tm_value.tm_mday = 0; /* day of the month */ - tm_value.tm_mon = 0; /* month */ - tm_value.tm_year = 0; /* year */ - tm_value.tm_wday = 0; /* day of the week */ - tm_value.tm_yday = 0; /* day in the year */ - tm_value.tm_isdst = 0; /* daylight saving time */ - return tm_value; - } - virtual OutItrT do_put_special(OutItrT next, - std::ios_base& /*a_ios*/, - char_type /*fill_char*/, - const boost::date_time::special_values sv) const + virtual OutItrT do_put_special(OutItrT next, + std::ios_base& /*a_ios*/, + char_type /*fill_char*/, + const boost::date_time::special_values sv) const { m_special_values_formatter.put_special(next, sv); return next; } - virtual OutItrT do_put_tm(OutItrT next, - std::ios_base& a_ios, - char_type fill_char, + virtual OutItrT do_put_tm(OutItrT next, + std::ios_base& a_ios, + char_type fill_char, const tm& tm_value, - string_type a_format) const + string_type a_format) const { // update format string with custom names if (m_weekday_long_names.size()) { - boost::algorithm::replace_all(a_format, - long_weekday_format, + boost::algorithm::replace_all(a_format, + long_weekday_format, m_weekday_long_names[tm_value.tm_wday]); } if (m_weekday_short_names.size()) { - boost::algorithm::replace_all(a_format, - short_weekday_format, + boost::algorithm::replace_all(a_format, + short_weekday_format, m_weekday_short_names[tm_value.tm_wday]); } if (m_month_long_names.size()) { - boost::algorithm::replace_all(a_format, - long_month_format, + boost::algorithm::replace_all(a_format, + long_month_format, m_month_long_names[tm_value.tm_mon]); } if (m_month_short_names.size()) { - boost::algorithm::replace_all(a_format, - short_month_format, + boost::algorithm::replace_all(a_format, + short_month_format, m_month_short_names[tm_value.tm_mon]); } // use time_put facet to create final string const char_type* p_format = a_format.c_str(); - return std::use_facet<std::time_put<CharT> >(a_ios.getloc()).put(next, a_ios, - fill_char, + return std::use_facet<std::time_put<CharT> >(a_ios.getloc()).put(next, a_ios, + fill_char, &tm_value, - p_format, + p_format, p_format + a_format.size()); } protected: @@ -376,51 +359,51 @@ namespace boost { namespace date_time { template <class date_type, class CharT, class OutItrT> std::locale::id date_facet<date_type, CharT, OutItrT>::id; - template <class date_type, class CharT, class OutItrT> - const typename date_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_facet<date_type, CharT, OutItrT>::char_type date_facet<date_type, CharT, OutItrT>::long_weekday_format[3] = {'%','A'}; - template <class date_type, class CharT, class OutItrT> - const typename date_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_facet<date_type, CharT, OutItrT>::char_type date_facet<date_type, CharT, OutItrT>::short_weekday_format[3] = {'%','a'}; - template <class date_type, class CharT, class OutItrT> - const typename date_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_facet<date_type, CharT, OutItrT>::char_type date_facet<date_type, CharT, OutItrT>::long_month_format[3] = {'%','B'}; - template <class date_type, class CharT, class OutItrT> - const typename date_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_facet<date_type, CharT, OutItrT>::char_type date_facet<date_type, CharT, OutItrT>::short_month_format[3] = {'%','b'}; - template <class date_type, class CharT, class OutItrT> - const typename date_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_facet<date_type, CharT, OutItrT>::char_type date_facet<date_type, CharT, OutItrT>::default_period_separator[4] = { ' ', '/', ' '}; - template <class date_type, class CharT, class OutItrT> - const typename date_facet<date_type, CharT, OutItrT>::char_type - date_facet<date_type, CharT, OutItrT>::standard_format_specifier[3] = + template <class date_type, class CharT, class OutItrT> + const typename date_facet<date_type, CharT, OutItrT>::char_type + date_facet<date_type, CharT, OutItrT>::standard_format_specifier[3] = {'%', 'x' }; - template <class date_type, class CharT, class OutItrT> - const typename date_facet<date_type, CharT, OutItrT>::char_type - date_facet<date_type, CharT, OutItrT>::iso_format_specifier[7] = + template <class date_type, class CharT, class OutItrT> + const typename date_facet<date_type, CharT, OutItrT>::char_type + date_facet<date_type, CharT, OutItrT>::iso_format_specifier[7] = {'%', 'Y', '%', 'm', '%', 'd' }; - template <class date_type, class CharT, class OutItrT> - const typename date_facet<date_type, CharT, OutItrT>::char_type - date_facet<date_type, CharT, OutItrT>::iso_format_extended_specifier[9] = + template <class date_type, class CharT, class OutItrT> + const typename date_facet<date_type, CharT, OutItrT>::char_type + date_facet<date_type, CharT, OutItrT>::iso_format_extended_specifier[9] = {'%', 'Y', '-', '%', 'm', '-', '%', 'd' }; - template <class date_type, class CharT, class OutItrT> - const typename date_facet<date_type, CharT, OutItrT>::char_type - date_facet<date_type, CharT, OutItrT>::default_date_format[9] = + template <class date_type, class CharT, class OutItrT> + const typename date_facet<date_type, CharT, OutItrT>::char_type + date_facet<date_type, CharT, OutItrT>::default_date_format[9] = {'%','Y','-','%','b','-','%','d'}; //! Input facet template <class date_type, - class CharT, + class CharT, class InItrT = std::istreambuf_iterator<CharT, std::char_traits<CharT> > > class date_input_facet : public std::locale::facet { public: @@ -434,7 +417,7 @@ namespace boost { namespace date_time { typedef std::basic_string<CharT> string_type; typedef CharT char_type; typedef boost::date_time::period_parser<date_type, CharT> period_parser_type; - typedef boost::date_time::special_values_parser<date_type,CharT> special_values_parser_type; + typedef boost::date_time::special_values_parser<date_type,CharT> special_values_parser_type; typedef std::vector<std::basic_string<CharT> > input_collection_type; typedef format_date_parser<date_type, CharT> format_date_parser_type; // date_generators stuff goes here @@ -458,9 +441,9 @@ namespace boost { namespace date_time { static const char_type iso_format_extended_specifier[9]; static const char_type default_date_format[9]; // YYYY-Mon-DD static std::locale::id id; - - explicit date_input_facet(::size_t a_ref = 0) - : std::locale::facet(a_ref), + + explicit date_input_facet(::size_t a_ref = 0) + : std::locale::facet(a_ref), m_format(default_date_format), m_month_format(short_month_format), m_weekday_format(short_weekday_format), @@ -470,8 +453,8 @@ namespace boost { namespace date_time { {} explicit date_input_facet(const string_type& format_str, - ::size_t a_ref = 0) - : std::locale::facet(a_ref), + ::size_t a_ref = 0) + : std::locale::facet(a_ref), m_format(format_str), m_month_format(short_month_format), m_weekday_format(short_weekday_format), @@ -518,7 +501,7 @@ namespace boost { namespace date_time { void year_format(const char_type* const format_str) { m_year_format = format_str; } - + void period_parser(period_parser_type per_parser) { m_period_parser = per_parser; } @@ -554,7 +537,7 @@ namespace boost { namespace date_time { const string_type& before, const string_type& after, const string_type& of) - + { m_date_gen_parser.element_strings(first,second,third,fourth,fifth,last,before,after,of); } @@ -564,68 +547,68 @@ namespace boost { namespace date_time { m_sv_parser = sv_parser; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& /*a_ios*/, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& /*a_ios*/, date_type& d) const { d = m_parser.parse_date(from, to, m_format, m_sv_parser); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& /*a_ios*/, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& /*a_ios*/, month_type& m) const { m = m_parser.parse_month(from, to, m_month_format); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& /*a_ios*/, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& /*a_ios*/, day_of_week_type& wd) const { wd = m_parser.parse_weekday(from, to, m_weekday_format); return from; } //! Expects 1 or 2 digit day range: 1-31 - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& /*a_ios*/, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& /*a_ios*/, day_type& d) const { d = m_parser.parse_var_day_of_month(from, to); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& /*a_ios*/, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& /*a_ios*/, year_type& y) const { y = m_parser.parse_year(from, to, m_year_format); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& a_ios, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& a_ios, duration_type& dd) const { // skip leading whitespace - while(std::isspace(*from) && from != to) { ++from; } - - /* num_get.get() will always consume the first character if it - * is a sign indicator (+/-). Special value strings may begin + while(std::isspace(*from) && from != to) { ++from; } + + /* num_get.get() will always consume the first character if it + * is a sign indicator (+/-). Special value strings may begin * with one of these signs so we'll need a copy of it * in case num_get.get() fails. */ - char_type c = '\0'; + char_type c = '\0'; // TODO Are these characters somewhere in the locale? - if(*from == '-' || *from == '+') { + if(*from == '-' || *from == '+') { c = *from; } typedef std::num_get<CharT, InItrT> num_get; typename duration_type::duration_rep_type val = 0; std::ios_base::iostate err = std::ios_base::goodbit; - + if (std::has_facet<num_get>(a_ios.getloc())) { from = std::use_facet<num_get>(a_ios.getloc()).get(from, to, a_ios, err, val); } @@ -646,65 +629,65 @@ namespace boost { namespace date_time { boost::throw_exception(std::ios_base::failure("Parse failed. No match found for '" + mr.cache + "'")); BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return from); // should never reach } - dd = duration_type(static_cast<special_values>(mr.current_match)); + dd = duration_type(static_cast<special_values>(mr.current_match)); } else { dd = duration_type(val); } return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& a_ios, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& a_ios, period_type& p) const { - p = m_period_parser.get_period(from, to, a_ios, p, duration_type::unit(), *this); + p = m_period_parser.get_period(from, to, a_ios, p, duration_type::unit(), *this); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& a_ios, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& a_ios, nth_kday_type& nkd) const { nkd = m_date_gen_parser.get_nth_kday_type(from, to, a_ios, *this); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& a_ios, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& a_ios, partial_date_type& pd) const { pd = m_date_gen_parser.get_partial_date_type(from, to, a_ios, *this); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& a_ios, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& a_ios, first_kday_type& fkd) const { fkd = m_date_gen_parser.get_first_kday_type(from, to, a_ios, *this); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& a_ios, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& a_ios, last_kday_type& lkd) const { lkd = m_date_gen_parser.get_last_kday_type(from, to, a_ios, *this); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& a_ios, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& a_ios, kday_before_type& fkb) const { fkb = m_date_gen_parser.get_kday_before_type(from, to, a_ios, *this); return from; } - InItrT get(InItrT& from, - InItrT& to, - std::ios_base& a_ios, + InItrT get(InItrT& from, + InItrT& to, + std::ios_base& a_ios, kday_after_type& fka) const { fka = m_date_gen_parser.get_kday_after_type(from, to, a_ios, *this); @@ -727,52 +710,52 @@ namespace boost { namespace date_time { template <class date_type, class CharT, class OutItrT> std::locale::id date_input_facet<date_type, CharT, OutItrT>::id; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type date_input_facet<date_type, CharT, OutItrT>::long_weekday_format[3] = {'%','A'}; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type date_input_facet<date_type, CharT, OutItrT>::short_weekday_format[3] = {'%','a'}; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type date_input_facet<date_type, CharT, OutItrT>::long_month_format[3] = {'%','B'}; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type date_input_facet<date_type, CharT, OutItrT>::short_month_format[3] = {'%','b'}; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type date_input_facet<date_type, CharT, OutItrT>::four_digit_year_format[3] = {'%','Y'}; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type date_input_facet<date_type, CharT, OutItrT>::two_digit_year_format[3] = {'%','y'}; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type date_input_facet<date_type, CharT, OutItrT>::default_period_separator[4] = { ' ', '/', ' '}; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type - date_input_facet<date_type, CharT, OutItrT>::standard_format_specifier[3] = + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type + date_input_facet<date_type, CharT, OutItrT>::standard_format_specifier[3] = {'%', 'x' }; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type - date_input_facet<date_type, CharT, OutItrT>::iso_format_specifier[7] = + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type + date_input_facet<date_type, CharT, OutItrT>::iso_format_specifier[7] = {'%', 'Y', '%', 'm', '%', 'd' }; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type - date_input_facet<date_type, CharT, OutItrT>::iso_format_extended_specifier[9] = + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type + date_input_facet<date_type, CharT, OutItrT>::iso_format_extended_specifier[9] = {'%', 'Y', '-', '%', 'm', '-', '%', 'd' }; - template <class date_type, class CharT, class OutItrT> - const typename date_input_facet<date_type, CharT, OutItrT>::char_type - date_input_facet<date_type, CharT, OutItrT>::default_date_format[9] = + template <class date_type, class CharT, class OutItrT> + const typename date_input_facet<date_type, CharT, OutItrT>::char_type + date_input_facet<date_type, CharT, OutItrT>::default_date_format[9] = {'%','Y','-','%','b','-','%','d'}; } } // namespaces diff --git a/3rdParty/Boost/src/boost/date_time/date_parsing.hpp b/3rdParty/Boost/src/boost/date_time/date_parsing.hpp index 41b6aef..f361bc8 100644 --- a/3rdParty/Boost/src/boost/date_time/date_parsing.hpp +++ b/3rdParty/Boost/src/boost/date_time/date_parsing.hpp @@ -2,11 +2,11 @@ #define _DATE_TIME_DATE_PARSING_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-23 06:13:35 -0500 (Sun, 23 Nov 2008) $ + * $Date: 2009-06-04 04:24:49 -0400 (Thu, 04 Jun 2009) $ */ #include <string> @@ -29,11 +29,11 @@ namespace date_time { //! A function to replace the std::transform( , , ,tolower) construct /*! This function simply takes a string, and changes all the characters * in that string to lowercase (according to the default system locale). - * In the event that a compiler does not support locales, the old + * In the event that a compiler does not support locales, the old * C style tolower() is used. */ inline - std::string + std::string convert_to_lower(std::string inp) { #if !defined(BOOST_DATE_TIME_NO_LOCALE) @@ -57,11 +57,11 @@ namespace date_time { /* Used by-value parameter because we change the string and may * want to preserve the original argument */ template<class month_type> - inline unsigned short + inline unsigned short month_str_to_ushort(std::string const& s) { if((s.at(0) >= '0') && (s.at(0) <= '9')) { return boost::lexical_cast<unsigned short>(s); - } + } else { std::string str = convert_to_lower(s); typename month_type::month_map_ptr_type ptr = month_type::get_month_map_ptr(); @@ -78,11 +78,11 @@ namespace date_time { * must contain 'size' elements. The index of the match is returned. * If no match is found, 'size' is returned. * Ex. "Jan" returns 0, "Dec" returns 11, "Tue" returns 2. - * 'size' can be sent in with: greg_month::max() (which 12), - * greg_weekday::max() + 1 (which is 7) or date_time::NumSpecialValues */ + * 'size' can be sent in with: (greg_month::max)() (which 12), + * (greg_weekday::max)() + 1 (which is 7) or date_time::NumSpecialValues */ template<class charT> - short find_match(const charT* const* short_names, - const charT* const* long_names, + short find_match(const charT* const* short_names, + const charT* const* long_names, short size, const std::basic_string<charT>& s) { for(short i = 0; i < size; ++i){ @@ -92,12 +92,12 @@ namespace date_time { } return size; // not-found, return a value out of range } - + //! Generic function to parse a delimited date (eg: 2002-02-10) /*! Accepted formats are: "2003-02-10" or " 2003-Feb-10" or - * "2003-Feburary-10" - * The order in which the Month, Day, & Year appear in the argument - * string can be accomodated by passing in the appropriate ymd_order_spec + * "2003-Feburary-10" + * The order in which the Month, Day, & Year appear in the argument + * string can be accomodated by passing in the appropriate ymd_order_spec */ template<class date_type> date_type @@ -105,14 +105,14 @@ namespace date_time { std::string spec_str; if(order_spec == ymd_order_iso) { spec_str = "ymd"; - } + } else if(order_spec == ymd_order_dmy) { spec_str = "dmy"; - } + } else { // (order_spec == ymd_order_us) spec_str = "mdy"; } - + typedef typename date_type::year_type year_type; typedef typename date_type::month_type month_type; unsigned pos = 0; @@ -129,21 +129,21 @@ namespace date_time { const char sep_char[] = {',','-','.',' ','/','\0'}; char_separator_type sep(sep_char); tokenizer tok(s,sep); - for(tokenizer_iterator beg=tok.begin(); - beg!=tok.end() && pos < spec_str.size(); + for(tokenizer_iterator beg=tok.begin(); + beg!=tok.end() && pos < spec_str.size(); ++beg, ++pos) { switch(spec_str.at(pos)) { - case 'y': + case 'y': { year = boost::lexical_cast<unsigned short>(*beg); break; } - case 'm': + case 'm': { month = month_str_to_ushort<month_type>(*beg); break; } - case 'd': + case 'd': { day = boost::lexical_cast<unsigned short>(*beg); break; @@ -152,7 +152,7 @@ namespace date_time { } return date_type(year, month, day); } - + //! Generic function to parse undelimited date (eg: 20020201) template<class date_type> date_type @@ -162,16 +162,16 @@ namespace date_time { typedef typename date_type::year_type year_type; //typename date_type::ymd_type ymd((year_type::min)(),1,1); unsigned short y = 0, m = 0, d = 0; - - /* The two bool arguments state that parsing will not wrap - * (only the first 8 characters will be parsed) and partial - * strings will not be parsed. + + /* The two bool arguments state that parsing will not wrap + * (only the first 8 characters will be parsed) and partial + * strings will not be parsed. * Ex: * "2005121" will parse 2005 & 12, but not the "1" */ boost::offset_separator osf(offsets, offsets+3, false, false); - - typedef typename boost::tokenizer<boost::offset_separator, - std::basic_string<char>::const_iterator, + + typedef typename boost::tokenizer<boost::offset_separator, + std::basic_string<char>::const_iterator, std::basic_string<char> > tokenizer_type; tokenizer_type tok(s, osf); for(typename tokenizer_type::iterator ti=tok.begin(); ti!=tok.end();++ti) { @@ -185,17 +185,17 @@ namespace date_time { } return date_type(y,m,d); } - + //! Helper function for 'date gregorian::from_stream()' /*! Creates a string from the iterators that reference the - * begining & end of a char[] or string. All elements are + * begining & end of a char[] or string. All elements are * used in output string */ template<class date_type, class iterator_type> - inline + inline date_type - from_stream_type(iterator_type& beg, - iterator_type& end, - char) + from_stream_type(iterator_type& beg, + iterator_type const& end, + char) { std::ostringstream ss; while(beg != end) { @@ -203,16 +203,16 @@ namespace date_time { } return parse_date<date_type>(ss.str()); } - + //! Helper function for 'date gregorian::from_stream()' /*! Returns the first string found in the stream referenced by the * begining & end iterators */ template<class date_type, class iterator_type> - inline + inline date_type - from_stream_type(iterator_type& beg, - iterator_type& /* end */, - std::string) + from_stream_type(iterator_type& beg, + iterator_type const& /* end */, + std::string const&) { return parse_date<date_type>(*beg); } @@ -221,22 +221,30 @@ namespace date_time { * parse_date<>()? In the mean time this gets us started... */ //! Helper function for 'date gregorian::from_stream()' /*! Creates a string from the iterators that reference the - * begining & end of a wstring. All elements are + * begining & end of a wstring. All elements are * used in output string */ template<class date_type, class iterator_type> - inline - date_type from_stream_type(iterator_type& beg, - iterator_type& end, - wchar_t) + inline + date_type from_stream_type(iterator_type& beg, + iterator_type const& end, + wchar_t) { std::ostringstream ss; - while(beg != end) { #if !defined(BOOST_DATE_TIME_NO_LOCALE) - ss << std::use_facet<std::ctype<wchar_t> >(std::locale()).narrow(*beg++, 'X'); // 'X' will cause exception to be thrown + std::locale loc; + std::ctype<wchar_t> const& fac = std::use_facet<std::ctype<wchar_t> >(loc); + while(beg != end) { + ss << fac.narrow(*beg++, 'X'); // 'X' will cause exception to be thrown + } #else - ss << ss.narrow(*beg++, 'X'); -#endif + while(beg != end) { + char c = 'X'; // 'X' will cause exception to be thrown + const wchar_t wc = *beg++; + if (wc >= 0 && wc <= 127) + c = static_cast< char >(wc); + ss << c; } +#endif return parse_date<date_type>(ss.str()); } #ifndef BOOST_NO_STD_WSTRING @@ -244,21 +252,29 @@ namespace date_time { /*! Creates a string from the first wstring found in the stream * referenced by the begining & end iterators */ template<class date_type, class iterator_type> - inline + inline date_type - from_stream_type(iterator_type& beg, - iterator_type& /* end */, - std::wstring) { + from_stream_type(iterator_type& beg, + iterator_type const& /* end */, + std::wstring const&) { std::wstring ws = *beg; std::ostringstream ss; std::wstring::iterator wsb = ws.begin(), wse = ws.end(); - while(wsb != wse) { #if !defined(BOOST_DATE_TIME_NO_LOCALE) - ss << std::use_facet<std::ctype<wchar_t> >(std::locale()).narrow(*wsb++, 'X'); // 'X' will cause exception to be thrown + std::locale loc; + std::ctype<wchar_t> const& fac = std::use_facet<std::ctype<wchar_t> >(loc); + while(wsb != wse) { + ss << fac.narrow(*wsb++, 'X'); // 'X' will cause exception to be thrown + } #else - ss << ss.narrow(*wsb++, 'X'); // 'X' will cause exception to be thrown -#endif + while(wsb != wse) { + char c = 'X'; // 'X' will cause exception to be thrown + const wchar_t wc = *wsb++; + if (wc >= 0 && wc <= 127) + c = static_cast< char >(wc); + ss << c; } +#endif return parse_date<date_type>(ss.str()); } #endif // BOOST_NO_STD_WSTRING @@ -267,27 +283,27 @@ namespace date_time { #else //! function called by wrapper functions: date_period_from_(w)string() template<class date_type, class charT> - period<date_type, typename date_type::duration_type> + period<date_type, typename date_type::duration_type> from_simple_string_type(const std::basic_string<charT>& s){ typedef typename std::basic_string<charT>::traits_type traits_type; typedef typename boost::char_separator<charT, traits_type> char_separator; - typedef typename boost::tokenizer<char_separator, - typename std::basic_string<charT>::const_iterator, + typedef typename boost::tokenizer<char_separator, + typename std::basic_string<charT>::const_iterator, std::basic_string<charT> > tokenizer; const charT sep_list[4] = {'[','/',']','\0'}; char_separator sep(sep_list); tokenizer tokens(s, sep); - typename tokenizer::iterator tok_it = tokens.begin(); + typename tokenizer::iterator tok_it = tokens.begin(); std::basic_string<charT> date_string = *tok_it; // get 2 string iterators and generate a date from them - typename std::basic_string<charT>::iterator date_string_start = date_string.begin(), - date_string_end = date_string.end(); + typename std::basic_string<charT>::iterator date_string_start = date_string.begin(), + date_string_end = date_string.end(); typedef typename std::iterator_traits<typename std::basic_string<charT>::iterator>::value_type value_type; date_type d1 = from_stream_type<date_type>(date_string_start, date_string_end, value_type()); date_string = *(++tok_it); // next token - date_string_start = date_string.begin(), date_string_end = date_string.end(); + date_string_start = date_string.begin(), date_string_end = date_string.end(); date_type d2 = from_stream_type<date_type>(date_string_start, date_string_end, value_type()); - return period<date_type, typename date_type::duration_type>(d1, d2); + return period<date_type, typename date_type::duration_type>(d1, d2); } #endif diff --git a/3rdParty/Boost/src/boost/date_time/filetime_functions.hpp b/3rdParty/Boost/src/boost/date_time/filetime_functions.hpp index 79a3d4c..27ed754 100644 --- a/3rdParty/Boost/src/boost/date_time/filetime_functions.hpp +++ b/3rdParty/Boost/src/boost/date_time/filetime_functions.hpp @@ -6,11 +6,11 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-02-01 06:29:43 -0500 (Sun, 01 Feb 2009) $ + * $Date: 2009-06-06 07:24:09 -0400 (Sat, 06 Jun 2009) $ */ /*! @file filetime_functions.hpp - * Function(s) for converting between a FILETIME structure and a + * Function(s) for converting between a FILETIME structure and a * time object. This file is only available on systems that have * BOOST_HAS_FTIME defined. */ @@ -51,13 +51,13 @@ namespace winapi { boost::uint16_t wHour; boost::uint16_t wMinute; boost::uint16_t wSecond; - boost::uint16_t wMilliseconds; + boost::uint16_t wMilliseconds; }; - __declspec(dllimport) void __stdcall GetSystemTimeAsFileTime(FILETIME* lpFileTime); - __declspec(dllimport) int __stdcall FileTimeToLocalFileTime(const FILETIME* lpFileTime, FILETIME* lpLocalFileTime); - __declspec(dllimport) void __stdcall GetSystemTime(SYSTEMTIME* lpSystemTime); - __declspec(dllimport) int __stdcall SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime, FILETIME* lpFileTime); + __declspec(dllimport) void __stdcall GetSystemTimeAsFileTime(FILETIME* lpFileTime); + __declspec(dllimport) int __stdcall FileTimeToLocalFileTime(const FILETIME* lpFileTime, FILETIME* lpLocalFileTime); + __declspec(dllimport) void __stdcall GetSystemTime(SYSTEMTIME* lpSystemTime); + __declspec(dllimport) int __stdcall SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime, FILETIME* lpFileTime); } // extern "C" @@ -96,9 +96,7 @@ namespace winapi { { /* shift is difference between 1970-Jan-01 & 1601-Jan-01 * in 100-nanosecond intervals */ - const uint64_t c1 = 27111902UL; - const uint64_t c2 = 3577643008UL; // issues warning without 'UL' - const uint64_t shift = (c1 << 32) + c2; + const uint64_t shift = 116444736000000000ULL; // (27111902 << 32) + 3577643008 union { FileTimeT as_file_time; @@ -115,8 +113,8 @@ namespace winapi { //! Create a time object from an initialized FILETIME struct. /*! * Create a time object from an initialized FILETIME struct. - * A FILETIME struct holds 100-nanosecond units (0.0000001). When - * built with microsecond resolution the file_time's sub second value + * A FILETIME struct holds 100-nanosecond units (0.0000001). When + * built with microsecond resolution the file_time's sub second value * will be truncated. Nanosecond resolution has no truncation. * * \note The function is templated on the FILETIME type, so that diff --git a/3rdParty/Boost/src/boost/date_time/format_date_parser.hpp b/3rdParty/Boost/src/boost/date_time/format_date_parser.hpp index 21e4a49..a4a4d0d 100644 --- a/3rdParty/Boost/src/boost/date_time/format_date_parser.hpp +++ b/3rdParty/Boost/src/boost/date_time/format_date_parser.hpp @@ -7,7 +7,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $ + * $Date: 2009-06-04 04:24:49 -0400 (Thu, 04 Jun 2009) $ */ @@ -100,19 +100,19 @@ template<typename int_type, typename charT> inline int_type var_string_to_int(std::istreambuf_iterator<charT>& itr, - std::istreambuf_iterator<charT>& /* stream_end */, + const std::istreambuf_iterator<charT>& stream_end, unsigned int max_length) { typedef std::basic_string<charT> string_type; unsigned int j = 0; string_type s; - while ((j < max_length) && std::isdigit(*itr)) { + while (itr != stream_end && (j < max_length) && std::isdigit(*itr)) { s += (*itr); - itr++; - j++; + ++itr; + ++j; } int_type i = -1; - if(s.length() != 0) { + if(!s.empty()) { i = boost::lexical_cast<int_type>(s); } return i; diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/conversion.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/conversion.hpp index 4428c05..f35796e 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/conversion.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/conversion.hpp @@ -2,75 +2,65 @@ #define _GREGORIAN__CONVERSION_HPP___ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $ + * $Date: 2009-06-06 07:27:35 -0400 (Sat, 06 Jun 2009) $ */ #include <string> #include <stdexcept> #include <boost/throw_exception.hpp> -#include <boost/date_time/gregorian/gregorian_types.hpp> #include <boost/date_time/c_time.hpp> -#if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) -# if defined(BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS) -# include <boost/date_time/gregorian/formatters_limited.hpp> -# else -# include <boost/date_time/gregorian/formatters.hpp> -# endif // BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS -#else -# include <sstream> -# include <boost/date_time/gregorian/gregorian_io.hpp> -#endif // USE_DATE_TIME_PRE_1_33_FACET_IO +#include <boost/date_time/special_defs.hpp> +#include <boost/date_time/gregorian/gregorian_types.hpp> namespace boost { namespace gregorian { - //! Converts a date to a tm struct. Throws out_of_range exception if date is a special value inline - std::tm to_tm(const date& d) + std::tm to_tm(const date& d) { - if(d.is_pos_infinity() || d.is_neg_infinity() || d.is_not_a_date()){ - std::string s = "tm unable to handle date value of "; -#if defined(USE_DATE_TIME_PRE_1_33_FACET_IO) - s += to_simple_string(d); -#else - std::ostringstream ss; - ss << d; - s += ss.str(); -#endif // USE_DATE_TIME_PRE_1_33_FACET_IO - boost::throw_exception(std::out_of_range(s)); + if (d.is_special()) + { + std::string s = "tm unable to handle "; + switch (d.as_special()) + { + case date_time::not_a_date_time: + s += "not-a-date-time value"; break; + case date_time::neg_infin: + s += "-infinity date value"; break; + case date_time::pos_infin: + s += "+infinity date value"; break; + default: + s += "a special date value"; break; + } + boost::throw_exception(std::out_of_range(s)); } - std::tm datetm; + + std::tm datetm = {}; // zero initialization is needed for extension members, like tm_zone boost::gregorian::date::ymd_type ymd = d.year_month_day(); - datetm.tm_year = ymd.year-1900; - datetm.tm_mon = ymd.month-1; + datetm.tm_year = ymd.year - 1900; + datetm.tm_mon = ymd.month - 1; datetm.tm_mday = ymd.day; datetm.tm_wday = d.day_of_week(); - datetm.tm_yday = d.day_of_year()-1; - datetm.tm_hour = datetm.tm_min = datetm.tm_sec = 0; + datetm.tm_yday = d.day_of_year() - 1; datetm.tm_isdst = -1; // negative because not enough info to set tm_isdst return datetm; } //! Converts a tm structure into a date dropping the any time values. inline - date date_from_tm(const std::tm& datetm) + date date_from_tm(const std::tm& datetm) { - return date(static_cast<unsigned short>(datetm.tm_year+1900), - static_cast<unsigned short>(datetm.tm_mon+1), + return date(static_cast<unsigned short>(datetm.tm_year+1900), + static_cast<unsigned short>(datetm.tm_mon+1), static_cast<unsigned short>(datetm.tm_mday)); } - } } //namespace boost::gregorian - - - #endif - diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_calendar.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_calendar.hpp index b8b1f5a..483ead5 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_calendar.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_calendar.hpp @@ -2,27 +2,28 @@ #define GREGORIAN_GREGORIAN_CALENDAR_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * Author: Jeff Garland + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ -#include "boost/date_time/gregorian/greg_weekday.hpp" -#include "boost/date_time/gregorian/greg_day_of_year.hpp" -#include "boost/date_time/gregorian_calendar.hpp" -#include "boost/date_time/gregorian/greg_ymd.hpp" -#include "boost/date_time/int_adapter.hpp" +#include <boost/cstdint.hpp> +#include <boost/date_time/gregorian/greg_weekday.hpp> +#include <boost/date_time/gregorian/greg_day_of_year.hpp> +#include <boost/date_time/gregorian_calendar.hpp> +#include <boost/date_time/gregorian/greg_ymd.hpp> +#include <boost/date_time/int_adapter.hpp> namespace boost { namespace gregorian { - + //!An internal date representation that includes infinities, not a date - typedef date_time::int_adapter<unsigned long> fancy_date_rep; + typedef date_time::int_adapter<uint32_t> fancy_date_rep; //! Gregorian calendar for this implementation, hard work in the base - class gregorian_calendar : + class gregorian_calendar : public date_time::gregorian_calendar_base<greg_year_month_day, fancy_date_rep::int_type> { public: //! Type to hold a weekday (eg: Sunday, Monday,...) @@ -34,14 +35,14 @@ namespace gregorian { //! Date rep implements the traits stuff as well typedef fancy_date_rep date_traits_type; - + private: }; } } //namespace gregorian - + #endif - + diff --git a/3rdParty/Boost/src/boost/date_time/gregorian/greg_date.hpp b/3rdParty/Boost/src/boost/date_time/gregorian/greg_date.hpp index 56d576f..ad67c0c 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian/greg_date.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian/greg_date.hpp @@ -2,11 +2,11 @@ #define GREG_DATE_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland - * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $ + * Author: Jeff Garland + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include <boost/throw_exception.hpp> @@ -28,10 +28,10 @@ namespace gregorian { using date_time::min_date_time; //! A date type based on gregorian_calendar - /*! This class is the primary interface for programming with + /*! This class is the primary interface for programming with greogorian dates. The is a lightweight type that can be - freely passed by value. All comparison operators are - supported. + freely passed by value. All comparison operators are + supported. \ingroup date_basics */ class date : public date_time::date<date, gregorian_calendar, date_duration> @@ -52,7 +52,7 @@ namespace gregorian { {} #endif // DATE_TIME_NO_DEFAULT_CONSTRUCTOR //! Main constructor with year, month, day - date(year_type y, month_type m, day_type d) + date(year_type y, month_type m, day_type d) : date_time::date<date, gregorian_calendar, date_duration>(y, m, d) { if (gregorian_calendar::end_of_month_day(y, m) < d) { @@ -60,7 +60,7 @@ namespace gregorian { } } //! Constructor from a ymd_type structure - explicit date(const ymd_type& ymd) + explicit date(const ymd_type& ymd) : date_time::date<date, gregorian_calendar, date_duration>(ymd) {} //! Needed copy constructor @@ -99,16 +99,16 @@ namespace gregorian { return day_of_year_type(doy); } //!Return the Modified Julian Day number for the date. - long modjulian_day() const + date_int_type modjulian_day() const { ymd_type ymd = year_month_day(); - return gregorian_calendar::modjulian_day_number(ymd); + return gregorian_calendar::modjulian_day_number(ymd); } //!Return the iso 8601 week number 1..53 int week_number() const { ymd_type ymd = year_month_day(); - return gregorian_calendar::week_number(ymd); + return gregorian_calendar::week_number(ymd); } //! Return the day number from the calendar date_int_type day_number() const @@ -118,7 +118,7 @@ namespace gregorian { //! Return the last day of the current month date end_of_month() const { - ymd_type ymd = year_month_day(); + ymd_type ymd = year_month_day(); short eom_day = gregorian_calendar::end_of_month_day(ymd.year, ymd.month); return date(ymd.year, ymd.month, eom_day); } @@ -126,7 +126,7 @@ namespace gregorian { private: }; - + } } //namespace gregorian diff --git a/3rdParty/Boost/src/boost/date_time/gregorian_calendar.hpp b/3rdParty/Boost/src/boost/date_time/gregorian_calendar.hpp index 6386008..c27c09e 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian_calendar.hpp +++ b/3rdParty/Boost/src/boost/date_time/gregorian_calendar.hpp @@ -2,11 +2,11 @@ #define DATE_TIME_GREGORIAN_CALENDAR_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * Author: Jeff Garland + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ @@ -27,7 +27,7 @@ namespace date_time { template<typename ymd_type_, typename date_int_type_> class gregorian_calendar_base { public: - //! define a type a date split into components + //! define a type a date split into components typedef ymd_type_ ymd_type; //! define a type for representing months typedef typename ymd_type::month_type month_type; @@ -44,10 +44,10 @@ namespace date_time { //static unsigned short day_of_year(date_int_type); static date_int_type day_number(const ymd_type& ymd); static date_int_type julian_day_number(const ymd_type& ymd); - static long modjulian_day_number(const ymd_type& ymd); + static date_int_type modjulian_day_number(const ymd_type& ymd); static ymd_type from_day_number(date_int_type); static ymd_type from_julian_day_number(date_int_type); - static ymd_type from_modjulian_day_number(long); + static ymd_type from_modjulian_day_number(date_int_type); static bool is_leap_year(year_type); static unsigned short end_of_month_day(year_type y, month_type m); static ymd_type epoch(); @@ -58,7 +58,7 @@ namespace date_time { } } //namespace - + #ifndef NO_BOOST_DATE_TIME_INLINE #include "boost/date_time/gregorian_calendar.ipp" #endif @@ -66,5 +66,5 @@ namespace date_time { #endif - + diff --git a/3rdParty/Boost/src/boost/date_time/gregorian_calendar.ipp b/3rdParty/Boost/src/boost/date_time/gregorian_calendar.ipp index b7628fc..a281b45 100644 --- a/3rdParty/Boost/src/boost/date_time/gregorian_calendar.ipp +++ b/3rdParty/Boost/src/boost/date_time/gregorian_calendar.ipp @@ -1,9 +1,9 @@ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #ifndef NO_BOOST_DATE_TIME_INLINE @@ -27,10 +27,10 @@ namespace date_time { //std::cout << year << "-" << month << "-" << day << " is day: " << d << "\n"; return d; } - + //!Return the iso week number for the date /*!Implements the rules associated with the iso 8601 week number. - Basically the rule is that Week 1 of the year is the week that contains + Basically the rule is that Week 1 of the year is the week that contains January 4th or the week that contains the first Thursday in January. Reference for this algorithm is the Calendar FAQ by Claus Tondering, April 2000. */ @@ -42,11 +42,11 @@ namespace date_time { unsigned long juliantoday = julian_day_number(ymd); unsigned long day = (julianbegin + 3) % 7; unsigned long week = (juliantoday + day - julianbegin + 4)/7; - + if ((week >= 1) && (week <= 52)) { return week; } - + if ((week == 53)) { if((day==6) ||(day == 5 && is_leap_year(ymd.year))) { return week; //under these circumstances week == 53. @@ -62,18 +62,18 @@ namespace date_time { week = (juliantoday + day - julianbegin + 4)/7; return week; } - + return week; //not reachable -- well except if day == 5 and is_leap_year != true - + } - + //! Convert a ymd_type into a day number /*! The day number is an absolute number of days since the start of count */ template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE date_int_type_ - gregorian_calendar_base<ymd_type_,date_int_type_>::day_number(const ymd_type& ymd) + gregorian_calendar_base<ymd_type_,date_int_type_>::day_number(const ymd_type& ymd) { unsigned short a = static_cast<unsigned short>((14-ymd.month)/12); unsigned short y = static_cast<unsigned short>(ymd.year + 4800 - a); @@ -81,14 +81,14 @@ namespace date_time { unsigned long d = ymd.day + ((153*m + 2)/5) + 365*y + (y/4) - (y/100) + (y/400) - 32045; return d; } - + //! Convert a year-month-day into the julian day number /*! Since this implementation uses julian day internally, this is the same as the day_number. */ template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE date_int_type_ - gregorian_calendar_base<ymd_type_,date_int_type_>::julian_day_number(const ymd_type& ymd) + gregorian_calendar_base<ymd_type_,date_int_type_>::julian_day_number(const ymd_type& ymd) { return day_number(ymd); } @@ -99,17 +99,17 @@ namespace date_time { */ template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE - long - gregorian_calendar_base<ymd_type_,date_int_type_>::modjulian_day_number(const ymd_type& ymd) + date_int_type_ + gregorian_calendar_base<ymd_type_,date_int_type_>::modjulian_day_number(const ymd_type& ymd) { return julian_day_number(ymd)-2400001; //prerounded } - + //! Change a day number into a year-month-day template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE ymd_type_ - gregorian_calendar_base<ymd_type_,date_int_type_>::from_day_number(date_int_type dayNumber) + gregorian_calendar_base<ymd_type_,date_int_type_>::from_day_number(date_int_type dayNumber) { date_int_type a = dayNumber + 32044; date_int_type b = (4*a + 3)/146097; @@ -121,15 +121,15 @@ namespace date_time { unsigned short month = static_cast<unsigned short>(m + 3 - 12 * (m/10)); year_type year = static_cast<unsigned short>(100*b + d - 4800 + (m/10)); //std::cout << year << "-" << month << "-" << day << "\n"; - + return ymd_type(static_cast<unsigned short>(year),month,day); } - + //! Change a day number into a year-month-day template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE ymd_type_ - gregorian_calendar_base<ymd_type_,date_int_type_>::from_julian_day_number(date_int_type dayNumber) + gregorian_calendar_base<ymd_type_,date_int_type_>::from_julian_day_number(date_int_type dayNumber) { date_int_type a = dayNumber + 32044; date_int_type b = (4*a+3)/146097; @@ -141,19 +141,19 @@ namespace date_time { unsigned short month = static_cast<unsigned short>(m + 3 - 12 * (m/10)); year_type year = static_cast<year_type>(100*b + d - 4800 + (m/10)); //std::cout << year << "-" << month << "-" << day << "\n"; - + return ymd_type(year,month,day); } - + //! Change a modified julian day number into a year-month-day template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE ymd_type_ - gregorian_calendar_base<ymd_type_,date_int_type_>::from_modjulian_day_number(long dayNumber) { + gregorian_calendar_base<ymd_type_,date_int_type_>::from_modjulian_day_number(date_int_type dayNumber) { date_int_type jd = dayNumber + 2400001; //is 2400000.5 prerounded return from_julian_day_number(jd); } - + //! Determine if the provided year is a leap year /*! *@return true if year is a leap year, false otherwise @@ -161,12 +161,12 @@ namespace date_time { template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE bool - gregorian_calendar_base<ymd_type_,date_int_type_>::is_leap_year(year_type year) + gregorian_calendar_base<ymd_type_,date_int_type_>::is_leap_year(year_type year) { //divisible by 4, not if divisible by 100, but true if divisible by 400 return (!(year % 4)) && ((year % 100) || (!(year % 400))); } - + //! Calculate the last day of the month /*! Find the day which is the end of the month given year and month * No error checking is performed. @@ -175,7 +175,7 @@ namespace date_time { BOOST_DATE_TIME_INLINE unsigned short gregorian_calendar_base<ymd_type_,date_int_type_>::end_of_month_day(year_type year, - month_type month) + month_type month) { switch (month) { case 2: @@ -194,12 +194,12 @@ namespace date_time { }; } - + //! Provide the ymd_type specification for the calandar start template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE ymd_type_ - gregorian_calendar_base<ymd_type_,date_int_type_>::epoch() + gregorian_calendar_base<ymd_type_,date_int_type_>::epoch() { return ymd_type(1400,1,1); } @@ -208,7 +208,7 @@ namespace date_time { template<typename ymd_type_, typename date_int_type_> BOOST_DATE_TIME_INLINE unsigned short - gregorian_calendar_base<ymd_type_,date_int_type_>::days_in_week() + gregorian_calendar_base<ymd_type_,date_int_type_>::days_in_week() { return 7; } diff --git a/3rdParty/Boost/src/boost/date_time/microsec_time_clock.hpp b/3rdParty/Boost/src/boost/date_time/microsec_time_clock.hpp index 363af5e..e6f3b8e 100644 --- a/3rdParty/Boost/src/boost/date_time/microsec_time_clock.hpp +++ b/3rdParty/Boost/src/boost/date_time/microsec_time_clock.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-23 06:13:35 -0500 (Sun, 23 Nov 2008) $ + * $Date: 2009-06-04 07:36:43 -0400 (Thu, 04 Jun 2009) $ */ @@ -89,7 +89,7 @@ namespace date_time { winapi::get_system_time_as_file_time(ft); uint64_t micros = winapi::file_time_to_microseconds(ft); // it will not wrap, since ft is the current time // and cannot be before 1970-Jan-01 - std::time_t t = static_cast<time_t>(micros / 1000000UL); // seconds since epoch + std::time_t t = static_cast<std::time_t>(micros / 1000000UL); // seconds since epoch // microseconds -- static casts supress warnings boost::uint32_t sub_sec = static_cast<boost::uint32_t>(micros % 1000000UL); #else diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp index 82f8dca..9cdb864 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/conversion.hpp @@ -2,18 +2,19 @@ #define POSIX_TIME_CONVERSION_HPP___ /* Copyright (c) 2002-2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 14:37:53 -0500 (Wed, 12 Nov 2008) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ -#include "boost/date_time/posix_time/ptime.hpp" -#include "boost/date_time/posix_time/posix_time_duration.hpp" -#include "boost/date_time/filetime_functions.hpp" -#include "boost/date_time/c_time.hpp" -#include "boost/date_time/gregorian/conversion.hpp" +#include <boost/date_time/posix_time/ptime.hpp> +#include <boost/date_time/posix_time/posix_time_duration.hpp> +#include <boost/date_time/filetime_functions.hpp> +#include <boost/date_time/c_time.hpp> +#include <boost/date_time/time_resolution_traits.hpp> // absolute_value +#include <boost/date_time/gregorian/conversion.hpp> namespace boost { @@ -22,34 +23,28 @@ namespace posix_time { //! Function that converts a time_t into a ptime. inline - ptime from_time_t(std::time_t t) + ptime from_time_t(std::time_t t) { ptime start(gregorian::date(1970,1,1)); return start + seconds(static_cast<long>(t)); } - //! Convert a time to a tm structure truncating any fractional seconds + //! Convert a time to a tm structure truncating any fractional seconds inline std::tm to_tm(const boost::posix_time::ptime& t) { std::tm timetm = boost::gregorian::to_tm(t.date()); boost::posix_time::time_duration td = t.time_of_day(); - timetm.tm_hour = td.hours(); - timetm.tm_min = td.minutes(); + timetm.tm_hour = td.hours(); + timetm.tm_min = td.minutes(); timetm.tm_sec = td.seconds(); - timetm.tm_isdst = -1; // -1 used when dst info is unknown + timetm.tm_isdst = -1; // -1 used when dst info is unknown return timetm; } - //! Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components + //! Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components inline std::tm to_tm(const boost::posix_time::time_duration& td) { - std::tm timetm; - timetm.tm_year = 0; - timetm.tm_mon = 0; - timetm.tm_mday = 0; - timetm.tm_wday = 0; - timetm.tm_yday = 0; - - timetm.tm_hour = date_time::absolute_value(td.hours()); + std::tm timetm = {}; + timetm.tm_hour = date_time::absolute_value(td.hours()); timetm.tm_min = date_time::absolute_value(td.minutes()); timetm.tm_sec = date_time::absolute_value(td.seconds()); timetm.tm_isdst = -1; // -1 used when dst info is unknown @@ -65,12 +60,12 @@ namespace posix_time { #if defined(BOOST_HAS_FTIME) - + //! Function to create a time object from an initialized FILETIME struct. /*! Function to create a time object from an initialized FILETIME struct. - * A FILETIME struct holds 100-nanosecond units (0.0000001). When - * built with microsecond resolution the FILETIME's sub second value - * will be truncated. Nanosecond resolution has no truncation. + * A FILETIME struct holds 100-nanosecond units (0.0000001). When + * built with microsecond resolution the FILETIME's sub second value + * will be truncated. Nanosecond resolution has no truncation. * * \note FILETIME is part of the Win32 API, so it is not portable to non-windows * platforms. diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp index c40a15c..60c3f7e 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/posix_time_config.hpp @@ -2,22 +2,22 @@ #define POSIX_TIME_CONFIG_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-10-13 05:00:03 -0400 (Mon, 13 Oct 2008) $ + * $Date: 2009-06-04 07:52:28 -0400 (Thu, 04 Jun 2009) $ */ -#include "boost/date_time/time_duration.hpp" -#include "boost/date_time/time_resolution_traits.hpp" -#include "boost/date_time/gregorian/gregorian_types.hpp" -#include "boost/date_time/wrapping_int.hpp" -#include "boost/limits.hpp" -#include "boost/date_time/compiler_config.hpp" -#include "boost/cstdint.hpp" -#include <boost/config/no_tr1/cmath.hpp> #include <cstdlib> //for MCW 7.2 std::abs(long long) +#include <boost/limits.hpp> +#include <boost/cstdint.hpp> +#include <boost/config/no_tr1/cmath.hpp> +#include <boost/date_time/time_duration.hpp> +#include <boost/date_time/time_resolution_traits.hpp> +#include <boost/date_time/gregorian/gregorian_types.hpp> +#include <boost/date_time/wrapping_int.hpp> +#include <boost/date_time/compiler_config.hpp> namespace boost { namespace posix_time { @@ -30,7 +30,7 @@ namespace posix_time { #define BOOST_DATE_TIME_HAS_MILLISECONDS #define BOOST_DATE_TIME_HAS_MICROSECONDS #define BOOST_DATE_TIME_HAS_NANOSECONDS - typedef date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::nano, + typedef date_time::time_resolution_traits<boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::nano, 1000000000, 9 > time_res_traits; #else // set up conditional test compilations @@ -38,14 +38,14 @@ namespace posix_time { #define BOOST_DATE_TIME_HAS_MICROSECONDS #undef BOOST_DATE_TIME_HAS_NANOSECONDS typedef date_time::time_resolution_traits< - boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::micro, + boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::micro, 1000000, 6 > time_res_traits; // #undef BOOST_DATE_TIME_HAS_MILLISECONDS // #undef BOOST_DATE_TIME_HAS_MICROSECONDS // #undef BOOST_DATE_TIME_HAS_NANOSECONDS -// typedef date_time::time_resolution_traits<boost::int64_t, boost::date_time::tenth, +// typedef date_time::time_resolution_traits<boost::int64_t, boost::date_time::tenth, // 10, 0 > time_res_traits; #endif @@ -82,8 +82,8 @@ namespace posix_time { //Give duration access to ticks constructor -- hide from users friend class date_time::time_duration<time_duration, time_res_traits>; private: - explicit time_duration(impl_type ticks) : - date_time::time_duration<time_duration, time_res_traits>(ticks) + explicit time_duration(impl_type tick_count) : + date_time::time_duration<time_duration, time_res_traits>(tick_count) {} }; @@ -134,7 +134,7 @@ namespace posix_time { } }; - class posix_time_system_config + class posix_time_system_config { public: typedef simple_time_rep time_rep_type; @@ -143,7 +143,7 @@ namespace posix_time { typedef time_duration time_duration_type; typedef time_res_traits::tick_type int_type; typedef time_res_traits resolution_traits; -#if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers +#if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers #else BOOST_STATIC_CONSTANT(boost::int64_t, tick_per_second = 1000000000); #endif @@ -151,7 +151,7 @@ namespace posix_time { #else - class millisec_posix_time_system_config + class millisec_posix_time_system_config { public: typedef boost::int64_t time_rep_type; @@ -162,7 +162,7 @@ namespace posix_time { typedef time_res_traits::tick_type int_type; typedef time_res_traits::impl_type impl_type; typedef time_res_traits resolution_traits; -#if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers +#if (defined(BOOST_DATE_TIME_NO_MEMBER_INIT)) //help bad compilers #else BOOST_STATIC_CONSTANT(boost::int64_t, tick_per_second = 1000000); #endif diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp index dc8facf..466331b 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters.hpp @@ -2,24 +2,24 @@ #define POSIXTIME_FORMATTERS_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ -#include "boost/date_time/gregorian/gregorian.hpp" -#include "boost/date_time/compiler_config.hpp" -#include "boost/date_time/iso_format.hpp" -#include "boost/date_time/date_format_simple.hpp" -#include "boost/date_time/posix_time/posix_time_types.hpp" -#include "boost/date_time/time_formatting_streams.hpp" +#include <boost/date_time/gregorian/gregorian.hpp> +#include <boost/date_time/compiler_config.hpp> +#include <boost/date_time/iso_format.hpp> +#include <boost/date_time/date_format_simple.hpp> +#include <boost/date_time/posix_time/posix_time_types.hpp> +#include <boost/date_time/time_formatting_streams.hpp> +#include <boost/date_time/time_resolution_traits.hpp> // absolute_value +#include <boost/date_time/time_parsing.hpp> -#include "boost/date_time/time_parsing.hpp" - -/* NOTE: The "to_*_string" code for older compilers, ones that define - * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in +/* NOTE: The "to_*_string" code for older compilers, ones that define + * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in * formatters_limited.hpp */ @@ -57,27 +57,27 @@ namespace posix_time { if(td.is_negative()) { ss << '-'; } - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.hours()) << ":"; - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.minutes()) << ":"; - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) - boost::int64_t frac_sec = + boost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] charT buff[32]; _i64toa(frac_sec, buff, 10); #else - time_duration::fractional_seconds_type frac_sec = + time_duration::fractional_seconds_type frac_sec = date_time::absolute_value(td.fractional_seconds()); #endif if (frac_sec != 0) { ss << "." << std::setw(time_duration::num_fractional_digits()) << std::setfill(fill_char) - + // JDG [7/6/02 VC++ compatibility] #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) << buff; @@ -99,7 +99,7 @@ namespace posix_time { // template function called by wrapper functions: // to_*_string(time_duration) & to_*_wstring(time_duration) template<class charT> - inline std::basic_string<charT> to_iso_string_type(time_duration td) + inline std::basic_string<charT> to_iso_string_type(time_duration td) { std::basic_ostringstream<charT> ss; if(td.is_special()) { @@ -126,27 +126,27 @@ namespace posix_time { if(td.is_negative()) { ss << '-'; } - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.hours()); - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.minutes()); - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) - boost::int64_t frac_sec = + boost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] charT buff[32]; _i64toa(frac_sec, buff, 10); #else - time_duration::fractional_seconds_type frac_sec = + time_duration::fractional_seconds_type frac_sec = date_time::absolute_value(td.fractional_seconds()); #endif if (frac_sec != 0) { ss << "." << std::setw(time_duration::num_fractional_digits()) << std::setfill(fill_char) - + // JDG [7/6/02 VC++ compatibility] #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) << buff; @@ -168,7 +168,7 @@ namespace posix_time { /*!\ingroup time_format */ template<class charT> - inline std::basic_string<charT> to_simple_string_type(ptime t) + inline std::basic_string<charT> to_simple_string_type(ptime t) { // can't use this w/gcc295, no to_simple_string_type<>(td) available std::basic_string<charT> ts = gregorian::to_simple_string_type<charT>(t.date());// + " "; @@ -184,10 +184,10 @@ namespace posix_time { return to_simple_string_type<char>(t); } - // function called by wrapper functions to_*_string(time_period) + // function called by wrapper functions to_*_string(time_period) // & to_*_wstring(time_period) template<class charT> - inline std::basic_string<charT> to_simple_string_type(time_period tp) + inline std::basic_string<charT> to_simple_string_type(time_period tp) { charT beg = '[', mid = '/', end = ']'; std::basic_string<charT> d1(to_simple_string_type<charT>(tp.begin())); @@ -201,10 +201,10 @@ namespace posix_time { return to_simple_string_type<char>(tp); } - // function called by wrapper functions to_*_string(time_period) + // function called by wrapper functions to_*_string(time_period) // & to_*_wstring(time_period) template<class charT> - inline std::basic_string<charT> to_iso_string_type(ptime t) + inline std::basic_string<charT> to_iso_string_type(ptime t) { std::basic_string<charT> ts = gregorian::to_iso_string_type<charT>(t.date());// + "T"; if(!t.time_of_day().is_special()) { @@ -223,10 +223,10 @@ namespace posix_time { } - // function called by wrapper functions to_*_string(time_period) + // function called by wrapper functions to_*_string(time_period) // & to_*_wstring(time_period) template<class charT> - inline std::basic_string<charT> to_iso_extended_string_type(ptime t) + inline std::basic_string<charT> to_iso_extended_string_type(ptime t) { std::basic_string<charT> ts = gregorian::to_iso_extended_string_type<charT>(t.date());// + "T"; if(!t.time_of_day().is_special()) { diff --git a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp index def5169..d0e959e 100644 --- a/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp +++ b/3rdParty/Boost/src/boost/date_time/posix_time/time_formatters_limited.hpp @@ -2,20 +2,21 @@ #define POSIXTIME_FORMATTERS_LIMITED_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ -#include "boost/date_time/gregorian/gregorian.hpp" -#include "boost/date_time/compiler_config.hpp" -#include "boost/date_time/iso_format.hpp" -#include "boost/date_time/date_format_simple.hpp" -#include "boost/date_time/posix_time/posix_time_types.hpp" -#include "boost/date_time/time_formatting_streams.hpp" - +#include <boost/date_time/gregorian/gregorian.hpp> +#include <boost/date_time/compiler_config.hpp> +#include <boost/date_time/iso_format.hpp> +#include <boost/date_time/date_format_simple.hpp> +#include <boost/date_time/posix_time/posix_time_types.hpp> +#include <boost/date_time/time_formatting_streams.hpp> +#include <boost/date_time/time_resolution_traits.hpp> // absolute_value + namespace boost { namespace posix_time { @@ -49,27 +50,27 @@ namespace posix_time { if(td.is_negative()) { ss << '-'; } - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.hours()) << ":"; - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.minutes()) << ":"; - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) - boost::int64_t frac_sec = + boost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] char buff[32]; _i64toa(frac_sec, buff, 10); #else - time_duration::fractional_seconds_type frac_sec = + time_duration::fractional_seconds_type frac_sec = date_time::absolute_value(td.fractional_seconds()); #endif if (frac_sec != 0) { ss << "." << std::setw(time_duration::num_fractional_digits()) << std::setfill('0') - + // JDG [7/6/02 VC++ compatibility] #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) << buff; @@ -84,9 +85,9 @@ namespace posix_time { //! Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456 /*!\ingroup time_format */ - inline - std::string - to_iso_string(time_duration td) + inline + std::string + to_iso_string(time_duration td) { std::ostringstream ss; if(td.is_special()) { @@ -112,27 +113,27 @@ namespace posix_time { if(td.is_negative()) { ss << '-'; } - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.hours()); - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.minutes()); - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) - boost::int64_t frac_sec = + boost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] char buff[32]; _i64toa(frac_sec, buff, 10); #else - time_duration::fractional_seconds_type frac_sec = + time_duration::fractional_seconds_type frac_sec = date_time::absolute_value(td.fractional_seconds()); #endif if (frac_sec != 0) { ss << "." << std::setw(time_duration::num_fractional_digits()) << std::setfill('0') - + // JDG [7/6/02 VC++ compatibility] #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) << buff; @@ -147,9 +148,9 @@ namespace posix_time { //! Time to simple format CCYY-mmm-dd hh:mm:ss.fffffff /*!\ingroup time_format */ - inline - std::string - to_simple_string(ptime t) + inline + std::string + to_simple_string(ptime t) { std::string ts = gregorian::to_simple_string(t.date());// + " "; if(!t.time_of_day().is_special()) { @@ -163,9 +164,9 @@ namespace posix_time { //! Convert to string of form [YYYY-mmm-DD HH:MM::SS.ffffff/YYYY-mmm-DD HH:MM::SS.fffffff] /*!\ingroup time_format */ - inline - std::string - to_simple_string(time_period tp) + inline + std::string + to_simple_string(time_period tp) { std::string d1(to_simple_string(tp.begin())); std::string d2(to_simple_string(tp.last())); @@ -175,8 +176,8 @@ namespace posix_time { //! Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator /*!\ingroup time_format */ - inline - std::string to_iso_string(ptime t) + inline + std::string to_iso_string(ptime t) { std::string ts = gregorian::to_iso_string(t.date());// + "T"; if(!t.time_of_day().is_special()) { @@ -190,9 +191,9 @@ namespace posix_time { //! Convert to form YYYY-MM-DDTHH:MM:SS where T is the date-time separator /*!\ingroup time_format */ - inline - std::string - to_iso_extended_string(ptime t) + inline + std::string + to_iso_extended_string(ptime t) { std::string ts = gregorian::to_iso_extended_string(t.date());// + "T"; if(!t.time_of_day().is_special()) { diff --git a/3rdParty/Boost/src/boost/date_time/time_duration.hpp b/3rdParty/Boost/src/boost/date_time/time_duration.hpp index 4004125..2fd2590 100644 --- a/3rdParty/Boost/src/boost/date_time/time_duration.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_duration.hpp @@ -6,18 +6,19 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2009-06-04 04:24:49 -0400 (Thu, 04 Jun 2009) $ */ -#include "boost/operators.hpp" -#include "boost/date_time/time_defs.hpp" -#include "boost/date_time/special_defs.hpp" -#include "boost/date_time/compiler_config.hpp" +#include <boost/cstdint.hpp> +#include <boost/operators.hpp> +#include <boost/date_time/time_defs.hpp> +#include <boost/date_time/special_defs.hpp> +#include <boost/date_time/compiler_config.hpp> namespace boost { namespace date_time { - + //! Represents some amount of elapsed time measure to a given resolution /*! This class represents a standard set of capabilities for all counted time durations. Time duration implementations should derive @@ -30,13 +31,13 @@ namespace date_time { */ template<class T, typename rep_type> class time_duration : private - boost::less_than_comparable<T + boost::less_than_comparable<T , boost::equality_comparable<T > > /* dividable, addable, and subtractable operator templates - * won't work with this class (MSVC++ 6.0). return type - * from '+=' is different than expected return type - * from '+'. multipliable probably wont work + * won't work with this class (MSVC++ 6.0). return type + * from '+=' is different than expected return type + * from '+'. multipliable probably wont work * either (haven't tried) */ { public: @@ -50,12 +51,12 @@ namespace date_time { typedef typename rep_type::tick_type tick_type; typedef typename rep_type::impl_type impl_type; - time_duration() : ticks_(0) {} - time_duration(hour_type hours_in, - min_type minutes_in, + time_duration() : ticks_(0) {} + time_duration(hour_type hours_in, + min_type minutes_in, sec_type seconds_in=0, fractional_seconds_type frac_sec_in = 0) : - ticks_(rep_type::to_tick_count(hours_in,minutes_in,seconds_in,frac_sec_in)) + ticks_(rep_type::to_tick_count(hours_in,minutes_in,seconds_in,frac_sec_in)) {} // copy constructor required for dividable<> //! Construct from another time_duration (Copy constructor) @@ -136,17 +137,17 @@ namespace date_time { } duration_type invert_sign() const { - return duration_type(ticks_ * (-1)); - } + return duration_type(ticks_ * (-1)); + } bool is_negative() const { return ticks_ < 0; - } - bool operator<(const time_duration& rhs) const + } + bool operator<(const time_duration& rhs) const { return ticks_ < rhs.ticks_; } - bool operator==(const time_duration& rhs) const + bool operator==(const time_duration& rhs) const { return ticks_ == rhs.ticks_; } @@ -188,13 +189,13 @@ namespace date_time { { return duration_type(ticks_ * rhs); } - duration_type operator*=(int divisor) + duration_type operator*=(int divisor) { ticks_ = ticks_ * divisor; return duration_type(ticks_); } - tick_type ticks() const - { + tick_type ticks() const + { return traits_type::as_number(ticks_); } @@ -258,9 +259,9 @@ namespace date_time { //! Template for instantiating derived adjusting durations /* These templates are designed to work with multiples of - * 10 for frac_of_second and resoultion adjustment + * 10 for frac_of_second and resoultion adjustment */ - template<class base_duration, boost::int64_t frac_of_second> + template<class base_duration, boost::int64_t frac_of_second> class subsecond_duration : public base_duration { public: @@ -270,8 +271,8 @@ namespace date_time { {} }; - - + + } } //namespace date_time diff --git a/3rdParty/Boost/src/boost/date_time/time_facet.hpp b/3rdParty/Boost/src/boost/date_time/time_facet.hpp index c1a2f8e..3f27f77 100644 --- a/3rdParty/Boost/src/boost/date_time/time_facet.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_facet.hpp @@ -3,11 +3,11 @@ #define _DATE_TIME_FACET__HPP__ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Martin Andrian, Jeff Garland, Bart Garst - * $Date: 2008-11-23 06:13:35 -0500 (Sun, 23 Nov 2008) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include <cctype> @@ -27,6 +27,7 @@ #include <boost/date_time/date_facet.hpp> #include <boost/date_time/string_convert.hpp> #include <boost/date_time/special_defs.hpp> +#include <boost/date_time/time_resolution_traits.hpp> // absolute_value namespace boost { namespace date_time { @@ -55,129 +56,129 @@ namespace date_time { static const char_type iso_time_format_specifier[18]; static const char_type iso_time_format_extended_specifier[22]; //default ptime format is YYYY-Mon-DD HH:MM:SS[.fff...][ zzz] - static const char_type default_time_format[23]; + static const char_type default_time_format[23]; // default_time_input_format uses a posix_time_zone_string instead of a time zone abbrev - static const char_type default_time_input_format[24]; + static const char_type default_time_input_format[24]; //default time_duration format is HH:MM:SS[.fff...] static const char_type default_time_duration_format[11]; }; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::fractional_seconds_format[3] = {'%','f'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::fractional_seconds_or_none_format[3] = {'%','F'}; - template <class CharT> - const typename time_formats<CharT>::char_type - time_formats<CharT>::seconds_with_fractional_seconds_format[3] = + template <class CharT> + const typename time_formats<CharT>::char_type + time_formats<CharT>::seconds_with_fractional_seconds_format[3] = {'%','s'}; template <class CharT> - const typename time_formats<CharT>::char_type + const typename time_formats<CharT>::char_type time_formats<CharT>::seconds_format[3] = {'%','S'}; template <class CharT> - const typename time_formats<CharT>::char_type + const typename time_formats<CharT>::char_type time_formats<CharT>::hours_format[3] = {'%','H'}; template <class CharT> - const typename time_formats<CharT>::char_type + const typename time_formats<CharT>::char_type time_formats<CharT>::unrestricted_hours_format[3] = {'%','O'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type //time_formats<CharT>::standard_format[5] = {'%','c',' ','%','z'}; time_formats<CharT>::standard_format[9] = {'%','x',' ','%','X',' ','%','z'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::zone_abbrev_format[3] = {'%','z'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::zone_name_format[3] = {'%','Z'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::zone_iso_format[3] = {'%','q'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::zone_iso_extended_format[3] ={'%','Q'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::posix_zone_string_format[4] ={'%','Z','P'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::duration_seperator[2] = {':'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::negative_sign[2] = {'-'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::positive_sign[2] = {'+'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::duration_sign_negative_only[3] ={'%','-'}; - template <class CharT> - const typename time_formats<CharT>::char_type + template <class CharT> + const typename time_formats<CharT>::char_type time_formats<CharT>::duration_sign_always[3] ={'%','+'}; - template <class CharT> - const typename time_formats<CharT>::char_type - time_formats<CharT>::iso_time_format_specifier[18] = - {'%', 'Y', '%', 'm', '%', 'd', 'T', + template <class CharT> + const typename time_formats<CharT>::char_type + time_formats<CharT>::iso_time_format_specifier[18] = + {'%', 'Y', '%', 'm', '%', 'd', 'T', '%', 'H', '%', 'M', '%', 'S', '%', 'F', '%','q' }; - template <class CharT> - const typename time_formats<CharT>::char_type - time_formats<CharT>::iso_time_format_extended_specifier[22] = - {'%', 'Y', '-', '%', 'm', '-', '%', 'd', ' ', + template <class CharT> + const typename time_formats<CharT>::char_type + time_formats<CharT>::iso_time_format_extended_specifier[22] = + {'%', 'Y', '-', '%', 'm', '-', '%', 'd', ' ', '%', 'H', ':', '%', 'M', ':', '%', 'S', '%', 'F','%','Q'}; - template <class CharT> - const typename time_formats<CharT>::char_type - time_formats<CharT>::default_time_format[23] = + template <class CharT> + const typename time_formats<CharT>::char_type + time_formats<CharT>::default_time_format[23] = {'%','Y','-','%','b','-','%','d',' ', '%','H',':','%','M',':','%','S','%','F',' ','%','z'}; - template <class CharT> - const typename time_formats<CharT>::char_type - time_formats<CharT>::default_time_input_format[24] = + template <class CharT> + const typename time_formats<CharT>::char_type + time_formats<CharT>::default_time_input_format[24] = {'%','Y','-','%','b','-','%','d',' ', '%','H',':','%','M',':','%','S','%','F',' ','%','Z','P'}; - template <class CharT> - const typename time_formats<CharT>::char_type - time_formats<CharT>::default_time_duration_format[11] = - {'%','H',':','%','M',':','%','S','%','F'}; + template <class CharT> + const typename time_formats<CharT>::char_type + time_formats<CharT>::default_time_duration_format[11] = + {'%','O',':','%','M',':','%','S','%','F'}; - /*! Facet used for format-based output of time types + /*! Facet used for format-based output of time types * This class provides for the use of format strings to output times. In addition * to the flags for formatting date elements, the following are the allowed format flags: * - %x %X => default format - enables addition of more flags to default (ie. "%x %X %z") * - %f => fractional seconds ".123456" * - %F => fractional seconds or none: like frac sec but empty if frac sec == 0 - * - %s => seconds w/ fractional sec "02.123" (this is the same as "%S%f) + * - %s => seconds w/ fractional sec "02.123" (this is the same as "%S%f) * - %S => seconds "02" * - %z => abbreviated time zone "EDT" * - %Z => full time zone name "Eastern Daylight Time" */ template <class time_type, - class CharT, + class CharT, class OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > - class time_facet : + class time_facet : public boost::date_time::date_facet<typename time_type::date_type , CharT, OutItrT> { public: typedef typename time_type::date_type date_type; @@ -210,7 +211,7 @@ namespace date_time { static const char_type* iso_time_format_extended_specifier; //default ptime format is YYYY-Mon-DD HH:MM:SS[.fff...][ zzz] - static const char_type* default_time_format; + static const char_type* default_time_format; //default time_duration format is HH:MM:SS[.fff...] static const char_type* default_time_duration_format; static std::locale::id id; @@ -227,20 +228,20 @@ namespace date_time { //! Construct the facet with an explicitly specified format explicit time_facet(const char_type* a_format, - period_formatter_type period_formatter = period_formatter_type(), - const special_values_formatter_type& special_value_formatter = special_values_formatter_type(), + period_formatter_type period_formatter = period_formatter_type(), + const special_values_formatter_type& special_value_formatter = special_values_formatter_type(), date_gen_formatter_type dg_formatter = date_gen_formatter_type(), - ::size_t a_ref = 0) - : base_type(a_format, + ::size_t a_ref = 0) + : base_type(a_format, period_formatter, - special_value_formatter, - dg_formatter, + special_value_formatter, + dg_formatter, a_ref), m_time_duration_format(string_type(duration_sign_negative_only) + default_time_duration_format) {} //! Changes format for time_duration - void time_duration_format(const char_type* const format) + void time_duration_format(const char_type* const format) { m_time_duration_format = format; } @@ -254,33 +255,33 @@ namespace date_time { this->m_format = iso_time_format_extended_specifier; } - OutItrT put(OutItrT a_next, - std::ios_base& a_ios, - char_type a_fill, - const time_type& a_time) const + OutItrT put(OutItrT a_next, + std::ios_base& a_ios, + char_type a_fill, + const time_type& a_time) const { - if (a_time.is_special()) { - return this->do_put_special(a_next, a_ios, a_fill, + if (a_time.is_special()) { + return this->do_put_special(a_next, a_ios, a_fill, a_time.date().as_special()); } string_type format(this->m_format); string_type frac_str; if (format.find(seconds_with_fractional_seconds_format) != string_type::npos) { - // replace %s with %S.nnn - frac_str = + // replace %s with %S.nnn + frac_str = fractional_seconds_as_string(a_time.time_of_day(), false); char_type sep = std::use_facet<std::numpunct<char_type> >(a_ios.getloc()).decimal_point(); - + string_type replace_string(seconds_format); replace_string += sep; replace_string += frac_str; - boost::algorithm::replace_all(format, - seconds_with_fractional_seconds_format, + boost::algorithm::replace_all(format, + seconds_with_fractional_seconds_format, replace_string); } /* NOTE: replacing posix_zone_string_format must be done BEFORE - * zone_name_format: "%ZP" & "%Z", if Z is checked first it will + * zone_name_format: "%ZP" & "%Z", if Z is checked first it will * incorrectly replace a zone_name where a posix_string should go */ if (format.find(posix_zone_string_format) != string_type::npos) { if(a_time.zone_abbrev().empty()) { @@ -296,8 +297,8 @@ namespace date_time { } if (format.find(zone_name_format) != string_type::npos) { if(a_time.zone_name().empty()) { - /* TODO: this'll probably create problems if a user places - * the zone_*_format flag in the format with a ptime. This + /* TODO: this'll probably create problems if a user places + * the zone_*_format flag in the format with a ptime. This * code removes the flag from the default formats */ // if zone_name() returns an empty string, we want to @@ -314,8 +315,8 @@ namespace date_time { } if (format.find(zone_abbrev_format) != string_type::npos) { if(a_time.zone_abbrev(false).empty()) { - /* TODO: this'll probably create problems if a user places - * the zone_*_format flag in the format with a ptime. This + /* TODO: this'll probably create problems if a user places + * the zone_*_format flag in the format with a ptime. This * code removes the flag from the default formats */ // if zone_abbrev() returns an empty string, we want to @@ -332,8 +333,8 @@ namespace date_time { } if (format.find(zone_iso_extended_format) != string_type::npos) { if(a_time.zone_name(true).empty()) { - /* TODO: this'll probably create problems if a user places - * the zone_*_format flag in the format with a ptime. This + /* TODO: this'll probably create problems if a user places + * the zone_*_format flag in the format with a ptime. This * code removes the flag from the default formats */ // if zone_name() returns an empty string, we want to @@ -349,8 +350,8 @@ namespace date_time { if (format.find(zone_iso_format) != string_type::npos) { if(a_time.zone_abbrev(true).empty()) { - /* TODO: this'll probably create problems if a user places - * the zone_*_format flag in the format with a ptime. This + /* TODO: this'll probably create problems if a user places + * the zone_*_format flag in the format with a ptime. This * code removes the flag from the default formats */ // if zone_abbrev() returns an empty string, we want to @@ -369,13 +370,13 @@ namespace date_time { frac_str = fractional_seconds_as_string(a_time.time_of_day(), false); } boost::algorithm::replace_all(format, - fractional_seconds_format, + fractional_seconds_format, frac_str); } if (format.find(fractional_seconds_or_none_format) != string_type::npos) { // replace %F with nnnnnnn or nothing if fs == 0 - frac_str = + frac_str = fractional_seconds_as_string(a_time.time_of_day(), true); if (frac_str.size()) { char_type sep = std::use_facet<std::numpunct<char_type> >(a_ios.getloc()).decimal_point(); @@ -383,7 +384,7 @@ namespace date_time { replace_string += sep; replace_string += frac_str; boost::algorithm::replace_all(format, - fractional_seconds_or_none_format, + fractional_seconds_or_none_format, replace_string); } else { @@ -392,46 +393,46 @@ namespace date_time { } } - return this->do_put_tm(a_next, a_ios, a_fill, + return this->do_put_tm(a_next, a_ios, a_fill, to_tm(a_time), format); } //! put function for time_duration - OutItrT put(OutItrT a_next, - std::ios_base& a_ios, - char_type a_fill, - const time_duration_type& a_time_dur) const + OutItrT put(OutItrT a_next, + std::ios_base& a_ios, + char_type a_fill, + const time_duration_type& a_time_dur) const { - if (a_time_dur.is_special()) { - return this->do_put_special(a_next, a_ios, a_fill, + if (a_time_dur.is_special()) { + return this->do_put_special(a_next, a_ios, a_fill, a_time_dur.get_rep().as_special()); } string_type format(m_time_duration_format); if (a_time_dur.is_negative()) { // replace %- with minus sign. Should we use the numpunct facet? - boost::algorithm::replace_all(format, - duration_sign_negative_only, + boost::algorithm::replace_all(format, + duration_sign_negative_only, negative_sign); // remove all the %+ in the string with '-' - boost::algorithm::replace_all(format, - duration_sign_always, + boost::algorithm::replace_all(format, + duration_sign_always, negative_sign); } else { //duration is positive // remove all the %- combos from the string boost::algorithm::erase_all(format, duration_sign_negative_only); // remove all the %+ in the string with '+' - boost::algorithm::replace_all(format, - duration_sign_always, + boost::algorithm::replace_all(format, + duration_sign_always, positive_sign); } /* - * It is possible for a time duration to span more then 24 hours. - * Standard time_put::put is obliged to behave the same as strftime - * (See ISO 14882-2003 22.2.5.3.1 par. 1) and strftime's behavior is - * unspecified for the case when tm_hour field is outside 0-23 range + * It is possible for a time duration to span more then 24 hours. + * Standard time_put::put is obliged to behave the same as strftime + * (See ISO 14882-2003 22.2.5.3.1 par. 1) and strftime's behavior is + * unspecified for the case when tm_hour field is outside 0-23 range * (See ISO 9899-1999 7.23.3.5 par. 3). So we must output %H and %O * here ourself. */ @@ -452,16 +453,16 @@ namespace date_time { string_type frac_str; if (format.find(seconds_with_fractional_seconds_format) != string_type::npos) { - // replace %s with %S.nnn - frac_str = + // replace %s with %S.nnn + frac_str = fractional_seconds_as_string(a_time_dur, false); char_type sep = std::use_facet<std::numpunct<char_type> >(a_ios.getloc()).decimal_point(); - + string_type replace_string(seconds_format); replace_string += sep; replace_string += frac_str; - boost::algorithm::replace_all(format, - seconds_with_fractional_seconds_format, + boost::algorithm::replace_all(format, + seconds_with_fractional_seconds_format, replace_string); } if (format.find(fractional_seconds_format) != string_type::npos) { @@ -470,13 +471,13 @@ namespace date_time { frac_str = fractional_seconds_as_string(a_time_dur, false); } boost::algorithm::replace_all(format, - fractional_seconds_format, + fractional_seconds_format, frac_str); } if (format.find(fractional_seconds_or_none_format) != string_type::npos) { // replace %F with nnnnnnn or nothing if fs == 0 - frac_str = + frac_str = fractional_seconds_as_string(a_time_dur, true); if (frac_str.size()) { char_type sep = std::use_facet<std::numpunct<char_type> >(a_ios.getloc()).decimal_point(); @@ -484,7 +485,7 @@ namespace date_time { replace_string += sep; replace_string += frac_str; boost::algorithm::replace_all(format, - fractional_seconds_or_none_format, + fractional_seconds_or_none_format, replace_string); } else { @@ -493,12 +494,12 @@ namespace date_time { } } - return this->do_put_tm(a_next, a_ios, a_fill, + return this->do_put_tm(a_next, a_ios, a_fill, to_tm(a_time_dur), format); } - - OutItrT put(OutItrT next, std::ios_base& a_ios, - char_type fill, const period_type& p) const + + OutItrT put(OutItrT next, std::ios_base& a_ios, + char_type fill, const period_type& p) const { return this->m_period_formatter.put_period(next, a_ios, fill,p,*this); } @@ -506,12 +507,12 @@ namespace date_time { protected: - static - string_type + static + string_type fractional_seconds_as_string(const time_duration_type& a_time, - bool null_when_zero) + bool null_when_zero) { - typename time_duration_type::fractional_seconds_type frac_sec = + typename time_duration_type::fractional_seconds_type frac_sec = a_time.fractional_seconds(); if (null_when_zero && (frac_sec == 0)) { @@ -538,7 +539,7 @@ namespace date_time { { std::basic_ostringstream<char_type> ss; ss.imbue(std::locale::classic()); // don't want any formatting - ss << std::setw(width) + ss << std::setw(width) << std::setfill(static_cast<char_type>('0')); #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) // JDG [7/6/02 VC++ compatibility] @@ -555,105 +556,105 @@ namespace date_time { }; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> std::locale::id time_facet<time_type, CharT, OutItrT>::id; - template <class time_type, class CharT, class OutItrT> - const typename time_facet<time_type, CharT, OutItrT>::char_type* + template <class time_type, class CharT, class OutItrT> + const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::fractional_seconds_format = time_formats<CharT>::fractional_seconds_format; - template <class time_type, class CharT, class OutItrT> - const typename time_facet<time_type, CharT, OutItrT>::char_type* + template <class time_type, class CharT, class OutItrT> + const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::fractional_seconds_or_none_format = time_formats<CharT>::fractional_seconds_or_none_format; - template <class time_type, class CharT, class OutItrT> - const typename time_facet<time_type, CharT, OutItrT>::char_type* - time_facet<time_type, CharT, OutItrT>::seconds_with_fractional_seconds_format = + template <class time_type, class CharT, class OutItrT> + const typename time_facet<time_type, CharT, OutItrT>::char_type* + time_facet<time_type, CharT, OutItrT>::seconds_with_fractional_seconds_format = time_formats<CharT>::seconds_with_fractional_seconds_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::zone_name_format = time_formats<CharT>::zone_name_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::zone_abbrev_format = time_formats<CharT>::zone_abbrev_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::zone_iso_extended_format =time_formats<CharT>::zone_iso_extended_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::posix_zone_string_format =time_formats<CharT>::posix_zone_string_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::zone_iso_format = time_formats<CharT>::zone_iso_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::seconds_format = time_formats<CharT>::seconds_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::hours_format = time_formats<CharT>::hours_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::unrestricted_hours_format = time_formats<CharT>::unrestricted_hours_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::standard_format = time_formats<CharT>::standard_format; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::duration_seperator = time_formats<CharT>::duration_seperator; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::negative_sign = time_formats<CharT>::negative_sign; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::positive_sign = time_formats<CharT>::positive_sign; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::duration_sign_negative_only = time_formats<CharT>::duration_sign_negative_only; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::duration_sign_always = time_formats<CharT>::duration_sign_always; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type,CharT, OutItrT>::char_type* time_facet<time_type,CharT, OutItrT>::iso_time_format_specifier = time_formats<CharT>::iso_time_format_specifier; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* time_facet<time_type, CharT, OutItrT>::iso_time_format_extended_specifier = time_formats<CharT>::iso_time_format_extended_specifier; - template <class time_type, class CharT, class OutItrT> + template <class time_type, class CharT, class OutItrT> const typename time_facet<time_type, CharT, OutItrT>::char_type* - time_facet<time_type, CharT, OutItrT>::default_time_format = + time_facet<time_type, CharT, OutItrT>::default_time_format = time_formats<CharT>::default_time_format; - template <class time_type, class CharT, class OutItrT> - const typename time_facet<time_type, CharT, OutItrT>::char_type* - time_facet<time_type, CharT, OutItrT>::default_time_duration_format = + template <class time_type, class CharT, class OutItrT> + const typename time_facet<time_type, CharT, OutItrT>::char_type* + time_facet<time_type, CharT, OutItrT>::default_time_duration_format = time_formats<CharT>::default_time_duration_format; - //! Facet for format-based input. + //! Facet for format-based input. /*! */ template <class time_type, - class CharT, + class CharT, class InItrT = std::istreambuf_iterator<CharT, std::char_traits<CharT> > > - class time_input_facet : + class time_input_facet : public boost::date_time::date_input_facet<typename time_type::date_type , CharT, InItrT> { public: typedef typename time_type::date_type date_type; @@ -686,13 +687,13 @@ namespace date_time { static const char_type* duration_seperator; static const char_type* iso_time_format_specifier; static const char_type* iso_time_format_extended_specifier; - static const char_type* default_time_input_format; + static const char_type* default_time_input_format; static const char_type* default_time_duration_format; static std::locale::id id; //! Constructor that takes a format string for a ptime - explicit time_input_facet(const string_type& format, ::size_t a_ref = 0) - : base_type(format, a_ref), + explicit time_input_facet(const string_type& format, ::size_t a_ref = 0) + : base_type(format, a_ref), m_time_duration_format(default_time_duration_format) { } @@ -707,16 +708,16 @@ namespace date_time { sv_parser, per_parser, date_gen_parser, - a_ref), + a_ref), m_time_duration_format(default_time_duration_format) {} //! sets default formats for ptime, local_date_time, and time_duration - explicit time_input_facet(::size_t a_ref = 0) - : base_type(default_time_input_format, a_ref), + explicit time_input_facet(::size_t a_ref = 0) + : base_type(default_time_input_format, a_ref), m_time_duration_format(default_time_duration_format) { } - + //! Set the format for time_duration void time_duration_format(const char_type* const format) { m_time_duration_format = format; @@ -729,47 +730,47 @@ namespace date_time { { this->m_format = iso_time_format_extended_specifier; } - + InItrT get(InItrT& sitr, InItrT& stream_end, std::ios_base& a_ios, period_type& p) const { - p = this->m_period_parser.get_period(sitr, - stream_end, - a_ios, - p, - time_duration_type::unit(), + p = this->m_period_parser.get_period(sitr, + stream_end, + a_ios, + p, + time_duration_type::unit(), *this); return sitr; } - + //default ptime format is YYYY-Mon-DD HH:MM:SS[.fff...][ zzz] //default time_duration format is %H:%M:%S%F HH:MM:SS[.fff...] - InItrT get(InItrT& sitr, - InItrT& stream_end, - std::ios_base& a_ios, + InItrT get(InItrT& sitr, + InItrT& stream_end, + std::ios_base& a_ios, time_duration_type& td) const { // skip leading whitespace while((sitr != stream_end) && std::isspace(*sitr)) { ++sitr; } - + bool use_current_char = false; - + // num_get will consume the +/-, we may need a copy if special_value char_type c = '\0'; if((sitr != stream_end) && (*sitr == '-' || *sitr == '+')) { c = *sitr; } - + typedef typename time_duration_type::hour_type hour_type; typedef typename time_duration_type::min_type min_type; typedef typename time_duration_type::sec_type sec_type; - hour_type hour = 0; - min_type min = 0; - sec_type sec = 0; + hour_type hour = 0; + min_type min = 0; + sec_type sec = 0; typename time_duration_type::fractional_seconds_type frac(0); typedef std::num_get<CharT, InItrT> num_get; @@ -778,25 +779,25 @@ namespace date_time { std::locale loc = std::locale(a_ios.getloc(), ng); a_ios.imbue(loc); } - + const_itr itr(m_time_duration_format.begin()); while (itr != m_time_duration_format.end() && (sitr != stream_end)) { if (*itr == '%') { ++itr; if (*itr != '%') { switch(*itr) { - case 'O': + case 'O': { // A period may span more than 24 hours. In that case the format // string should be composed with the unrestricted hours specifier. - hour = var_string_to_int<hour_type, CharT>(sitr, stream_end, + hour = var_string_to_int<hour_type, CharT>(sitr, stream_end, std::numeric_limits<hour_type>::digits10 + 1); if(hour == -1){ return check_special_value(sitr, stream_end, td, c); } break; } - case 'H': + case 'H': { match_results mr; hour = fixed_string_to_int<hour_type, CharT>(sitr, stream_end, mr, 2); @@ -805,7 +806,7 @@ namespace date_time { } break; } - case 'M': + case 'M': { match_results mr; min = fixed_string_to_int<min_type, CharT>(sitr, stream_end, mr, 2); @@ -815,7 +816,7 @@ namespace date_time { break; } case 's': - case 'S': + case 'S': { match_results mr; sec = fixed_string_to_int<sec_type, CharT>(sitr, stream_end, mr, 2); @@ -832,7 +833,7 @@ namespace date_time { if(*sitr == '.') { ++sitr; parse_frac_type(sitr, stream_end, frac); - // sitr will point to next expected char after this parsing + // sitr will point to next expected char after this parsing // is complete so no need to advance it use_current_char = true; } @@ -841,13 +842,13 @@ namespace date_time { } break; } - case 'F': + case 'F': { // check for decimal, skip if missing if(*sitr == '.') { ++sitr; parse_frac_type(sitr, stream_end, frac); - // sitr will point to next expected char after this parsing + // sitr will point to next expected char after this parsing // is complete so no need to advance it use_current_char = true; } @@ -864,12 +865,12 @@ namespace date_time { else { // itr == '%', second consecutive ++sitr; } - + ++itr; //advance past format specifier } else { //skip past chars in format and in buffer ++itr; - // set use_current_char when sitr is already + // set use_current_char when sitr is already // pointing at the next character to process if (use_current_char) { use_current_char = false; @@ -883,21 +884,21 @@ namespace date_time { td = time_duration_type(hour, min, sec, frac); return sitr; } - + //! Parses a time object from the input stream - InItrT get(InItrT& sitr, - InItrT& stream_end, - std::ios_base& a_ios, + InItrT get(InItrT& sitr, + InItrT& stream_end, + std::ios_base& a_ios, time_type& t) const { string_type tz_str; return get(sitr, stream_end, a_ios, t, tz_str, false); } //! Expects a time_zone in the input stream - InItrT get_local_time(InItrT& sitr, - InItrT& stream_end, - std::ios_base& a_ios, + InItrT get_local_time(InItrT& sitr, + InItrT& stream_end, + std::ios_base& a_ios, time_type& t, string_type& tz_str) const { @@ -906,19 +907,19 @@ namespace date_time { protected: - InItrT get(InItrT& sitr, - InItrT& stream_end, - std::ios_base& a_ios, + InItrT get(InItrT& sitr, + InItrT& stream_end, + std::ios_base& a_ios, time_type& t, string_type& tz_str, bool time_is_local) const { // skip leading whitespace while((sitr != stream_end) && std::isspace(*sitr)) { ++sitr; } - + bool use_current_char = false; bool use_current_format_char = false; // used whith two character flags - + // num_get will consume the +/-, we may need a copy if special_value char_type c = '\0'; if((sitr != stream_end) && (*sitr == '-' || *sitr == '+')) { @@ -930,27 +931,27 @@ namespace date_time { typedef typename time_duration_type::sec_type sec_type; // time elements - hour_type hour = 0; - min_type min = 0; - sec_type sec = 0; + hour_type hour = 0; + min_type min = 0; + sec_type sec = 0; typename time_duration_type::fractional_seconds_type frac(0); // date elements short day_of_year(0); - /* Initialized the following to their minimum values. These intermediate - * objects are used so we get specific exceptions when part of the input - * is unparsable. + /* Initialized the following to their minimum values. These intermediate + * objects are used so we get specific exceptions when part of the input + * is unparsable. * Ex: "205-Jan-15" will throw a bad_year, "2005-Jsn-15"- bad_month, etc.*/ year_type t_year(1400); month_type t_month(1); day_type t_day(1); - + typedef std::num_get<CharT, InItrT> num_get; if(!std::has_facet<num_get>(a_ios.getloc())) { num_get* ng = new num_get(); std::locale loc = std::locale(a_ios.getloc(), ng); a_ios.imbue(loc); } - + const_itr itr(this->m_format.begin()); while (itr != this->m_format.end() && (sitr != stream_end)) { if (*itr == '%') { @@ -1065,7 +1066,7 @@ namespace date_time { break; } // time flags - case 'H': + case 'H': { match_results mr; hour = fixed_string_to_int<hour_type, CharT>(sitr, stream_end, mr, 2); @@ -1074,7 +1075,7 @@ namespace date_time { } break; } - case 'M': + case 'M': { match_results mr; min = fixed_string_to_int<min_type, CharT>(sitr, stream_end, mr, 2); @@ -1084,7 +1085,7 @@ namespace date_time { break; } case 's': - case 'S': + case 'S': { match_results mr; sec = fixed_string_to_int<sec_type, CharT>(sitr, stream_end, mr, 2); @@ -1101,7 +1102,7 @@ namespace date_time { if(*sitr == '.') { ++sitr; parse_frac_type(sitr, stream_end, frac); - // sitr will point to next expected char after this parsing + // sitr will point to next expected char after this parsing // is complete so no need to advance it use_current_char = true; } @@ -1110,13 +1111,13 @@ namespace date_time { } break; } - case 'F': + case 'F': { // check for decimal, skip if missing if(*sitr == '.') { ++sitr; parse_frac_type(sitr, stream_end, frac); - // sitr will point to next expected char after this parsing + // sitr will point to next expected char after this parsing // is complete so no need to advance it use_current_char = true; } @@ -1146,34 +1147,34 @@ namespace date_time { else { use_current_format_char = true; } - + } else { // nothing was parsed so we don't want to advance sitr use_current_char = true; } - + break; } default: {} // ignore what we don't understand? }// switch - } + } else { // itr == '%', second consecutive ++sitr; } - + if(use_current_format_char) { use_current_format_char = false; } else { ++itr; //advance past format specifier } - + } else { //skip past chars in format and in buffer ++itr; - // set use_current_char when sitr is already + // set use_current_char when sitr is already // pointing at the next character to process if (use_current_char) { use_current_char = false; @@ -1183,7 +1184,7 @@ namespace date_time { } } } - + date_type d(not_a_date_time); if (day_of_year > 0) { d = date_type(static_cast<unsigned short>(t_year-1),12,31) + date_duration_type(day_of_year); @@ -1198,8 +1199,8 @@ namespace date_time { } //! Helper function to check for special_value - /*! First character may have been consumed during original parse - * attempt. Parameter 'c' should be a copy of that character. + /*! First character may have been consumed during original parse + * attempt. Parameter 'c' should be a copy of that character. * Throws ios_base::failure if parse fails. */ template<class temporal_type> inline @@ -1215,13 +1216,13 @@ namespace date_time { boost::throw_exception(std::ios_base::failure("Parse failed. No match found for '" + tmp + "'")); BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return sitr); // should never reach } - tt = temporal_type(static_cast<special_values>(mr.current_match)); + tt = temporal_type(static_cast<special_values>(mr.current_match)); return sitr; } //! Helper function for parsing a fractional second type from the stream - void parse_frac_type(InItrT& sitr, - InItrT& stream_end, + void parse_frac_type(InItrT& sitr, + InItrT& stream_end, fracional_seconds_type& frac) const { string_type cache; @@ -1242,7 +1243,7 @@ namespace date_time { } } } - + private: string_type m_time_duration_format; @@ -1263,60 +1264,60 @@ namespace date_time { template <class time_type, class CharT, class InItrT> std::locale::id time_input_facet<time_type, CharT, InItrT>::id; -template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* +template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::fractional_seconds_format = time_formats<CharT>::fractional_seconds_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::fractional_seconds_or_none_format = time_formats<CharT>::fractional_seconds_or_none_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::seconds_with_fractional_seconds_format = time_formats<CharT>::seconds_with_fractional_seconds_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::seconds_format = time_formats<CharT>::seconds_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::standard_format = time_formats<CharT>::standard_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::zone_abbrev_format = time_formats<CharT>::zone_abbrev_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::zone_name_format = time_formats<CharT>::zone_name_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::zone_iso_format = time_formats<CharT>::zone_iso_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::zone_iso_extended_format = time_formats<CharT>::zone_iso_extended_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::duration_seperator = time_formats<CharT>::duration_seperator; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::iso_time_format_specifier = time_formats<CharT>::iso_time_format_specifier; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::iso_time_format_extended_specifier = time_formats<CharT>::iso_time_format_extended_specifier; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::default_time_input_format = time_formats<CharT>::default_time_input_format; - template <class time_type, class CharT, class InItrT> - const typename time_input_facet<time_type, CharT, InItrT>::char_type* + template <class time_type, class CharT, class InItrT> + const typename time_input_facet<time_type, CharT, InItrT>::char_type* time_input_facet<time_type, CharT, InItrT>::default_time_duration_format = time_formats<CharT>::default_time_duration_format; diff --git a/3rdParty/Boost/src/boost/date_time/time_resolution_traits.hpp b/3rdParty/Boost/src/boost/date_time/time_resolution_traits.hpp index 1487911..658f3d2 100644 --- a/3rdParty/Boost/src/boost/date_time/time_resolution_traits.hpp +++ b/3rdParty/Boost/src/boost/date_time/time_resolution_traits.hpp @@ -2,26 +2,27 @@ #define DATE_TIME_TIME_RESOLUTION_TRAITS_HPP /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ + * $Date: 2009-06-06 07:25:55 -0400 (Sat, 06 Jun 2009) $ */ -#include "boost/date_time/time_defs.hpp" -#include "boost/date_time/int_adapter.hpp" -#include "boost/cstdint.hpp" +#include <boost/cstdint.hpp> +#include <boost/date_time/time_defs.hpp> +#include <boost/date_time/int_adapter.hpp> +#include <boost/date_time/compiler_config.hpp> namespace boost { namespace date_time { //! Simple function to calculate absolute value of a numeric type - template <typename T> - // JDG [7/6/02 made a template], + template <typename T> + // JDG [7/6/02 made a template], // moved here from time_duration.hpp 2003-Sept-4. - inline T absolute_value(T x) + inline T absolute_value(T x) { return x < 0 ? -x : x; } @@ -58,16 +59,16 @@ namespace date_time { //! Used to determine if implemented type is int_adapter or int static bool is_adapted() { return true;} }; - - template<typename frac_sec_type, + + template<typename frac_sec_type, time_resolutions res, #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) - boost::int64_t resolution_adjust, + boost::int64_t resolution_adjust, #else - typename frac_sec_type::int_type resolution_adjust, + typename frac_sec_type::int_type resolution_adjust, #endif - unsigned short frac_digits, - typename v_type = boost::int32_t > + unsigned short frac_digits, + typename v_type = boost::int32_t > class time_resolution_traits { public: typedef typename frac_sec_type::int_type fractional_seconds_type; @@ -77,9 +78,9 @@ namespace date_time { typedef v_type hour_type; typedef v_type min_type; typedef v_type sec_type; - + // bring in function from frac_sec_type traits structs - static typename frac_sec_type::int_type as_number(typename frac_sec_type::impl_type i) + static fractional_seconds_type as_number(impl_type i) { return frac_sec_type::as_number(i); } @@ -87,11 +88,14 @@ namespace date_time { { return frac_sec_type::is_adapted(); } - + //Would like this to be frac_sec_type, but some compilers complain - BOOST_STATIC_CONSTANT(int, ticks_per_second = resolution_adjust); - // static const boost::int32_t ticks_per_second = resolution_adjust; - +#if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) + BOOST_STATIC_CONSTANT(boost::int64_t, ticks_per_second = resolution_adjust); +#else + BOOST_STATIC_CONSTANT(fractional_seconds_type, ticks_per_second = resolution_adjust); +#endif + static time_resolutions resolution() { return res; @@ -116,16 +120,16 @@ namespace date_time { minutes = absolute_value(minutes); seconds = absolute_value(seconds); fs = absolute_value(fs); - return (((((fractional_seconds_type(hours)*3600) - + (fractional_seconds_type(minutes)*60) + return (((((fractional_seconds_type(hours)*3600) + + (fractional_seconds_type(minutes)*60) + seconds)*res_adjust()) + fs) * -1); } - return (((fractional_seconds_type(hours)*3600) - + (fractional_seconds_type(minutes)*60) + return (((fractional_seconds_type(hours)*3600) + + (fractional_seconds_type(minutes)*60) + seconds)*res_adjust()) + fs; } - + }; typedef time_resolution_traits<time_resolution_traits_adapted32_impl, milli, 1000, 3 > milli_res; diff --git a/3rdParty/Boost/src/boost/detail/container_fwd.hpp b/3rdParty/Boost/src/boost/detail/container_fwd.hpp index f54dedb..bc7f780 100644 --- a/3rdParty/Boost/src/boost/detail/container_fwd.hpp +++ b/3rdParty/Boost/src/boost/detail/container_fwd.hpp @@ -13,12 +13,6 @@ #include <boost/config.hpp> #include <boost/detail/workaround.hpp> -#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 T> class allocator; template <class charT, class traits, class Allocator> class basic_string; - template <class charT> struct BOOST_HASH_CHAR_TRAITS; + +#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) + template <class charT> struct string_char_traits; +#else + template <class charT> struct char_traits; +#endif + template <class T> class complex; } diff --git a/3rdParty/Boost/src/boost/detail/endian.hpp b/3rdParty/Boost/src/boost/detail/endian.hpp index 803d7e2..36ddb7e 100644 --- a/3rdParty/Boost/src/boost/detail/endian.hpp +++ b/3rdParty/Boost/src/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 diff --git a/3rdParty/Boost/src/boost/detail/interlocked.hpp b/3rdParty/Boost/src/boost/detail/interlocked.hpp index b6c8d75..fccebc3 100644 --- a/3rdParty/Boost/src/boost/detail/interlocked.hpp +++ b/3rdParty/Boost/src/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 ) diff --git a/3rdParty/Boost/src/boost/detail/no_exceptions_support.hpp b/3rdParty/Boost/src/boost/detail/no_exceptions_support.hpp new file mode 100644 index 0000000..d94e358 --- /dev/null +++ b/3rdParty/Boost/src/boost/detail/no_exceptions_support.hpp @@ -0,0 +1,87 @@ +#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_ +#define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_ + +#if (defined _MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif + +//---------------------------------------------------------------------- +// (C) Copyright 2004 Pavel Vozenilek. +// Use, modification and distribution is 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) +// +// +// This file contains helper macros used when exception support may be +// disabled (as indicated by macro BOOST_NO_EXCEPTIONS). +// +// Before picking up these macros you may consider using RAII techniques +// to deal with exceptions - their syntax can be always the same with +// or without exception support enabled. +// + +/* Example of use: + +void foo() { + BOOST_TRY { + ... + } BOOST_CATCH(const std::bad_alloc&) { + ... + BOOST_RETHROW + } BOOST_CATCH(const std::exception& e) { + ... + } + BOOST_CATCH_END +} + +With exception support enabled it will expand into: + +void foo() { + { try { + ... + } catch (const std::bad_alloc&) { + ... + throw; + } catch (const std::exception& e) { + ... + } + } +} + +With exception support disabled it will expand into: + +void foo() { + { if(true) { + ... + } else if (false) { + ... + } else if (false) { + ... + } + } +} +*/ +//---------------------------------------------------------------------- + +#include <boost/config.hpp> +#include <boost/detail/workaround.hpp> + +#if !(defined BOOST_NO_EXCEPTIONS) +# define BOOST_TRY { try +# define BOOST_CATCH(x) catch(x) +# define BOOST_RETHROW throw; +# define BOOST_CATCH_END } +#else +# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +# define BOOST_TRY { if ("") +# define BOOST_CATCH(x) else if (!"") +# else +# define BOOST_TRY { if (true) +# define BOOST_CATCH(x) else if (false) +# endif +# define BOOST_RETHROW +# define BOOST_CATCH_END } +#endif + + +#endif diff --git a/3rdParty/Boost/src/boost/detail/scoped_enum_emulation.hpp b/3rdParty/Boost/src/boost/detail/scoped_enum_emulation.hpp new file mode 100644 index 0000000..644c138 --- /dev/null +++ b/3rdParty/Boost/src/boost/detail/scoped_enum_emulation.hpp @@ -0,0 +1,56 @@ +// 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. +// +// 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 +// ... +// 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 <boost/config.hpp> + +#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 diff --git a/3rdParty/Boost/src/boost/detail/sp_typeinfo.hpp b/3rdParty/Boost/src/boost/detail/sp_typeinfo.hpp index e78c943..636fe27 100644 --- a/3rdParty/Boost/src/boost/detail/sp_typeinfo.hpp +++ b/3rdParty/Boost/src/boost/detail/sp_typeinfo.hpp @@ -19,20 +19,66 @@ #if defined( BOOST_NO_TYPEID ) +#include <boost/current_function.hpp> +#include <functional> + namespace boost { namespace detail { -typedef void* sp_typeinfo; +class sp_typeinfo +{ +private: + + sp_typeinfo( sp_typeinfo const& ); + sp_typeinfo& operator=( sp_typeinfo const& ); + + char const * name_; + +public: + + explicit sp_typeinfo( char const * name ): name_( name ) + { + } + + bool operator==( sp_typeinfo const& rhs ) const + { + return this == &rhs; + } + + bool operator!=( sp_typeinfo const& rhs ) const + { + return this != &rhs; + } + + bool before( sp_typeinfo const& rhs ) const + { + return std::less< sp_typeinfo const* >()( this, &rhs ); + } + + char const* name() const + { + return name_; + } +}; template<class T> struct sp_typeid_ { - static char v_; + static sp_typeinfo ti_; + + static char const * name() + { + return BOOST_CURRENT_FUNCTION; + } }; -template<class T> char sp_typeid_< T >::v_; +template<class T> sp_typeinfo sp_typeid_< T >::ti_( sp_typeid_< T >::name() ); + +template<class T> struct sp_typeid_< T & >: sp_typeid_< T > +{ +}; template<class T> struct sp_typeid_< T const >: sp_typeid_< T > { @@ -50,7 +96,7 @@ template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T > } // namespace boost -#define BOOST_SP_TYPEID(T) (&boost::detail::sp_typeid_<T>::v_) +#define BOOST_SP_TYPEID(T) (boost::detail::sp_typeid_<T>::ti_) #else diff --git a/3rdParty/Boost/src/boost/detail/utf8_codecvt_facet.hpp b/3rdParty/Boost/src/boost/detail/utf8_codecvt_facet.hpp index ac7e7bf..b777ff9 100644 --- a/3rdParty/Boost/src/boost/detail/utf8_codecvt_facet.hpp +++ b/3rdParty/Boost/src/boost/detail/utf8_codecvt_facet.hpp @@ -79,25 +79,18 @@ // specialized on those types for this to work. #include <locale> -// for mbstate_t -#include <wchar.h> -// for std::size_t -#include <cstddef> +#include <cwchar> // for mbstate_t +#include <cstddef> // for std::size_t #include <boost/config.hpp> #include <boost/detail/workaround.hpp> +#if defined(BOOST_NO_STDC_NAMESPACE) 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 + using ::mbstate_t; + using ::size_t; +} +#endif #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) #define BOOST_CODECVT_DO_LENGTH_CONST const diff --git a/3rdParty/Boost/src/boost/exception/current_exception_cast.hpp b/3rdParty/Boost/src/boost/exception/current_exception_cast.hpp new file mode 100644 index 0000000..af2f153 --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/current_exception_cast.hpp @@ -0,0 +1,43 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_7E83C166200811DE885E826156D89593 +#define UUID_7E83C166200811DE885E826156D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +namespace +boost + { + template <class E> + inline + E * + current_exception_cast() + { + try + { + throw; + } + catch( + E & e ) + { + return &e; + } + catch( + ...) + { + return 0; + } + } + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/detail/attribute_noreturn.hpp b/3rdParty/Boost/src/boost/exception/detail/attribute_noreturn.hpp new file mode 100644 index 0000000..f6a0b59 --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/detail/attribute_noreturn.hpp @@ -0,0 +1,17 @@ +//Copyright (c) 2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_61531AB0680611DEADD5846855D89593 +#define UUID_61531AB0680611DEADD5846855D89593 + +#if defined(_MSC_VER) +#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn) +#elif defined(__GNUC__) +#define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn)) +#else +#define BOOST_ATTRIBUTE_NORETURN +#endif + +#endif diff --git a/3rdParty/Boost/src/boost/exception/detail/error_info_impl.hpp b/3rdParty/Boost/src/boost/exception/detail/error_info_impl.hpp new file mode 100644 index 0000000..32113b1 --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/detail/error_info_impl.hpp @@ -0,0 +1,75 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_CE6983AC753411DDA764247956D89593 +#define UUID_CE6983AC753411DDA764247956D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <string> + +namespace +boost + { + namespace + exception_detail + { + class + error_info_base + { + public: + + virtual char const * tag_typeid_name() const = 0; + virtual std::string value_as_string() const = 0; + + protected: + + ~error_info_base() throw() + { + } + }; + } + + template <class Tag,class T> + class + error_info: + public exception_detail::error_info_base + { + public: + + typedef T value_type; + + error_info( value_type const & value ); + ~error_info() throw(); + + value_type const & + value() const + { + return value_; + } + + value_type & + value() + { + return value_; + } + + private: + + char const * tag_typeid_name() const; + std::string value_as_string() const; + + value_type value_; + }; + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/detail/exception_ptr.hpp b/3rdParty/Boost/src/boost/exception/detail/exception_ptr.hpp new file mode 100644 index 0000000..78db17c --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/detail/exception_ptr.hpp @@ -0,0 +1,490 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_618474C2DE1511DEB74A388C56D89593 +#define UUID_618474C2DE1511DEB74A388C56D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <boost/config.hpp> +#ifdef BOOST_NO_EXCEPTIONS +#error This header requires exception handling to be enabled. +#endif +#include <boost/exception/exception.hpp> +#include <boost/exception/info.hpp> +#include <boost/exception/diagnostic_information.hpp> +#include <boost/exception/detail/type_info.hpp> +#include <boost/shared_ptr.hpp> +#include <stdexcept> +#include <new> +#include <ios> + +namespace +boost + { +#ifndef BOOST_NO_RTTI + typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type; + + inline + std::string + to_string( original_exception_type const & x ) + { + return x.value()->name(); + } +#endif + + class exception_ptr; + exception_ptr current_exception(); + void rethrow_exception( exception_ptr const & ); + + class + exception_ptr + { + typedef bool exception_ptr::*unspecified_bool_type; + friend exception_ptr current_exception(); + friend void rethrow_exception( exception_ptr const & ); + + shared_ptr<exception_detail::clone_base const> c_; + bool bad_alloc_; + + struct + bad_alloc_tag + { + }; + + explicit + exception_ptr( bad_alloc_tag ): + bad_alloc_(true) + { + } + + explicit + exception_ptr( shared_ptr<exception_detail::clone_base const> const & c ): + c_(c), + bad_alloc_(false) + { + BOOST_ASSERT(c); + } + + void + rethrow() const + { + BOOST_ASSERT(*this); + if( bad_alloc_ ) + throw enable_current_exception(std::bad_alloc()); + else + c_->rethrow(); + } + + bool + empty() const + { + return !bad_alloc_ && !c_; + } + + public: + + exception_ptr(): + bad_alloc_(false) + { + } + + ~exception_ptr() throw() + { + } + + operator unspecified_bool_type() const + { + return empty() ? 0 : &exception_ptr::bad_alloc_; + } + + friend + bool + operator==( exception_ptr const & a, exception_ptr const & b ) + { + return a.c_==b.c_ && a.bad_alloc_==b.bad_alloc_; + } + + friend + bool + operator!=( exception_ptr const & a, exception_ptr const & b ) + { + return !(a==b); + } + }; + + class + unknown_exception: + public exception, + public std::exception, + public exception_detail::clone_base + { + public: + + unknown_exception() + { + } + + explicit + unknown_exception( std::exception const & e ) + { + add_original_type(e); + } + + explicit + unknown_exception( boost::exception const & e ): + boost::exception(e) + { + add_original_type(e); + } + + ~unknown_exception() throw() + { + } + + private: + + exception_detail::clone_base const * + clone() const + { + return new unknown_exception(*this); + } + + void + rethrow() const + { + throw*this; + } + + template <class E> + void + add_original_type( E const & e ) + { +#ifndef BOOST_NO_RTTI + (*this) << original_exception_type(&typeid(e)); +#endif + } + }; + + namespace + exception_detail + { + template <class T> + class + current_exception_std_exception_wrapper: + public T, + public boost::exception, + public clone_base + { + public: + + explicit + current_exception_std_exception_wrapper( T const & e1 ): + T(e1) + { + add_original_type(e1); + } + + current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ): + T(e1), + boost::exception(e2) + { + add_original_type(e1); + } + + ~current_exception_std_exception_wrapper() throw() + { + } + + private: + + clone_base const * + clone() const + { + return new current_exception_std_exception_wrapper(*this); + } + + void + rethrow() const + { + throw *this; + } + + template <class E> + void + add_original_type( E const & e ) + { +#ifndef BOOST_NO_RTTI + (*this) << original_exception_type(&typeid(e)); +#endif + } + }; + +#ifdef BOOST_NO_RTTI + template <class T> + exception const * + get_boost_exception( T const * ) + { + try + { + throw; + } + catch( + exception & x ) + { + return &x; + } + catch(...) + { + return 0; + } + } +#else + template <class T> + exception const * + get_boost_exception( T const * x ) + { + return dynamic_cast<exception const *>(x); + } +#endif + + template <class T> + inline + shared_ptr<clone_base const> + current_exception_std_exception( T const & e1 ) + { + if( boost::exception const * e2 = get_boost_exception(&e1) ) + return shared_ptr<current_exception_std_exception_wrapper<T> const>(new current_exception_std_exception_wrapper<T>(e1,*e2)); + else + return shared_ptr<current_exception_std_exception_wrapper<T> const>(new current_exception_std_exception_wrapper<T>(e1)); + } + + inline + shared_ptr<clone_base const> + current_exception_unknown_exception() + { + return shared_ptr<unknown_exception const>(new unknown_exception()); + } + + inline + shared_ptr<clone_base const> + current_exception_unknown_boost_exception( boost::exception const & e ) + { + return shared_ptr<unknown_exception const>(new unknown_exception(e)); + } + + inline + shared_ptr<clone_base const> + current_exception_unknown_std_exception( std::exception const & e ) + { + if( boost::exception const * be = get_boost_exception(&e) ) + return current_exception_unknown_boost_exception(*be); + else + return shared_ptr<unknown_exception const>(new unknown_exception(e)); + } + + inline + shared_ptr<clone_base const> + current_exception_impl() + { + try + { + throw; + } + catch( + exception_detail::clone_base & e ) + { + return shared_ptr<exception_detail::clone_base const>(e.clone()); + } + catch( + std::domain_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::invalid_argument & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::length_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::out_of_range & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::logic_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::range_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::overflow_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::underflow_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::ios_base::failure & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::runtime_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::bad_alloc & e ) + { + return exception_detail::current_exception_std_exception(e); + } +#ifndef BOOST_NO_TYPEID + catch( + std::bad_cast & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::bad_typeid & e ) + { + return exception_detail::current_exception_std_exception(e); + } +#endif + catch( + std::bad_exception & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::exception & e ) + { + return exception_detail::current_exception_unknown_std_exception(e); + } + catch( + boost::exception & e ) + { + return exception_detail::current_exception_unknown_boost_exception(e); + } + catch( + ... ) + { + return exception_detail::current_exception_unknown_exception(); + } + } + } + + inline + exception_ptr + current_exception() + { + try + { + return exception_ptr(exception_detail::current_exception_impl()); + } + catch( + std::bad_alloc & ) + { + } + catch( + ... ) + { + try + { + return exception_ptr(exception_detail::current_exception_std_exception(std::bad_exception())); + } + catch( + std::bad_alloc & ) + { + } + catch( + ... ) + { + BOOST_ASSERT(0); + } + } + return exception_ptr(exception_ptr::bad_alloc_tag()); + } + + template <class T> + inline + exception_ptr + copy_exception( T const & e ) + { + try + { + throw enable_current_exception(e); + } + catch( + ... ) + { + return current_exception(); + } + } + + inline + void + rethrow_exception( exception_ptr const & p ) + { + p.rethrow(); + } + + inline + std::string + diagnostic_information( exception_ptr const & p ) + { + if( p ) + try + { + rethrow_exception(p); + } + catch( + ... ) + { + return current_exception_diagnostic_information(); + } + return "<empty>"; + } + + inline + std::string + to_string( exception_ptr const & p ) + { + std::string s='\n'+diagnostic_information(p); + std::string padding(" "); + std::string r; + bool f=false; + for( std::string::const_iterator i=s.begin(),e=s.end(); i!=e; ++i ) + { + if( f ) + r+=padding; + char c=*i; + r+=c; + f=(c=='\n'); + } + return r; + } + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/detail/is_output_streamable.hpp b/3rdParty/Boost/src/boost/exception/detail/is_output_streamable.hpp new file mode 100644 index 0000000..5eb1695 --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/detail/is_output_streamable.hpp @@ -0,0 +1,47 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_898984B4076411DD973EDFA055D89593 +#define UUID_898984B4076411DD973EDFA055D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <ostream> + +namespace +boost + { + namespace + to_string_detail + { + template <class T,class CharT,class Traits> + char operator<<( std::basic_ostream<CharT,Traits> &, T const & ); + + template <class T,class CharT,class Traits> + struct + is_output_streamable_impl + { + static std::basic_ostream<CharT,Traits> & f(); + static T const & g(); + enum e { value=1!=(sizeof(f()<<g())) }; + }; + } + + template <class T, class CharT=char, class Traits=std::char_traits<CharT> > + struct + is_output_streamable + { + enum e { value=to_string_detail::is_output_streamable_impl<T,CharT,Traits>::value }; + }; + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/detail/object_hex_dump.hpp b/3rdParty/Boost/src/boost/exception/detail/object_hex_dump.hpp new file mode 100644 index 0000000..ccf1bac --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/detail/object_hex_dump.hpp @@ -0,0 +1,50 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593 +#define UUID_6F463AC838DF11DDA3E6909F56D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <boost/exception/detail/type_info.hpp> +#include <iomanip> +#include <ios> +#include <string> +#include <sstream> +#include <cstdlib> + +namespace +boost + { + namespace + exception_detail + { + template <class T> + inline + std::string + object_hex_dump( T const & x, std::size_t max_size=16 ) + { + std::ostringstream s; + s << "type: " << type_name<T>() << ", size: " << sizeof(T) << ", dump: "; + std::size_t n=sizeof(T)>max_size?max_size:sizeof(T); + s.fill('0'); + s.width(2); + unsigned char const * b=reinterpret_cast<unsigned char const *>(&x); + s << std::setw(2) << std::hex << (unsigned int)*b; + for( unsigned char const * e=b+n; ++b!=e; ) + s << " " << std::setw(2) << std::hex << (unsigned int)*b; + return s.str(); + } + } + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/detail/type_info.hpp b/3rdParty/Boost/src/boost/exception/detail/type_info.hpp new file mode 100644 index 0000000..60709a1 --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/detail/type_info.hpp @@ -0,0 +1,79 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_C3E1741C754311DDB2834CCA55D89593 +#define UUID_C3E1741C754311DDB2834CCA55D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <boost/detail/sp_typeinfo.hpp> +#include <boost/current_function.hpp> +#include <boost/config.hpp> + +namespace +boost + { + template <class T> + inline + char const * + tag_type_name() + { +#ifdef BOOST_NO_TYPEID + return BOOST_CURRENT_FUNCTION; +#else + return typeid(T*).name(); +#endif + } + + template <class T> + inline + char const * + type_name() + { +#ifdef BOOST_NO_TYPEID + return BOOST_CURRENT_FUNCTION; +#else + return typeid(T).name(); +#endif + } + + namespace + exception_detail + { + struct + type_info_ + { + detail::sp_typeinfo const & type_; + + explicit + type_info_( detail::sp_typeinfo const & type ): + type_(type) + { + } + + friend + bool + operator<( type_info_ const & a, type_info_ const & b ) + { + return 0!=(a.type_.before(b.type_)); + } + }; + } + } + +#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T)) + +#ifndef BOOST_NO_RTTI +#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x)) +#endif + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/diagnostic_information.hpp b/3rdParty/Boost/src/boost/exception/diagnostic_information.hpp new file mode 100644 index 0000000..632a5a3 --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/diagnostic_information.hpp @@ -0,0 +1,182 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_0552D49838DD11DD90146B8956D89593 +#define UUID_0552D49838DD11DD90146B8956D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <boost/config.hpp> +#include <boost/exception/get_error_info.hpp> +#include <boost/utility/enable_if.hpp> +#include <boost/config.hpp> +#include <exception> +#include <sstream> +#include <string> + +#ifndef BOOST_NO_EXCEPTIONS +#include <boost/exception/current_exception_cast.hpp> +namespace +boost + { + namespace + exception_detail + { + std::string diagnostic_information_impl( boost::exception const *, std::exception const *, bool ); + } + + inline + std::string + current_exception_diagnostic_information() + { + boost::exception const * be=current_exception_cast<boost::exception const>(); + std::exception const * se=current_exception_cast<std::exception const>(); + if( be || se ) + return exception_detail::diagnostic_information_impl(be,se,true); + else + return "No diagnostic information available."; + } + } +#endif + +namespace +boost + { + namespace + exception_detail + { + inline + exception const * + get_boost_exception( exception const * e ) + { + return e; + } + + inline + exception const * + get_boost_exception( ... ) + { + return 0; + } + + inline + std::exception const * + get_std_exception( std::exception const * e ) + { + return e; + } + + inline + std::exception const * + get_std_exception( ... ) + { + return 0; + } + + inline + char const * + get_diagnostic_information( exception const & x, char const * header ) + { + if( error_info_container * c=x.data_.get() ) +#ifndef BOOST_NO_EXCEPTIONS + try + { +#endif + return c->diagnostic_information(header); +#ifndef BOOST_NO_EXCEPTIONS + } + catch(...) + { + } +#endif + return 0; + } + + inline + std::string + diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what ) + { + if( !be && !se ) + return "Unknown exception."; +#ifndef BOOST_NO_RTTI + if( !be ) + be=dynamic_cast<boost::exception const *>(se); + if( !se ) + se=dynamic_cast<std::exception const *>(be); +#endif + char const * wh=0; + if( with_what && se ) + { + wh=se->what(); + if( be && exception_detail::get_diagnostic_information(*be,0)==wh ) + return wh; + } + std::ostringstream tmp; + if( be ) + { + if( char const * const * f=get_error_info<throw_file>(*be) ) + { + tmp << *f; + if( int const * l=get_error_info<throw_line>(*be) ) + tmp << '(' << *l << "): "; + } + tmp << "Throw in function "; + if( char const * const * fn=get_error_info<throw_function>(*be) ) + tmp << *fn; + else + tmp << "(unknown)"; + tmp << '\n'; + } +#ifndef BOOST_NO_RTTI + tmp << std::string("Dynamic exception type: ") << + (be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).type_.name() << '\n'; +#endif + if( with_what && se ) + tmp << "std::exception::what: " << wh << '\n'; + if( be ) + if( char const * s=exception_detail::get_diagnostic_information(*be,tmp.str().c_str()) ) + if( *s ) + return s; + return tmp.str(); + } + } + + template <class T> + std::string + diagnostic_information( T const & e ) + { + return exception_detail::diagnostic_information_impl(exception_detail::get_boost_exception(&e),exception_detail::get_std_exception(&e),true); + } + + inline + char const * + diagnostic_information_what( exception const & e ) throw() + { + char const * w=0; +#ifndef BOOST_NO_EXCEPTIONS + try + { +#endif + (void) exception_detail::diagnostic_information_impl(&e,0,false); + return exception_detail::get_diagnostic_information(e,0); +#ifndef BOOST_NO_EXCEPTIONS + } + catch( + ... ) + { + } +#endif + return w; + } + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/exception.hpp b/3rdParty/Boost/src/boost/exception/exception.hpp index 6df93ac..79b2739 100644 --- a/3rdParty/Boost/src/boost/exception/exception.hpp +++ b/3rdParty/Boost/src/boost/exception/exception.hpp @@ -5,6 +5,12 @@ #ifndef UUID_274DA366004E11DCB1DDFE2E56D89593 #define UUID_274DA366004E11DCB1DDFE2E56D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif namespace boost @@ -80,13 +86,13 @@ boost template <class Tag,class T> class error_info; - typedef error_info<struct tag_throw_function,char const *> throw_function; - typedef error_info<struct tag_throw_file,char const *> throw_file; - typedef error_info<struct tag_throw_line,int> throw_line; + typedef error_info<struct throw_function_,char const *> throw_function; + typedef error_info<struct throw_file_,char const *> throw_file; + typedef error_info<struct throw_line_,int> throw_line; template <> class - error_info<tag_throw_function,char const *> + error_info<throw_function_,char const *> { public: typedef char const * value_type; @@ -100,7 +106,7 @@ boost template <> class - error_info<tag_throw_file,char const *> + error_info<throw_file_,char const *> { public: typedef char const * value_type; @@ -114,7 +120,7 @@ boost template <> class - error_info<tag_throw_line,int> + error_info<throw_line_,int> { public: typedef int value_type; @@ -129,6 +135,15 @@ boost template <class E,class Tag,class T> E const & operator<<( E const &, error_info<Tag,T> const & ); + template <class E> + E const & operator<<( E const &, throw_function const & ); + + template <class E> + E const & operator<<( E const &, throw_file const & ); + + template <class E> + E const & operator<<( E const &, throw_line const & ); + class exception; template <class> @@ -143,15 +158,14 @@ boost struct error_info_container { - virtual char const * diagnostic_information() const = 0; - virtual shared_ptr<error_info_base const> get( type_info_ const & ) const = 0; - virtual void set( shared_ptr<error_info_base const> const &, type_info_ const & ) = 0; + virtual char const * diagnostic_information( char const * ) const = 0; + virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0; + virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0; virtual void add_ref() const = 0; virtual void release() const = 0; protected: - virtual ~error_info_container() throw() { } @@ -169,7 +183,7 @@ boost template <> struct get_info<throw_line>; - char const * get_diagnostic_information( exception const & ); + char const * get_diagnostic_information( exception const &, char const * ); } class @@ -202,36 +216,21 @@ boost #endif ; +#if defined(__MWERKS__) && __MWERKS__<=0x3207 + public: +#else private: template <class E> - friend - E const & - operator<<( E const & x, throw_function const & y ) - { - x.throw_function_=y.v_; - return x; - } + friend E const & operator<<( E const &, throw_function const & ); template <class E> - friend - E const & - operator<<( E const & x, throw_file const & y ) - { - x.throw_file_=y.v_; - return x; - } + friend E const & operator<<( E const &, throw_file const & ); template <class E> - friend - E const & - operator<<( E const & x, throw_line const & y ) - { - x.throw_line_=y.v_; - return x; - } + friend E const & operator<<( E const &, throw_line const & ); - friend char const * exception_detail::get_diagnostic_information( exception const & ); + friend char const * exception_detail::get_diagnostic_information( exception const &, char const * ); template <class E,class Tag,class T> friend E const & operator<<( E const &, error_info<Tag,T> const & ); @@ -241,7 +240,7 @@ boost friend struct exception_detail::get_info<throw_function>; friend struct exception_detail::get_info<throw_file>; friend struct exception_detail::get_info<throw_line>; - +#endif mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_; mutable char const * throw_function_; mutable char const * throw_file_; @@ -254,6 +253,30 @@ boost { } + template <class E> + E const & + operator<<( E const & x, throw_function const & y ) + { + x.throw_function_=y.v_; + return x; + } + + template <class E> + E const & + operator<<( E const & x, throw_file const & y ) + { + x.throw_file_=y.v_; + return x; + } + + template <class E> + E const & + operator<<( E const & x, throw_line const & y ) + { + x.throw_line_=y.v_; + return x; + } + //////////////////////////////////////////////////////////////////////// namespace @@ -303,7 +326,7 @@ boost struct enable_error_info_return_type { - typedef typename enable_error_info_helper<T,sizeof(dispatch((T*)0))>::type type; + typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch((T*)0))>::type type; }; } @@ -393,4 +416,7 @@ boost } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/3rdParty/Boost/src/boost/exception/get_error_info.hpp b/3rdParty/Boost/src/boost/exception/get_error_info.hpp new file mode 100644 index 0000000..046f05a --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/get_error_info.hpp @@ -0,0 +1,130 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_1A590226753311DD9E4CCF6156D89593 +#define UUID_1A590226753311DD9E4CCF6156D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <boost/exception/exception.hpp> +#include <boost/exception/detail/error_info_impl.hpp> +#include <boost/exception/detail/type_info.hpp> +#include <boost/shared_ptr.hpp> + +namespace +boost + { + namespace + exception_detail + { + template <class ErrorInfo> + struct + get_info + { + static + typename ErrorInfo::value_type * + get( exception const & x ) + { + if( exception_detail::error_info_container * c=x.data_.get() ) + if( shared_ptr<exception_detail::error_info_base> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) ) + { +#ifndef BOOST_NO_RTTI + BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo *>(eib.get()) ); +#endif + ErrorInfo * w = static_cast<ErrorInfo *>(eib.get()); + return &w->value(); + } + return 0; + } + }; + + template <> + struct + get_info<throw_function> + { + static + char const * * + get( exception const & x ) + { + return x.throw_function_ ? &x.throw_function_ : 0; + } + }; + + template <> + struct + get_info<throw_file> + { + static + char const * * + get( exception const & x ) + { + return x.throw_file_ ? &x.throw_file_ : 0; + } + }; + + template <> + struct + get_info<throw_line> + { + static + int * + get( exception const & x ) + { + return x.throw_line_!=-1 ? &x.throw_line_ : 0; + } + }; + + template <class T,class R> + struct + get_error_info_return_type + { + typedef R * type; + }; + + template <class T,class R> + struct + get_error_info_return_type<T const,R> + { + typedef R const * type; + }; + } + +#ifdef BOOST_NO_RTTI + template <class ErrorInfo> + inline + typename ErrorInfo::value_type const * + get_error_info( boost::exception const & x ) + { + return exception_detail::get_info<ErrorInfo>::get(x); + } + template <class ErrorInfo> + inline + typename ErrorInfo::value_type * + get_error_info( boost::exception & x ) + { + return exception_detail::get_info<ErrorInfo>::get(x); + } +#else + template <class ErrorInfo,class E> + inline + typename exception_detail::get_error_info_return_type<E,typename ErrorInfo::value_type>::type + get_error_info( E & some_exception ) + { + if( exception const * x = dynamic_cast<exception const *>(&some_exception) ) + return exception_detail::get_info<ErrorInfo>::get(*x); + else + return 0; + } +#endif + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/info.hpp b/3rdParty/Boost/src/boost/exception/info.hpp new file mode 100644 index 0000000..cbbc2c0 --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/info.hpp @@ -0,0 +1,167 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593 +#define UUID_8D22C4CA9CC811DCAA9133D256D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <boost/exception/exception.hpp> +#include <boost/exception/to_string_stub.hpp> +#include <boost/exception/detail/error_info_impl.hpp> +#include <boost/shared_ptr.hpp> +#include <boost/config.hpp> +#include <map> + +namespace +boost + { + template <class Tag,class T> + inline + typename enable_if<has_to_string<T>,std::string>::type + to_string( error_info<Tag,T> const & x ) + { + return to_string(x.value()); + } + + template <class Tag,class T> + inline + error_info<Tag,T>:: + error_info( value_type const & value ): + value_(value) + { + } + + template <class Tag,class T> + inline + error_info<Tag,T>:: + ~error_info() throw() + { + } + + template <class Tag,class T> + inline + char const * + error_info<Tag,T>:: + tag_typeid_name() const + { + return tag_type_name<Tag>(); + } + + template <class Tag,class T> + inline + std::string + error_info<Tag,T>:: + value_as_string() const + { + return to_string_stub(*this); + } + + namespace + exception_detail + { + class + error_info_container_impl: + public error_info_container + { + public: + + error_info_container_impl(): + count_(0) + { + } + + ~error_info_container_impl() throw() + { + } + + void + set( shared_ptr<error_info_base> const & x, type_info_ const & typeid_ ) + { + BOOST_ASSERT(x); + info_[typeid_] = x; + diagnostic_info_str_.clear(); + } + + shared_ptr<error_info_base> + get( type_info_ const & ti ) const + { + error_info_map::const_iterator i=info_.find(ti); + if( info_.end()!=i ) + { + shared_ptr<error_info_base> const & p = i->second; +#ifndef BOOST_NO_RTTI + BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==ti.type_ ); +#endif + return p; + } + return shared_ptr<error_info_base>(); + } + + char const * + diagnostic_information( char const * header ) const + { + if( header ) + { + BOOST_ASSERT(*header!=0); + std::ostringstream tmp; + tmp << header; + for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i ) + { + shared_ptr<error_info_base const> const & x = i->second; + tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << '\n'; + } + tmp.str().swap(diagnostic_info_str_); + } + return diagnostic_info_str_.c_str(); + } + + private: + + friend class boost::exception; + + typedef std::map< type_info_, shared_ptr<error_info_base> > error_info_map; + error_info_map info_; + mutable std::string diagnostic_info_str_; + mutable int count_; + + void + add_ref() const + { + ++count_; + } + + void + release() const + { + if( !--count_ ) + delete this; + } + }; + } + + template <class E,class Tag,class T> + inline + E const & + operator<<( E const & x, error_info<Tag,T> const & v ) + { + typedef error_info<Tag,T> error_info_tag_t; + shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) ); + exception_detail::error_info_container * c=x.data_.get(); + if( !c ) + x.data_.adopt(c=new exception_detail::error_info_container_impl); + c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t)); + return x; + } + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/to_string.hpp b/3rdParty/Boost/src/boost/exception/to_string.hpp new file mode 100644 index 0000000..59bf83d --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/to_string.hpp @@ -0,0 +1,83 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_7E48761AD92811DC9011477D56D89593 +#define UUID_7E48761AD92811DC9011477D56D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <boost/utility/enable_if.hpp> +#include <boost/exception/detail/is_output_streamable.hpp> +#include <sstream> + +namespace +boost + { + namespace + to_string_detail + { + template <class T> + typename disable_if<is_output_streamable<T>,char>::type to_string( T const & ); + + template <class,bool IsOutputStreamable> + struct has_to_string_impl; + + template <class T> + struct + has_to_string_impl<T,true> + { + enum e { value=1 }; + }; + + template <class T> + struct + has_to_string_impl<T,false> + { + static T const & f(); + enum e { value=1!=sizeof(to_string(f())) }; + }; + } + + template <class T> + inline + typename enable_if<is_output_streamable<T>,std::string>::type + to_string( T const & x ) + { + std::ostringstream out; + out << x; + return out.str(); + } + + template <class T> + struct + has_to_string + { + enum e { value=to_string_detail::has_to_string_impl<T,is_output_streamable<T>::value>::value }; + }; + + template <class T,class U> + inline + std::string + to_string( std::pair<T,U> const & x ) + { + return std::string("(") + to_string(x.first) + ',' + to_string(x.second) + ')'; + } + + inline + std::string + to_string( std::exception const & x ) + { + return x.what(); + } + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception/to_string_stub.hpp b/3rdParty/Boost/src/boost/exception/to_string_stub.hpp new file mode 100644 index 0000000..e41d369 --- /dev/null +++ b/3rdParty/Boost/src/boost/exception/to_string_stub.hpp @@ -0,0 +1,109 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_E788439ED9F011DCB181F25B55D89593 +#define UUID_E788439ED9F011DCB181F25B55D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include <boost/exception/to_string.hpp> +#include <boost/exception/detail/object_hex_dump.hpp> +#include <boost/assert.hpp> + +namespace +boost + { + namespace + exception_detail + { + template <bool ToStringAvailable> + struct + to_string_dispatcher + { + template <class T,class Stub> + static + std::string + convert( T const & x, Stub ) + { + return to_string(x); + } + }; + + template <> + struct + to_string_dispatcher<false> + { + template <class T,class Stub> + static + std::string + convert( T const & x, Stub s ) + { + return s(x); + } + + template <class T> + static + std::string + convert( T const & x, std::string s ) + { + return s; + } + + template <class T> + static + std::string + convert( T const & x, char const * s ) + { + BOOST_ASSERT(s!=0); + return s; + } + }; + + namespace + to_string_dispatch + { + template <class T,class Stub> + inline + std::string + dispatch( T const & x, Stub s ) + { + return to_string_dispatcher<has_to_string<T>::value>::convert(x,s); + } + } + + template <class T> + inline + std::string + string_stub_dump( T const & x ) + { + return "[ " + exception_detail::object_hex_dump(x) + " ]"; + } + } + + template <class T> + inline + std::string + to_string_stub( T const & x ) + { + return exception_detail::to_string_dispatch::dispatch(x,&exception_detail::string_stub_dump<T>); + } + + template <class T,class Stub> + inline + std::string + to_string_stub( T const & x, Stub s ) + { + return exception_detail::to_string_dispatch::dispatch(x,s); + } + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/3rdParty/Boost/src/boost/exception_ptr.hpp b/3rdParty/Boost/src/boost/exception_ptr.hpp new file mode 100644 index 0000000..d48cce9 --- /dev/null +++ b/3rdParty/Boost/src/boost/exception_ptr.hpp @@ -0,0 +1,11 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593 +#define UUID_FA5836A2CADA11DC8CD47C8555D89593 + +#include <boost/exception/detail/exception_ptr.hpp> + +#endif diff --git a/3rdParty/Boost/src/boost/filesystem/operations.hpp b/3rdParty/Boost/src/boost/filesystem/operations.hpp index 5c2080c..4d52ab7 100644 --- a/3rdParty/Boost/src/boost/filesystem/operations.hpp +++ b/3rdParty/Boost/src/boost/filesystem/operations.hpp @@ -15,6 +15,7 @@ #define BOOST_FILESYSTEM_OPERATIONS_HPP #include <boost/filesystem/path.hpp> +#include <boost/detail/scoped_enum_emulation.hpp> #include <boost/shared_ptr.hpp> #include <boost/utility/enable_if.hpp> @@ -182,7 +183,7 @@ namespace boost BOOST_FILESYSTEM_DECL system::error_code rename_api( const std::string & from, const std::string & to ); BOOST_FILESYSTEM_DECL system::error_code - copy_file_api( const std::string & from, const std::string & to ); + copy_file_api( const std::string & from, const std::string & to, bool fail_if_exists ); # if defined(BOOST_WINDOWS_API) @@ -226,7 +227,7 @@ namespace boost BOOST_FILESYSTEM_DECL system::error_code rename_api( const std::wstring & from, const std::wstring & to ); BOOST_FILESYSTEM_DECL system::error_code - copy_file_api( const std::wstring & from, const std::wstring & to ); + copy_file_api( const std::wstring & from, const std::wstring & to, bool fail_if_exists ); # endif # endif @@ -506,11 +507,16 @@ namespace boost from_path, to_path, ec ) ); } - BOOST_FS_FUNC(void) copy_file( const Path & from_path, const Path & to_path ) + BOOST_SCOPED_ENUM_START(copy_option) + { fail_if_exists, overwrite_if_exists }; + BOOST_SCOPED_ENUM_END + + BOOST_FS_FUNC(void) copy_file( const Path & from_path, const Path & to_path, + BOOST_SCOPED_ENUM(copy_option) option = copy_option::fail_if_exists ) { system::error_code ec( detail::copy_file_api( from_path.external_directory_string(), - to_path.external_directory_string() ) ); + to_path.external_directory_string(), option == copy_option::fail_if_exists ) ); if ( ec ) boost::throw_exception( basic_filesystem_error<Path>( "boost::filesystem::copy_file", @@ -659,9 +665,9 @@ namespace boost { return is_symlink<wpath>( ph ); } inline bool is_empty( const path & ph ) - { return is_empty<path>( ph ); } + { return boost::filesystem::is_empty<path>( ph ); } inline bool is_empty( const wpath & ph ) - { return is_empty<wpath>( ph ); } + { return boost::filesystem::is_empty<wpath>( ph ); } inline bool equivalent( const path & ph1, const path & ph2 ) { return equivalent<path>( ph1, ph2 ); } diff --git a/3rdParty/Boost/src/boost/filesystem/path.hpp b/3rdParty/Boost/src/boost/filesystem/path.hpp index bfb1aab..8f5eaa0 100644 --- a/3rdParty/Boost/src/boost/filesystem/path.hpp +++ b/3rdParty/Boost/src/boost/filesystem/path.hpp @@ -208,6 +208,15 @@ namespace boost basic_path & append( InputIterator first, InputIterator last ); # endif + void clear() + { +# if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, >= 310) + m_path.clear(); +# else + m_path.erase( m_path.begin(), m_path.end() ); +# endif + } + void swap( basic_path & rhs ) { m_path.swap( rhs.m_path ); @@ -390,42 +399,57 @@ namespace boost lhs.begin(), lhs.end(), tmp.begin(), tmp.end() ); } - // operator == uses string compare rather than !(lhs < rhs) && !(rhs < lhs) because - // the result is the same yet the direct string compare is much more efficient that - // lexicographical_compare, and lexicographical_compare used twice at that. + // operator == uses hand-written compare rather than !(lhs < rhs) && !(rhs < lhs) + // because the result is the same yet the direct compare is much more efficient + // than lexicographical_compare, which would also be called twice. template< class String, class Traits > - inline bool operator==( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs ) + inline bool operator==( const basic_path<String, Traits> & lhs, + const typename basic_path<String, Traits>::string_type::value_type * rhs ) + { + typedef typename + boost::BOOST_FILESYSTEM_NAMESPACE::basic_path<String, Traits> path_type; + const typename path_type::string_type::value_type * l (lhs.string().c_str()); + while ( (*l == *rhs +# ifdef BOOST_WINDOWS_PATH + || (*l == path_alt_separator<path_type>::value && *rhs == slash<path_type>::value) + || (*l == slash<path_type>::value && *rhs == path_alt_separator<path_type>::value) +# endif + ) && *l ) { ++l; ++rhs; } + return *l == *rhs +# ifdef BOOST_WINDOWS_PATH + || (*l == path_alt_separator<path_type>::value && *rhs == slash<path_type>::value) + || (*l == slash<path_type>::value && *rhs == path_alt_separator<path_type>::value) +# endif + ; + } + + template< class String, class Traits > + inline bool operator==( const basic_path<String, Traits> & lhs, + const basic_path<String, Traits> & rhs ) { - return lhs.string() == rhs.string(); + return lhs == rhs.string().c_str(); } template< class String, class Traits > inline bool operator==( const typename basic_path<String, Traits>::string_type::value_type * lhs, const basic_path<String, Traits> & rhs ) { - return lhs == rhs.string(); + return rhs == lhs; } template< class String, class Traits > inline bool operator==( const typename basic_path<String, Traits>::string_type & lhs, const basic_path<String, Traits> & rhs ) { - return lhs == rhs.string(); - } - - template< class String, class Traits > - inline bool operator==( const basic_path<String, Traits> & lhs, - const typename basic_path<String, Traits>::string_type::value_type * rhs ) - { - return lhs.string() == rhs; + return rhs == lhs.c_str(); } template< class String, class Traits > inline bool operator==( const basic_path<String, Traits> & lhs, const typename basic_path<String, Traits>::string_type & rhs ) { - return lhs.string() == rhs; + return lhs == rhs.c_str(); } template< class String, class Traits > @@ -930,7 +954,7 @@ namespace boost String basic_path<String, Traits>::stem() const { string_type name = filename(); - typename string_type::size_type n = name.rfind('.'); + typename string_type::size_type n = name.rfind(dot<path_type>::value); return name.substr(0, n); } @@ -938,7 +962,7 @@ namespace boost String basic_path<String, Traits>::extension() const { string_type name = filename(); - typename string_type::size_type n = name.rfind('.'); + typename string_type::size_type n = name.rfind(dot<path_type>::value); if (n != string_type::npos) return name.substr(n); else diff --git a/3rdParty/Boost/src/boost/foreach.hpp b/3rdParty/Boost/src/boost/foreach.hpp index c384cee..9a5b931 100644 --- a/3rdParty/Boost/src/boost/foreach.hpp +++ b/3rdParty/Boost/src/boost/foreach.hpp @@ -218,8 +218,8 @@ inline boost::mpl::or_<Bool1, Bool2> *or_(Bool1 *, Bool2 *) { return 0; } template<typename Bool1, typename Bool2, typename Bool3> inline boost::mpl::or_<Bool1, Bool2, Bool3> *or_(Bool1 *, Bool2 *, Bool3 *) { return 0; } -template<typename Bool> -inline boost::mpl::not_<Bool> *not_(Bool *) { return 0; } +template<typename Bool1> +inline boost::mpl::not_<Bool1> *not_(Bool1 *) { return 0; } template<typename T> inline boost::mpl::false_ *is_rvalue_(T &, int) { return 0; } diff --git a/3rdParty/Boost/src/boost/function/function_base.hpp b/3rdParty/Boost/src/boost/function/function_base.hpp index 6612fb8..eb201a8 100644 --- a/3rdParty/Boost/src/boost/function/function_base.hpp +++ b/3rdParty/Boost/src/boost/function/function_base.hpp @@ -15,9 +15,12 @@ #include <string> #include <memory> #include <new> -#include <typeinfo> #include <boost/config.hpp> +#include <boost/detail/sp_typeinfo.hpp> #include <boost/assert.hpp> +#include <boost/integer.hpp> +#include <boost/type_traits/has_trivial_copy.hpp> +#include <boost/type_traits/has_trivial_destructor.hpp> #include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_integral.hpp> #include <boost/type_traits/is_volatile.hpp> @@ -42,7 +45,7 @@ #endif // Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info. -#ifdef BOOST_NO_EXCEPTION_STD_NAMESPACE +#ifdef BOOST_NO_STD_TYPEINFO // Embedded VC++ does not have type_info in namespace std # define BOOST_FUNCTION_STD_NS #else @@ -51,7 +54,9 @@ // Borrowed from Boost.Python library: determines the cases where we // need to use std::type_info::name to compare instead of operator==. -# if (defined(__GNUC__) && __GNUC__ >= 3) \ +#if defined( BOOST_NO_TYPEID ) +# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) +#elif (defined(__GNUC__) && __GNUC__ >= 3) \ || defined(_AIX) \ || ( defined(__sgi) && defined(__host_mips)) # include <cstring> @@ -100,7 +105,7 @@ namespace boost { // For pointers to std::type_info objects struct type_t { // (get_functor_type_tag, check_functor_type_tag). - const BOOST_FUNCTION_STD_NS::type_info* type; + const detail::sp_typeinfo* type; // Whether the type is const-qualified. bool const_qualified; @@ -212,12 +217,12 @@ namespace boost { case check_functor_type_tag: { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; // Check whether we have the same type. We can add // cv-qualifiers, but we can't take them away. - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(F)) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(F)) && (!in_buffer.obj_ref.is_const_qualified || out_buffer.type.const_qualified) && (!in_buffer.obj_ref.is_volatile_qualified @@ -229,7 +234,7 @@ namespace boost { return; case get_functor_type_tag: - out_buffer.type.type = &typeid(F); + out_buffer.type.type = &BOOST_SP_TYPEID(F); out_buffer.type.const_qualified = in_buffer.obj_ref.is_const_qualified; out_buffer.type.volatile_qualified = in_buffer.obj_ref.is_volatile_qualified; return; @@ -259,6 +264,12 @@ namespace boost { A(a) { } + + functor_wrapper(const functor_wrapper& f) : + F(static_cast<const F&>(f)), + A(static_cast<const A&>(f)) + { + } }; /** @@ -283,14 +294,14 @@ namespace boost { } else if (op == destroy_functor_tag) out_buffer.func_ptr = 0; else if (op == check_functor_type_tag) { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = &in_buffer.func_ptr; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &typeid(Functor); + out_buffer.type.type = &BOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -313,14 +324,14 @@ namespace boost { // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor(); } else if (op == check_functor_type_tag) { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = &in_buffer.data; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &typeid(Functor); + out_buffer.type.type = &BOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -372,14 +383,14 @@ namespace boost { delete f; out_buffer.obj_ptr = 0; } else if (op == check_functor_type_tag) { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = in_buffer.obj_ptr; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &typeid(Functor); + out_buffer.type.type = &BOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -414,7 +425,7 @@ namespace boost { typedef typename get_function_tag<functor_type>::type tag_type; switch (op) { case get_functor_type_tag: - out_buffer.type.type = &typeid(functor_type); + out_buffer.type.type = &BOOST_SP_TYPEID(functor_type); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; return; @@ -483,14 +494,14 @@ namespace boost { wrapper_allocator.deallocate(victim,1); out_buffer.obj_ptr = 0; } else if (op == check_functor_type_tag) { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = in_buffer.obj_ptr; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &typeid(Functor); + out_buffer.type.type = &BOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -517,7 +528,7 @@ namespace boost { typedef typename get_function_tag<functor_type>::type tag_type; switch (op) { case get_functor_type_tag: - out_buffer.type.type = &typeid(functor_type); + out_buffer.type.type = &BOOST_SP_TYPEID(functor_type); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; return; @@ -618,14 +629,14 @@ public: /** Determine if the function is empty (i.e., has no target). */ bool empty() const { return !vtable; } - /** Retrieve the type of the stored function object, or typeid(void) + /** Retrieve the type of the stored function object, or BOOST_SP_TYPEID(void) if this is empty. */ - const BOOST_FUNCTION_STD_NS::type_info& target_type() const + const detail::sp_typeinfo& target_type() const { - if (!vtable) return typeid(void); + if (!vtable) return BOOST_SP_TYPEID(void); detail::function::function_buffer type; - vtable->manager(functor, type, detail::function::get_functor_type_tag); + get_vtable()->manager(functor, type, detail::function::get_functor_type_tag); return *type.type.type; } @@ -635,10 +646,10 @@ public: if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.type.type = &typeid(Functor); + type_result.type.type = &BOOST_SP_TYPEID(Functor); type_result.type.const_qualified = is_const<Functor>::value; type_result.type.volatile_qualified = is_volatile<Functor>::value; - vtable->manager(functor, type_result, + get_vtable()->manager(functor, type_result, detail::function::check_functor_type_tag); return static_cast<Functor*>(type_result.obj_ptr); } @@ -653,10 +664,10 @@ public: if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.type.type = &typeid(Functor); + type_result.type.type = &BOOST_SP_TYPEID(Functor); type_result.type.const_qualified = true; type_result.type.volatile_qualified = is_volatile<Functor>::value; - vtable->manager(functor, type_result, + get_vtable()->manager(functor, type_result, detail::function::check_functor_type_tag); // GCC 2.95.3 gets the CV qualifiers wrong here, so we // can't do the static_cast that we should do. @@ -702,6 +713,15 @@ public: #endif public: // should be protected, but GCC 2.95.3 will fail to allow access + detail::function::vtable_base* get_vtable() const { + return reinterpret_cast<detail::function::vtable_base*>( + reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01); + } + + bool has_trivial_copy_and_destroy() const { + return reinterpret_cast<std::size_t>(vtable) & 0x01; + } + detail::function::vtable_base* vtable; mutable detail::function::function_buffer functor; }; @@ -877,4 +897,8 @@ namespace detail { #undef BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL #undef BOOST_FUNCTION_COMPARE_TYPE_ID +#if defined(BOOST_MSVC) +# pragma warning( pop ) +#endif + #endif // BOOST_FUNCTION_BASE_HEADER diff --git a/3rdParty/Boost/src/boost/function/function_fwd.hpp b/3rdParty/Boost/src/boost/function/function_fwd.hpp index d2f713a..fb318c9 100644 --- a/3rdParty/Boost/src/boost/function/function_fwd.hpp +++ b/3rdParty/Boost/src/boost/function/function_fwd.hpp @@ -21,7 +21,7 @@ namespace boost { namespace python { namespace objects { #if defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ || defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \ - || !(BOOST_STRICT_CONFIG || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540) + || !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540) # define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX #endif diff --git a/3rdParty/Boost/src/boost/function/function_template.hpp b/3rdParty/Boost/src/boost/function/function_template.hpp index 584abe9..6a99109 100644 --- a/3rdParty/Boost/src/boost/function/function_template.hpp +++ b/3rdParty/Boost/src/boost/function/function_template.hpp @@ -11,6 +11,7 @@ // Note: this header is a header template and must NOT have multiple-inclusion // protection. #include <boost/function/detail/prologue.hpp> +#include <boost/detail/no_exceptions_support.hpp> #if defined(BOOST_MSVC) # pragma warning( push ) @@ -624,14 +625,10 @@ namespace boost { assign_to(const reference_wrapper<FunctionObj>& f, function_buffer& functor, function_obj_ref_tag) { - if (!boost::detail::function::has_empty_target(f.get_pointer())) { - functor.obj_ref.obj_ptr = (void *)f.get_pointer(); - functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value; - functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value; - return true; - } else { - return false; - } + functor.obj_ref.obj_ptr = (void *)f.get_pointer(); + functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value; + functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value; + return true; } template<typename FunctionObj,typename Allocator> bool @@ -678,6 +675,11 @@ namespace boost { R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS> vtable_type; + vtable_type* get_vtable() const { + return reinterpret_cast<vtable_type*>( + reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01); + } + struct clear_type {}; public: @@ -757,7 +759,7 @@ namespace boost { if (this->empty()) boost::throw_exception(bad_function_call()); - return static_cast<vtable_type*>(vtable)->invoker + return get_vtable()->invoker (this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS); } #else @@ -781,24 +783,26 @@ namespace boost { operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) { this->clear(); - try { + BOOST_TRY { this->assign_to(f); - } catch (...) { + } BOOST_CATCH (...) { vtable = 0; - throw; + BOOST_RETHROW; } + BOOST_CATCH_END return *this; } template<typename Functor,typename Allocator> void assign(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a) { this->clear(); - try { + BOOST_TRY{ this->assign_to_a(f,a); - } catch (...) { + } BOOST_CATCH (...) { vtable = 0; - throw; + BOOST_RETHROW; } + BOOST_CATCH_END } #ifndef BOOST_NO_SFINAE @@ -823,12 +827,13 @@ namespace boost { return *this; this->clear(); - try { + BOOST_TRY { this->assign_to_own(f); - } catch (...) { + } BOOST_CATCH (...) { vtable = 0; - throw; + BOOST_RETHROW; } + BOOST_CATCH_END return *this; } @@ -847,7 +852,8 @@ namespace boost { void clear() { if (vtable) { - reinterpret_cast<vtable_type*>(vtable)->clear(this->functor); + if (!this->has_trivial_copy_and_destroy()) + get_vtable()->clear(this->functor); vtable = 0; } } @@ -876,8 +882,11 @@ namespace boost { { if (!f.empty()) { this->vtable = f.vtable; - f.vtable->manager(f.functor, this->functor, - boost::detail::function::clone_functor_tag); + if (this->has_trivial_copy_and_destroy()) + this->functor = f.functor; + else + get_vtable()->base.manager(f.functor, this->functor, + boost::detail::function::clone_functor_tag); } } @@ -903,8 +912,15 @@ namespace boost { static vtable_type stored_vtable = { { &manager_type::manage }, &invoker_type::invoke }; - if (stored_vtable.assign_to(f, functor)) vtable = &stored_vtable.base; - else vtable = 0; + if (stored_vtable.assign_to(f, functor)) { + std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base); + if (boost::has_trivial_copy_constructor<Functor>::value && + boost::has_trivial_destructor<Functor>::value && + detail::function::function_allows_small_object_optimization<Functor>::value) + value |= (std::size_t)0x01; + vtable = reinterpret_cast<detail::function::vtable_base *>(value); + } else + vtable = 0; } template<typename Functor,typename Allocator> @@ -930,8 +946,15 @@ namespace boost { static vtable_type stored_vtable = { { &manager_type::manage }, &invoker_type::invoke }; - if (stored_vtable.assign_to_a(f, functor, a)) vtable = &stored_vtable.base; - else vtable = 0; + if (stored_vtable.assign_to_a(f, functor, a)) { + std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base); + if (boost::has_trivial_copy_constructor<Functor>::value && + boost::has_trivial_destructor<Functor>::value && + detail::function::function_allows_small_object_optimization<Functor>::value) + value |= (std::size_t)0x01; + vtable = reinterpret_cast<detail::function::vtable_base *>(value); + } else + vtable = 0; } // Moves the value from the specified argument to *this. If the argument @@ -942,23 +965,23 @@ namespace boost { if (&f == this) return; -#if !defined(BOOST_NO_EXCEPTIONS) - try { -#endif + BOOST_TRY { if (!f.empty()) { this->vtable = f.vtable; - f.vtable->manager(f.functor, this->functor, - boost::detail::function::move_functor_tag); - f.vtable = 0; -#if !defined(BOOST_NO_EXCEPTIONS) + if (this->has_trivial_copy_and_destroy()) + this->functor = f.functor; + else + get_vtable()->base.manager(f.functor, this->functor, + boost::detail::function::move_functor_tag); + f.vtable = 0; } else { clear(); } - } catch (...) { + } BOOST_CATCH (...) { vtable = 0; - throw; + BOOST_RETHROW; } -#endif + BOOST_CATCH_END } }; @@ -979,13 +1002,14 @@ namespace boost { template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS> typename BOOST_FUNCTION_FUNCTION< R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>::result_type - BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS> + inline + BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS> ::operator()(BOOST_FUNCTION_PARMS) const { if (this->empty()) boost::throw_exception(bad_function_call()); - return reinterpret_cast<const vtable_type*>(vtable)->invoker + return get_vtable()->invoker (this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS); } #endif diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp index 69cf91a..ae03ff0 100644 --- a/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/detail/float_functions.hpp @@ -6,6 +6,7 @@ #if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP) #define BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP +#include <boost/config.hpp> #include <boost/config/no_tr1/cmath.hpp> #if defined(_MSC_VER) && (_MSC_VER >= 1020) @@ -17,146 +18,229 @@ // library implementations don't support this. On some that don't, the C99 // float functions (frexpf, frexpl, etc.) are available. // -// Some of this is based on guess work. If I don't know any better I assume that -// the standard C++ overloaded functions are available. If they're not then this -// means that the argument is cast to a double and back, which is inefficient -// and will give pretty bad results for long doubles - so if you know better -// let me know. - -// STLport: -#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) -# if (defined(__GNUC__) && __GNUC__ < 3 && (defined(linux) || defined(__linux) || defined(__linux__))) || defined(__DMC__) -# define BOOST_HASH_USE_C99_FLOAT_FUNCS -# elif defined(BOOST_MSVC) && BOOST_MSVC < 1300 -# define BOOST_HASH_USE_C99_FLOAT_FUNCS -# else -# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS -# endif - -// Roguewave: +// The following tries to automatically detect which are available. + +namespace boost { + namespace hash_detail { + + // Returned by dummy versions of the float functions. + + struct not_found { + // Implicitly convertible to float and long double in order to avoid + // a compile error when the dummy float functions are used. + + inline operator float() const { return 0; } + inline operator long double() const { return 0; } + }; + + // A type for detecting the return type of functions. + + template <typename T> struct is; + template <> struct is<float> { char x[10]; }; + template <> struct is<double> { char x[20]; }; + template <> struct is<long double> { char x[30]; }; + template <> struct is<boost::hash_detail::not_found> { char x[40]; }; + + // Used to convert the return type of a function to a type for sizeof. + + template <typename T> is<T> float_type(T); + + // call_ldexp + // + // This will get specialized for float and long double + + template <typename Float> struct call_ldexp + { + typedef double float_type; + + inline double operator()(double a, int b) const + { + using namespace std; + return ldexp(a, b); + } + }; + + // call_frexp + // + // This will get specialized for float and long double + + template <typename Float> struct call_frexp + { + typedef double float_type; + + inline double operator()(double a, int* b) const + { + using namespace std; + return frexp(a, b); + } + }; + } +} + +// A namespace for dummy functions to detect when the actual function we want +// isn't available. ldexpl, ldexpf etc. might be added tby the macros below. // -// On borland 5.51, with roguewave 2.1.1 the standard C++ overloads aren't -// defined, but for the same version of roguewave on sunpro they are. -#elif defined(_RWSTD_VER) -# if defined(__BORLANDC__) -# define BOOST_HASH_USE_C99_FLOAT_FUNCS -# define BOOST_HASH_C99_NO_FLOAT_FUNCS -# elif defined(__DECCXX) -# define BOOST_HASH_USE_C99_FLOAT_FUNCS -# else -# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS -# endif - -// libstdc++ (gcc 3.0 onwards, I think) -#elif defined(__GLIBCPP__) || defined(__GLIBCXX__) -# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS - -// SGI: -#elif defined(__STL_CONFIG_H) -# if defined(linux) || defined(__linux) || defined(__linux__) -# define BOOST_HASH_USE_C99_FLOAT_FUNCS -# else -# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS -# endif - -// vxWorks. It has its own math library, but uses Dinkumware STL -#elif defined(__VXWORKS__) -# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS - -// Dinkumware. -#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) -// Some versions of Visual C++ don't seem to have the C++ overloads but they -// all seem to have the c99 float overloads -# if defined(BOOST_MSVC) -# define BOOST_HASH_USE_C99_FLOAT_FUNCS -// On other platforms the C++ overloads seem to have been introduced sometime -// before 402. -# elif defined(_CPPLIB_VER) && (_CPPLIB_VER >= 402) -# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS -# else -# define BOOST_HASH_USE_C99_FLOAT_FUNCS -# endif - -// Digital Mars -#elif defined(__DMC__) -# define BOOST_HASH_USE_C99_FLOAT_FUNCS - -// Use overloaded float functions by default. -#else -# define BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS -#endif +// AFAICT these have to be outside of the boost namespace, as if they're in +// the boost namespace they'll always be preferable to any other function +// (since the arguments are built in types, ADL can't be used). -namespace boost -{ - namespace hash_detail - { +namespace boost_hash_detect_float_functions { + template <class Float> boost::hash_detail::not_found ldexp(Float, int); + template <class Float> boost::hash_detail::not_found frexp(Float, int*); +} - inline float call_ldexp(float v, int exp) - { - using namespace std; -#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS) || \ - defined(BOOST_HASH_C99_NO_FLOAT_FUNCS) - return ldexp(v, exp); -#else - return ldexpf(v, exp); -#endif - } +// Macros for generating specializations of call_ldexp and call_frexp. +// +// check_cpp and check_c99 check if the C++ or C99 functions are available. +// +// Then the call_* functions select an appropriate implementation. +// +// I used c99_func in a few places just to get a unique name. +// +// Important: when using 'using namespace' at namespace level, include as +// little as possible in that namespace, as Visual C++ has an odd bug which +// can cause the namespace to be imported at the global level. This seems to +// happen mainly when there's a template in the same namesapce. + +#define BOOST_HASH_CALL_FLOAT_FUNC(cpp_func, c99_func, type1, type2) \ +namespace boost_hash_detect_float_functions { \ + template <class Float> \ + boost::hash_detail::not_found c99_func(Float, type2); \ +} \ + \ +namespace boost { \ + namespace hash_detail { \ + namespace c99_func##_detect { \ + using namespace std; \ + using namespace boost_hash_detect_float_functions; \ + \ + struct check { \ + static type1 x; \ + static type2 y; \ + BOOST_STATIC_CONSTANT(bool, cpp = \ + sizeof(float_type(cpp_func(x,y))) \ + == sizeof(is<type1>)); \ + BOOST_STATIC_CONSTANT(bool, c99 = \ + sizeof(float_type(c99_func(x,y))) \ + == sizeof(is<type1>)); \ + }; \ + } \ + \ + template <bool x> \ + struct call_c99_##c99_func : \ + boost::hash_detail::call_##cpp_func<double> {}; \ + \ + template <> \ + struct call_c99_##c99_func<true> { \ + typedef type1 float_type; \ + \ + template <typename T> \ + inline type1 operator()(type1 a, T b) const \ + { \ + using namespace std; \ + return c99_func(a, b); \ + } \ + }; \ + \ + template <bool x> \ + struct call_cpp_##c99_func : \ + call_c99_##c99_func< \ + ::boost::hash_detail::c99_func##_detect::check::c99 \ + > {}; \ + \ + template <> \ + struct call_cpp_##c99_func<true> { \ + typedef type1 float_type; \ + \ + template <typename T> \ + inline type1 operator()(type1 a, T b) const \ + { \ + using namespace std; \ + return cpp_func(a, b); \ + } \ + }; \ + \ + template <> \ + struct call_##cpp_func<type1> : \ + call_cpp_##c99_func< \ + ::boost::hash_detail::c99_func##_detect::check::cpp \ + > {}; \ + } \ +} - inline double call_ldexp(double v, int exp) - { - using namespace std; - return ldexp(v, exp); - } +#define BOOST_HASH_CALL_FLOAT_MACRO(cpp_func, c99_func, type1, type2) \ +namespace boost { \ + namespace hash_detail { \ + \ + template <> \ + struct call_##cpp_func<type1> { \ + typedef type1 float_type; \ + inline type1 operator()(type1 x, type2 y) const { \ + return c99_func(x, y); \ + } \ + }; \ + } \ +} - inline long double call_ldexp(long double v, int exp) - { - using namespace std; -#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS) - return ldexp(v, exp); +#if defined(ldexpf) +BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpf, float, int) #else - return ldexpl(v, exp); +BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpf, float, int) #endif - } - inline float call_frexp(float v, int* exp) - { - using namespace std; -#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS) || \ - defined(BOOST_HASH_C99_NO_FLOAT_FUNCS) - return frexp(v, exp); +#if defined(ldexpl) +BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpl, long double, int) #else - return frexpf(v, exp); +BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpl, long double, int) #endif - } - - inline double call_frexp(double v, int* exp) - { - using namespace std; - return frexp(v, exp); - } - inline long double call_frexp(long double v, int* exp) - { - using namespace std; -#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS) - return frexp(v, exp); +#if defined(frexpf) +BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpf, float, int*) #else - return frexpl(v, exp); +BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpf, float, int*) #endif - } - } -} -#if defined(BOOST_HASH_USE_C99_FLOAT_FUNCS) -#undef BOOST_HASH_USE_C99_FLOAT_FUNCS +#if defined(frexpl) +BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpl, long double, int*) +#else +BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpl, long double, int*) #endif -#if defined(BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS) -#undef BOOST_HASH_USE_OVERLOAD_FLOAT_FUNCS -#endif +#undef BOOST_HASH_CALL_FLOAT_MACRO +#undef BOOST_HASH_CALL_FLOAT_FUNC -#if defined(BOOST_HASH_C99_NO_FLOAT_FUNCS) -#undef BOOST_HASH_C99_NO_FLOAT_FUNCS -#endif + +namespace boost +{ + namespace hash_detail + { + template <typename Float1, typename Float2> + struct select_hash_type_impl { + typedef double type; + }; + + template <> + struct select_hash_type_impl<float, float> { + typedef float type; + }; + + template <> + struct select_hash_type_impl<long double, long double> { + typedef long double type; + }; + + + // select_hash_type + // + // If there is support for a particular floating point type, use that + // otherwise use double (there's always support for double). + + template <typename Float> + struct select_hash_type : select_hash_type_impl< + BOOST_DEDUCED_TYPENAME call_ldexp<Float>::float_type, + BOOST_DEDUCED_TYPENAME call_frexp<Float>::float_type + > {}; + } +} #endif diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp index 5d5ac34..ea1bc25 100644 --- a/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float.hpp @@ -10,164 +10,57 @@ # pragma once #endif -#if defined(BOOST_MSVC) -#pragma warning(push) -#if BOOST_MSVC >= 1400 -#pragma warning(disable:6294) // Ill-defined for-loop: initial condition does - // not satisfy test. Loop body not executed -#endif -#endif - +#include <boost/config.hpp> #include <boost/functional/hash/detail/float_functions.hpp> +#include <boost/functional/hash/detail/limits.hpp> #include <boost/integer/static_log2.hpp> #include <boost/cstdint.hpp> -#include <boost/limits.hpp> #include <boost/assert.hpp> -// Select implementation for the current platform. +// Include hash implementation for the current platform. // Cygwn #if defined(__CYGWIN__) # if defined(__i386__) || defined(_M_IX86) -# define BOOST_HASH_USE_x86_BINARY_HASH +# include <boost/functional/hash/detail/hash_float_x86.hpp> +# else +# include <boost/functional/hash/detail/hash_float_generic.hpp> # endif +#else +# include <boost/functional/hash/detail/hash_float_generic.hpp> +#endif + +// Can we use fpclassify? // STLport -#elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) -// fpclassify aren't good enough on STLport. +#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +#define BOOST_HASH_USE_FPCLASSIFY 0 // GNU libstdc++ 3 #elif defined(__GLIBCPP__) || defined(__GLIBCXX__) # if (defined(__USE_ISOC99) || defined(_GLIBCXX_USE_C99_MATH)) && \ !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) -# define BOOST_HASH_USE_FPCLASSIFY +# define BOOST_HASH_USE_FPCLASSIFY 1 +# else +# define BOOST_HASH_USE_FPCLASSIFY 0 # endif -// Dinkumware Library, on Visual C++ -#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) - -// Not using _fpclass because it is only available for double. - +// Everything else +#else +# define BOOST_HASH_USE_FPCLASSIFY 0 #endif -// On OpenBSD, numeric_limits is not reliable for long doubles, but -// the macros defined in <float.h> are. +#if BOOST_HASH_USE_FPCLASSIFY -#if defined(__OpenBSD__) -#include <float.h> -#endif +#include <boost/config/no_tr1/cmath.hpp> namespace boost { namespace hash_detail { template <class T> - struct limits : std::numeric_limits<T> {}; - -#if defined(__OpenBSD__) - template <> - struct limits<long double> - : std::numeric_limits<long double> - { - static long double epsilon() { - return LDBL_EPSILON; - } - - static long double (max)() { - return LDBL_MAX; - } - - static long double (min)() { - return LDBL_MIN; - } - - BOOST_STATIC_CONSTANT(int, digits = LDBL_MANT_DIG); - BOOST_STATIC_CONSTANT(int, max_exponent = LDBL_MAX_EXP); - BOOST_STATIC_CONSTANT(int, min_exponent = LDBL_MIN_EXP); - }; -#endif // __OpenBSD__ - - inline void hash_float_combine(std::size_t& seed, std::size_t value) - { - seed ^= value + (seed<<6) + (seed>>2); - } - -// A simple, non-portable hash algorithm for x86. -#if defined(BOOST_HASH_USE_x86_BINARY_HASH) - inline std::size_t float_hash_impl(float v) - { - boost::uint32_t* ptr = (boost::uint32_t*)&v; - std::size_t seed = *ptr; - return seed; - } - - inline std::size_t float_hash_impl(double v) - { - boost::uint32_t* ptr = (boost::uint32_t*)&v; - std::size_t seed = *ptr++; - hash_float_combine(seed, *ptr); - return seed; - } - - inline std::size_t float_hash_impl(long double v) - { - boost::uint32_t* ptr = (boost::uint32_t*)&v; - std::size_t seed = *ptr++; - hash_float_combine(seed, *ptr++); - hash_float_combine(seed, *(boost::uint16_t*)ptr); - return seed; - } - -#else - - template <class T> - inline std::size_t float_hash_impl(T v) - { - int exp = 0; - - v = boost::hash_detail::call_frexp(v, &exp); - - // A postive value is easier to hash, so combine the - // sign with the exponent. - if(v < 0) { - v = -v; - exp += limits<T>::max_exponent - - limits<T>::min_exponent; - } - - // The result of frexp is always between 0.5 and 1, so its - // top bit will always be 1. Subtract by 0.5 to remove that. - v -= T(0.5); - v = boost::hash_detail::call_ldexp(v, - limits<std::size_t>::digits + 1); - std::size_t seed = static_cast<std::size_t>(v); - v -= seed; - - // ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1; - std::size_t const length - = (limits<T>::digits * - boost::static_log2<limits<T>::radix>::value - 1) - / limits<std::size_t>::digits; - - for(std::size_t i = 0; i != length; ++i) - { - v = boost::hash_detail::call_ldexp(v, - limits<std::size_t>::digits); - std::size_t part = static_cast<std::size_t>(v); - v -= part; - hash_float_combine(seed, part); - } - - hash_float_combine(seed, exp); - - return seed; - } -#endif - - template <class T> inline std::size_t float_hash_value(T v) { -#if defined(BOOST_HASH_USE_FPCLASSIFY) using namespace std; switch (fpclassify(v)) { case FP_ZERO: @@ -183,15 +76,26 @@ namespace boost BOOST_ASSERT(0); return 0; } -#else + } + } +} + +#else // !BOOST_HASH_USE_FPCLASSIFY + +namespace boost +{ + namespace hash_detail + { + template <class T> + inline std::size_t float_hash_value(T v) + { return v == 0 ? 0 : float_hash_impl(v); -#endif } } } -#if defined(BOOST_MSVC) -#pragma warning(pop) -#endif +#endif // BOOST_HASH_USE_FPCLASSIFY + +#undef BOOST_HASH_USE_FPCLASSIFY #endif diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/hash_float_generic.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float_generic.hpp new file mode 100644 index 0000000..f9acee9 --- /dev/null +++ b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float_generic.hpp @@ -0,0 +1,93 @@ + +// 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) + +// A general purpose hash function for non-zero floating point values. + +#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_GENERIC_HEADER) +#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_GENERIC_HEADER + +#include <boost/functional/hash/detail/float_functions.hpp> +#include <boost/integer/static_log2.hpp> +#include <boost/functional/hash/detail/limits.hpp> + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#if defined(BOOST_MSVC) +#pragma warning(push) +#if BOOST_MSVC >= 1400 +#pragma warning(disable:6294) // Ill-defined for-loop: initial condition does + // not satisfy test. Loop body not executed +#endif +#endif + +namespace boost +{ + namespace hash_detail + { + inline void hash_float_combine(std::size_t& seed, std::size_t value) + { + seed ^= value + (seed<<6) + (seed>>2); + } + + template <class T> + inline std::size_t float_hash_impl2(T v) + { + boost::hash_detail::call_frexp<T> frexp; + boost::hash_detail::call_ldexp<T> ldexp; + + int exp = 0; + + v = frexp(v, &exp); + + // A postive value is easier to hash, so combine the + // sign with the exponent and use the absolute value. + if(v < 0) { + v = -v; + exp += limits<T>::max_exponent - + limits<T>::min_exponent; + } + + // The result of frexp is always between 0.5 and 1, so its + // top bit will always be 1. Subtract by 0.5 to remove that. + v -= T(0.5); + v = ldexp(v, limits<std::size_t>::digits + 1); + std::size_t seed = static_cast<std::size_t>(v); + v -= seed; + + // ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1; + std::size_t const length + = (limits<T>::digits * + boost::static_log2<limits<T>::radix>::value - 1) + / limits<std::size_t>::digits; + + for(std::size_t i = 0; i != length; ++i) + { + v = ldexp(v, limits<std::size_t>::digits); + std::size_t part = static_cast<std::size_t>(v); + v -= part; + hash_float_combine(seed, part); + } + + hash_float_combine(seed, exp); + + return seed; + } + + template <class T> + inline std::size_t float_hash_impl(T v) + { + typedef BOOST_DEDUCED_TYPENAME select_hash_type<T>::type type; + return float_hash_impl2(static_cast<type>(v)); + } + } +} + +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + +#endif diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/hash_float_x86.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float_x86.hpp new file mode 100644 index 0000000..b39bb0d --- /dev/null +++ b/3rdParty/Boost/src/boost/functional/hash/detail/hash_float_x86.hpp @@ -0,0 +1,56 @@ + +// 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) + +// A non-portable hash function form non-zero floats on x86. +// +// Even if you're on an x86 platform, this might not work if their floating +// point isn't set up as this expects. So this should only be used if it's +// absolutely certain that it will work. + +#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_X86_HEADER) +#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_X86_HEADER + +#include <boost/cstdint.hpp> + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +namespace boost +{ + namespace hash_detail + { + inline void hash_float_combine(std::size_t& seed, std::size_t value) + { + seed ^= value + (seed<<6) + (seed>>2); + } + + inline std::size_t float_hash_impl(float v) + { + boost::uint32_t* ptr = (boost::uint32_t*)&v; + std::size_t seed = *ptr; + return seed; + } + + inline std::size_t float_hash_impl(double v) + { + boost::uint32_t* ptr = (boost::uint32_t*)&v; + std::size_t seed = *ptr++; + hash_float_combine(seed, *ptr); + return seed; + } + + inline std::size_t float_hash_impl(long double v) + { + boost::uint32_t* ptr = (boost::uint32_t*)&v; + std::size_t seed = *ptr++; + hash_float_combine(seed, *ptr++); + hash_float_combine(seed, *(boost::uint16_t*)ptr); + return seed; + } + } +} + +#endif diff --git a/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp b/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp new file mode 100644 index 0000000..f5b520e --- /dev/null +++ b/3rdParty/Boost/src/boost/functional/hash/detail/limits.hpp @@ -0,0 +1,61 @@ + +// 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) +// +// On some platforms std::limits gives incorrect values for long double. +// This tries to work around them. + +#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER) +#define BOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#include <boost/limits.hpp> + +// On OpenBSD, numeric_limits is not reliable for long doubles, but +// the macros defined in <float.h> are and support long double when STLport +// doesn't. + +#if defined(__OpenBSD__) || defined(_STLP_NO_LONG_DOUBLE) +#include <float.h> +#endif + +namespace boost +{ + namespace hash_detail + { + template <class T> + struct limits : std::numeric_limits<T> {}; + +#if defined(__OpenBSD__) || defined(_STLP_NO_LONG_DOUBLE) + template <> + struct limits<long double> + : std::numeric_limits<long double> + { + static long double epsilon() { + return LDBL_EPSILON; + } + + static long double (max)() { + return LDBL_MAX; + } + + static long double (min)() { + return LDBL_MIN; + } + + BOOST_STATIC_CONSTANT(int, digits = LDBL_MANT_DIG); + BOOST_STATIC_CONSTANT(int, max_exponent = LDBL_MAX_EXP); + BOOST_STATIC_CONSTANT(int, min_exponent = LDBL_MIN_EXP); +#if defined(_STLP_NO_LONG_DOUBLE) + BOOST_STATIC_CONSTANT(int, radix = FLT_RADIX); +#endif + }; +#endif // __OpenBSD__ + } +} + +#endif diff --git a/3rdParty/Boost/src/boost/functional/hash/extensions.hpp b/3rdParty/Boost/src/boost/functional/hash/extensions.hpp index d173314..3c587a3 100644 --- a/3rdParty/Boost/src/boost/functional/hash/extensions.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/extensions.hpp @@ -7,15 +7,114 @@ // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf // issue 6.18. +// This implements the extensions to the standard. +// It's undocumented, so you shouldn't use it.... + #if !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP) #define BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP +#include <boost/functional/hash/hash.hpp> +#include <boost/detail/container_fwd.hpp> + #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif +#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) +#include <boost/type_traits/is_array.hpp> +#endif + +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) +#include <boost/type_traits/is_const.hpp> +#endif + namespace boost { + template <class A, class B> + std::size_t hash_value(std::pair<A, B> const&); + template <class T, class A> + std::size_t hash_value(std::vector<T, A> const&); + template <class T, class A> + std::size_t hash_value(std::list<T, A> const& v); + template <class T, class A> + std::size_t hash_value(std::deque<T, A> const& v); + template <class K, class C, class A> + std::size_t hash_value(std::set<K, C, A> const& v); + template <class K, class C, class A> + std::size_t hash_value(std::multiset<K, C, A> const& v); + template <class K, class T, class C, class A> + std::size_t hash_value(std::map<K, T, C, A> const& v); + template <class K, class T, class C, class A> + std::size_t hash_value(std::multimap<K, T, C, A> const& v); + + template <class T> + std::size_t hash_value(std::complex<T> const&); + + template <class A, class B> + std::size_t hash_value(std::pair<A, B> const& v) + { + std::size_t seed = 0; + hash_combine(seed, v.first); + hash_combine(seed, v.second); + return seed; + } + + template <class T, class A> + std::size_t hash_value(std::vector<T, A> const& v) + { + return hash_range(v.begin(), v.end()); + } + + template <class T, class A> + std::size_t hash_value(std::list<T, A> const& v) + { + return hash_range(v.begin(), v.end()); + } + + template <class T, class A> + std::size_t hash_value(std::deque<T, A> const& v) + { + return hash_range(v.begin(), v.end()); + } + + template <class K, class C, class A> + std::size_t hash_value(std::set<K, C, A> const& v) + { + return hash_range(v.begin(), v.end()); + } + + template <class K, class C, class A> + std::size_t hash_value(std::multiset<K, C, A> const& v) + { + return hash_range(v.begin(), v.end()); + } + + template <class K, class T, class C, class A> + std::size_t hash_value(std::map<K, T, C, A> const& v) + { + return hash_range(v.begin(), v.end()); + } + + template <class K, class T, class C, class A> + std::size_t hash_value(std::multimap<K, T, C, A> const& v) + { + return hash_range(v.begin(), v.end()); + } + + template <class T> + std::size_t hash_value(std::complex<T> const& v) + { + boost::hash<T> hasher; + std::size_t seed = hasher(v.imag()); + seed ^= hasher(v.real()) + (seed<<6) + (seed>>2); + return seed; + } + + // + // call_hash_impl + // + + // On compilers without function template ordering, this deals with arrays. #if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) namespace hash_detail @@ -61,6 +160,11 @@ namespace boost } #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING + // + // boost::hash + // + + #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template <class T> struct hash @@ -94,7 +198,7 @@ namespace boost // On compilers without partial specialization, boost::hash<T> // has already been declared to deal with pointers, so just - // need to supply the non-pointer version. + // need to supply the non-pointer version of hash_impl. namespace hash_detail { @@ -126,8 +230,8 @@ namespace boost #else // Visual C++ 6.5 - // There's probably a more elegant way to Visual C++ 6.5 to work - // but I don't know what it is. + // Visual C++ 6.5 has problems with nested member functions and + // applying const to const types in templates. So we get this: template <bool IsConst> struct hash_impl_msvc diff --git a/3rdParty/Boost/src/boost/functional/hash/hash.hpp b/3rdParty/Boost/src/boost/functional/hash/hash.hpp index 67284fc..1f33b9e 100644 --- a/3rdParty/Boost/src/boost/functional/hash/hash.hpp +++ b/3rdParty/Boost/src/boost/functional/hash/hash.hpp @@ -13,19 +13,18 @@ #include <boost/functional/hash/hash_fwd.hpp> #include <functional> #include <boost/functional/hash/detail/hash_float.hpp> -#include <boost/detail/container_fwd.hpp> #include <string> +#include <boost/limits.hpp> #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) #include <boost/type_traits/is_pointer.hpp> #endif -#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) -#include <boost/type_traits/is_array.hpp> -#endif - -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -#include <boost/type_traits/is_const.hpp> +#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 namespace boost @@ -69,27 +68,8 @@ namespace boost std::size_t hash_value(long double v); template <class Ch, class A> - std::size_t hash_value(std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&); - - template <class A, class B> - std::size_t hash_value(std::pair<A, B> const&); - template <class T, class A> - std::size_t hash_value(std::vector<T, A> const&); - template <class T, class A> - std::size_t hash_value(std::list<T, A> const& v); - template <class T, class A> - std::size_t hash_value(std::deque<T, A> const& v); - template <class K, class C, class A> - std::size_t hash_value(std::set<K, C, A> const& v); - template <class K, class C, class A> - std::size_t hash_value(std::multiset<K, C, A> const& v); - template <class K, class T, class C, class A> - std::size_t hash_value(std::map<K, T, C, A> const& v); - template <class K, class T, class C, class A> - std::size_t hash_value(std::multimap<K, T, C, A> const& v); - - template <class T> - std::size_t hash_value(std::complex<T> const&); + std::size_t hash_value( + std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&); // Implementation @@ -219,6 +199,16 @@ namespace boost return x + (x >> 3); } +#if defined(BOOST_MSVC) +#pragma warning(push) +#if BOOST_MSVC <= 1400 +#pragma warning(disable:4267) // 'argument' : conversion from 'size_t' to + // 'unsigned int', possible loss of data + // A misguided attempt to detect 64-bit + // incompatability. +#endif +#endif + #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) template <class T> inline void hash_combine(std::size_t& seed, T& v) @@ -231,6 +221,10 @@ namespace boost seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2); } +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + template <class It> inline std::size_t hash_range(It first, It last) { @@ -294,7 +288,8 @@ namespace boost #endif template <class Ch, class A> - inline std::size_t hash_value(std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const& v) + inline std::size_t hash_value( + std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const& v) { return hash_range(v.begin(), v.end()); } @@ -314,69 +309,21 @@ namespace boost return boost::hash_detail::float_hash_value(v); } - template <class A, class B> - std::size_t hash_value(std::pair<A, B> const& v) - { - std::size_t seed = 0; - hash_combine(seed, v.first); - hash_combine(seed, v.second); - return seed; - } - - template <class T, class A> - std::size_t hash_value(std::vector<T, A> const& v) - { - return hash_range(v.begin(), v.end()); - } - - template <class T, class A> - std::size_t hash_value(std::list<T, A> const& v) - { - return hash_range(v.begin(), v.end()); - } - - template <class T, class A> - std::size_t hash_value(std::deque<T, A> const& v) - { - return hash_range(v.begin(), v.end()); - } - - template <class K, class C, class A> - std::size_t hash_value(std::set<K, C, A> const& v) - { - return hash_range(v.begin(), v.end()); - } - - template <class K, class C, class A> - std::size_t hash_value(std::multiset<K, C, A> const& v) - { - return hash_range(v.begin(), v.end()); - } - - template <class K, class T, class C, class A> - std::size_t hash_value(std::map<K, T, C, A> const& v) - { - return hash_range(v.begin(), v.end()); - } - - template <class K, class T, class C, class A> - std::size_t hash_value(std::multimap<K, T, C, A> const& v) - { - return hash_range(v.begin(), v.end()); - } - - template <class T> - std::size_t hash_value(std::complex<T> const& v) - { - boost::hash<T> hasher; - std::size_t seed = hasher(v.imag()); - seed ^= hasher(v.real()) + (seed<<6) + (seed>>2); - return seed; - } - // // boost::hash // + + // Define the specializations required by the standard. The general purpose + // boost::hash is defined later in extensions.hpp if + // BOOST_HASH_NO_EXTENSIONS is not defined. + + // BOOST_HASH_SPECIALIZE - define a specialization for a type which is + // passed by copy. + // + // BOOST_HASH_SPECIALIZE_REF - define a specialization for a type which is + // passed by copy. + // + // These are undefined later. #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) #define BOOST_HASH_SPECIALIZE(type) \ @@ -461,10 +408,18 @@ namespace boost BOOST_HASH_SPECIALIZE_REF(std::wstring) #endif +#if defined(BOOST_HAS_LONG_LONG) + BOOST_HASH_SPECIALIZE(boost::long_long_type) + BOOST_HASH_SPECIALIZE(boost::ulong_long_type) +#endif + #undef BOOST_HASH_SPECIALIZE #undef BOOST_HASH_SPECIALIZE_REF +// Specializing boost::hash for pointers. + #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + template <class T> struct hash<T*> : public std::unary_function<T*, std::size_t> @@ -481,7 +436,15 @@ namespace boost #endif } }; + #else + + // For compilers without partial specialization, we define a + // boost::hash for all remaining types. But hash_impl is only defined + // for pointers in 'extensions.hpp' - so when BOOST_HASH_NO_EXTENSIONS + // is defined there will still be a compile error for types not supported + // in the standard. + namespace hash_detail { template <bool IsPointer> @@ -514,9 +477,12 @@ namespace boost ::BOOST_NESTED_TEMPLATE inner<T> { }; + #endif } +#undef BOOST_HASH_CHAR_TRAITS + #endif // BOOST_FUNCTIONAL_HASH_HASH_HPP // Include this outside of the include guards in case the file is included diff --git a/3rdParty/Boost/src/boost/integer.hpp b/3rdParty/Boost/src/boost/integer.hpp new file mode 100644 index 0000000..3393c81 --- /dev/null +++ b/3rdParty/Boost/src/boost/integer.hpp @@ -0,0 +1,253 @@ +// boost integer.hpp header file -------------------------------------------// + +// Copyright Beman Dawes and Daryle Walker 1999. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/integer for documentation. + +// Revision History +// 22 Sep 01 Added value-based integer templates. (Daryle Walker) +// 01 Apr 01 Modified to use new <boost/limits.hpp> header. (John Maddock) +// 30 Jul 00 Add typename syntax fix (Jens Maurer) +// 28 Aug 99 Initial version + +#ifndef BOOST_INTEGER_HPP +#define BOOST_INTEGER_HPP + +#include <boost/integer_fwd.hpp> // self include + +#include <boost/integer_traits.hpp> // for boost::::boost::integer_traits +#include <boost/limits.hpp> // for ::std::numeric_limits +#include <boost/cstdint.hpp> // for boost::int64_t and BOOST_NO_INTEGRAL_INT64_T + +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +// boost/integer.hpp:77:30: warning: use of C99 long long integer constant +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif + +namespace boost +{ + + // Helper templates ------------------------------------------------------// + + // fast integers from least integers + // int_fast_t<> works correctly for unsigned too, in spite of the name. + template< typename LeastInt > + struct int_fast_t + { + typedef LeastInt fast; + typedef fast type; + }; // imps may specialize + + namespace detail{ + + // convert category to type + template< int Category > struct int_least_helper {}; // default is empty + + // specializatons: 1=long, 2=int, 3=short, 4=signed char, + // 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char + // no specializations for 0 and 5: requests for a type > long are in error +#ifdef BOOST_HAS_LONG_LONG + template<> struct int_least_helper<1> { typedef boost::long_long_type least; }; +#endif + template<> struct int_least_helper<2> { typedef long least; }; + template<> struct int_least_helper<3> { typedef int least; }; + template<> struct int_least_helper<4> { typedef short least; }; + template<> struct int_least_helper<5> { typedef signed char least; }; +#ifdef BOOST_HAS_LONG_LONG + template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; }; +#endif + template<> struct int_least_helper<7> { typedef unsigned long least; }; + template<> struct int_least_helper<8> { typedef unsigned int least; }; + template<> struct int_least_helper<9> { typedef unsigned short least; }; + template<> struct int_least_helper<10> { typedef unsigned char least; }; + + template <int Bits> + struct exact_signed_base_helper{}; + template <int Bits> + struct exact_unsigned_base_helper{}; + + template <> struct exact_signed_base_helper<sizeof(signed char)* CHAR_BIT> { typedef signed char exact; }; + template <> struct exact_unsigned_base_helper<sizeof(unsigned char)* CHAR_BIT> { typedef unsigned char exact; }; +#if USHRT_MAX != UCHAR_MAX + template <> struct exact_signed_base_helper<sizeof(short)* CHAR_BIT> { typedef short exact; }; + template <> struct exact_unsigned_base_helper<sizeof(unsigned short)* CHAR_BIT> { typedef unsigned short exact; }; +#endif +#if UINT_MAX != USHRT_MAX + template <> struct exact_signed_base_helper<sizeof(int)* CHAR_BIT> { typedef int exact; }; + template <> struct exact_unsigned_base_helper<sizeof(unsigned int)* CHAR_BIT> { typedef unsigned int exact; }; +#endif +#if ULONG_MAX != UINT_MAX + template <> struct exact_signed_base_helper<sizeof(long)* CHAR_BIT> { typedef long exact; }; + template <> struct exact_unsigned_base_helper<sizeof(unsigned long)* CHAR_BIT> { typedef unsigned long exact; }; +#endif +#if defined(BOOST_HAS_LONG_LONG) &&\ + ((defined(ULLONG_MAX) && (ULLONG_MAX != ULONG_MAX)) ||\ + (defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX != ULONG_MAX)) ||\ + (defined(ULONGLONG_MAX) && (ULONGLONG_MAX != ULONG_MAX)) ||\ + (defined(_ULLONG_MAX) && (_ULLONG_MAX != ULONG_MAX))) + template <> struct exact_signed_base_helper<sizeof(boost::long_long_type)* CHAR_BIT> { typedef boost::long_long_type exact; }; + template <> struct exact_unsigned_base_helper<sizeof(boost::ulong_long_type)* CHAR_BIT> { typedef boost::ulong_long_type exact; }; +#endif + + + } // namespace detail + + // integer templates specifying number of bits ---------------------------// + + // signed + template< int Bits > // bits (including sign) required + struct int_t : public detail::exact_signed_base_helper<Bits> + { + typedef typename detail::int_least_helper + < +#ifdef BOOST_HAS_LONG_LONG + (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + +#else + 1 + +#endif + (Bits-1 <= ::std::numeric_limits<long>::digits) + + (Bits-1 <= ::std::numeric_limits<int>::digits) + + (Bits-1 <= ::std::numeric_limits<short>::digits) + + (Bits-1 <= ::std::numeric_limits<signed char>::digits) + >::least least; + typedef typename int_fast_t<least>::type fast; + }; + + // unsigned + template< int Bits > // bits required + struct uint_t : public detail::exact_unsigned_base_helper<Bits> + { +#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T) + // It's really not clear why this workaround should be needed... shrug I guess! JM + BOOST_STATIC_CONSTANT(int, s = + 6 + + (Bits <= ::std::numeric_limits<unsigned long>::digits) + + (Bits <= ::std::numeric_limits<unsigned int>::digits) + + (Bits <= ::std::numeric_limits<unsigned short>::digits) + + (Bits <= ::std::numeric_limits<unsigned char>::digits)); + typedef typename detail::int_least_helper< ::boost::uint_t<Bits>::s>::least least; +#else + typedef typename detail::int_least_helper + < + 5 + +#ifdef BOOST_HAS_LONG_LONG + (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + +#else + 1 + +#endif + (Bits <= ::std::numeric_limits<unsigned long>::digits) + + (Bits <= ::std::numeric_limits<unsigned int>::digits) + + (Bits <= ::std::numeric_limits<unsigned short>::digits) + + (Bits <= ::std::numeric_limits<unsigned char>::digits) + >::least least; +#endif + typedef typename int_fast_t<least>::type fast; + // int_fast_t<> works correctly for unsigned too, in spite of the name. + }; + + // integer templates specifying extreme value ----------------------------// + + // signed +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::long_long_type MaxValue > // maximum value to require support +#else + template< long MaxValue > // maximum value to require support +#endif + struct int_max_value_t + { + typedef typename detail::int_least_helper + < +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + (MaxValue <= ::boost::integer_traits<boost::long_long_type>::const_max) + +#else + 1 + +#endif + (MaxValue <= ::boost::integer_traits<long>::const_max) + + (MaxValue <= ::boost::integer_traits<int>::const_max) + + (MaxValue <= ::boost::integer_traits<short>::const_max) + + (MaxValue <= ::boost::integer_traits<signed char>::const_max) + >::least least; + typedef typename int_fast_t<least>::type fast; + }; + +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::long_long_type MinValue > // minimum value to require support +#else + template< long MinValue > // minimum value to require support +#endif + struct int_min_value_t + { + typedef typename detail::int_least_helper + < +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + (MinValue >= ::boost::integer_traits<boost::long_long_type>::const_min) + +#else + 1 + +#endif + (MinValue >= ::boost::integer_traits<long>::const_min) + + (MinValue >= ::boost::integer_traits<int>::const_min) + + (MinValue >= ::boost::integer_traits<short>::const_min) + + (MinValue >= ::boost::integer_traits<signed char>::const_min) + >::least least; + typedef typename int_fast_t<least>::type fast; + }; + + // unsigned +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::ulong_long_type MaxValue > // minimum value to require support +#else + template< unsigned long MaxValue > // minimum value to require support +#endif + struct uint_value_t + { +#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) + // It's really not clear why this workaround should be needed... shrug I guess! JM +#if defined(BOOST_NO_INTEGRAL_INT64_T) + BOOST_STATIC_CONSTANT(unsigned, which = + 6 + + (MaxValue <= ::boost::integer_traits<unsigned long>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned int>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned short>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned char>::const_max)); + typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least; +#else // BOOST_NO_INTEGRAL_INT64_T + BOOST_STATIC_CONSTANT(unsigned, which = + 5 + + (MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned long>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned int>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned short>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned char>::const_max)); + typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least; +#endif // BOOST_NO_INTEGRAL_INT64_T +#else + typedef typename detail::int_least_helper + < + 5 + +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + (MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) + +#else + 1 + +#endif + (MaxValue <= ::boost::integer_traits<unsigned long>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned int>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned short>::const_max) + + (MaxValue <= ::boost::integer_traits<unsigned char>::const_max) + >::least least; +#endif + typedef typename int_fast_t<least>::type fast; + }; + + +} // namespace boost + +#endif // BOOST_INTEGER_HPP diff --git a/3rdParty/Boost/src/boost/integer/static_log2.hpp b/3rdParty/Boost/src/boost/integer/static_log2.hpp index 19e048b..56c7a00 100644 --- a/3rdParty/Boost/src/boost/integer/static_log2.hpp +++ b/3rdParty/Boost/src/boost/integer/static_log2.hpp @@ -16,7 +16,7 @@ #ifndef BOOST_INTEGER_STATIC_LOG2_HPP #define BOOST_INTEGER_STATIC_LOG2_HPP -#include "boost/config.hpp" // for BOOST_STATIC_CONSTANT +#include "boost/integer_fwd.hpp" // for boost::intmax_t namespace boost { @@ -41,14 +41,13 @@ namespace boost { // terminates with x = 1 and n = 0 (see the algorithm's // invariant). - typedef unsigned long argument_type; - typedef int result_type; - + typedef boost::static_log2_argument_type argument_type; + typedef boost::static_log2_result_type result_type; template <result_type n> struct choose_initial_n { - enum { c = (argument_type(1) << n << n) != 0 }; + BOOST_STATIC_CONSTANT(bool, c = (argument_type(1) << n << n) != 0); BOOST_STATIC_CONSTANT( result_type, value = !c*n + choose_initial_n<2*c*n>::value @@ -85,7 +84,7 @@ namespace boost { template <argument_type x, result_type n = initial_n> struct static_log2_impl { - enum { c = (x >> n) > 0 }; // x >= 2**n ? + BOOST_STATIC_CONSTANT(bool, c = (x >> n) > 0); // x >= 2**n ? BOOST_STATIC_CONSTANT( result_type, value = c*n + (static_log2_impl< (x>>c*n), n/2 >::value) @@ -107,10 +106,6 @@ namespace boost { // static_log2<x> // ---------------------------------------- - typedef detail::static_log2_impl::argument_type static_log2_argument_type; - typedef detail::static_log2_impl::result_type static_log2_result_type; - - template <static_log2_argument_type x> struct static_log2 { diff --git a/3rdParty/Boost/src/boost/integer_fwd.hpp b/3rdParty/Boost/src/boost/integer_fwd.hpp new file mode 100644 index 0000000..01b0a08 --- /dev/null +++ b/3rdParty/Boost/src/boost/integer_fwd.hpp @@ -0,0 +1,174 @@ +// Boost integer_fwd.hpp header file ---------------------------------------// + +// (C) Copyright Dave Abrahams and Daryle Walker 2001. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/integer for documentation. + +#ifndef BOOST_INTEGER_FWD_HPP +#define BOOST_INTEGER_FWD_HPP + +#include <climits> // for UCHAR_MAX, etc. +#include <cstddef> // for std::size_t + +#include <boost/config.hpp> // for BOOST_NO_INTRINSIC_WCHAR_T +#include <boost/limits.hpp> // for std::numeric_limits +#include <boost/cstdint.hpp> // For intmax_t + + +namespace boost +{ + +#ifdef BOOST_NO_INTEGRAL_INT64_T + typedef unsigned long static_log2_argument_type; + typedef int static_log2_result_type; + typedef long static_min_max_signed_type; + typedef unsigned long static_min_max_unsigned_type; +#else + typedef boost::uintmax_t static_min_max_unsigned_type; + typedef boost::intmax_t static_min_max_signed_type; + typedef boost::uintmax_t static_log2_argument_type; + typedef int static_log2_result_type; +#endif + +// From <boost/cstdint.hpp> ------------------------------------------------// + +// Only has typedefs or using statements, with #conditionals + + +// From <boost/integer_traits.hpp> -----------------------------------------// + +template < class T > + class integer_traits; + +template < > + class integer_traits< bool >; + +template < > + class integer_traits< char >; + +template < > + class integer_traits< signed char >; + +template < > + class integer_traits< unsigned char >; + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +template < > + class integer_traits< wchar_t >; +#endif + +template < > + class integer_traits< short >; + +template < > + class integer_traits< unsigned short >; + +template < > + class integer_traits< int >; + +template < > + class integer_traits< unsigned int >; + +template < > + class integer_traits< long >; + +template < > + class integer_traits< unsigned long >; + +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && (defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64)) +template < > + class integer_traits< ::boost::long_long_type>; + +template < > + class integer_traits< ::boost::ulong_long_type >; +#endif + + +// From <boost/integer.hpp> ------------------------------------------------// + +template < typename LeastInt > + struct int_fast_t; + +template< int Bits > + struct int_t; + +template< int Bits > + struct uint_t; + +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::long_long_type MaxValue > // maximum value to require support +#else + template< long MaxValue > // maximum value to require support +#endif + struct int_max_value_t; + +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::long_long_type MinValue > // minimum value to require support +#else + template< long MinValue > // minimum value to require support +#endif + struct int_min_value_t; + +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::ulong_long_type MaxValue > // maximum value to require support +#else + template< unsigned long MaxValue > // maximum value to require support +#endif + struct uint_value_t; + + +// From <boost/integer/integer_mask.hpp> -----------------------------------// + +template < std::size_t Bit > + struct high_bit_mask_t; + +template < std::size_t Bits > + struct low_bits_mask_t; + +template < > + struct low_bits_mask_t< ::std::numeric_limits<unsigned char>::digits >; + +#if USHRT_MAX > UCHAR_MAX +template < > + struct low_bits_mask_t< ::std::numeric_limits<unsigned short>::digits >; +#endif + +#if UINT_MAX > USHRT_MAX +template < > + struct low_bits_mask_t< ::std::numeric_limits<unsigned int>::digits >; +#endif + +#if ULONG_MAX > UINT_MAX +template < > + struct low_bits_mask_t< ::std::numeric_limits<unsigned long>::digits >; +#endif + + +// From <boost/integer/static_log2.hpp> ------------------------------------// + +template <static_log2_argument_type Value > + struct static_log2; + +template <> struct static_log2<0u>; + + +// From <boost/integer/static_min_max.hpp> ---------------------------------// + +template <static_min_max_signed_type Value1, static_min_max_signed_type Value2> + struct static_signed_min; + +template <static_min_max_signed_type Value1, static_min_max_signed_type Value2> + struct static_signed_max; + +template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2> + struct static_unsigned_min; + +template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2> + struct static_unsigned_max; + +} // namespace boost + + +#endif // BOOST_INTEGER_FWD_HPP diff --git a/3rdParty/Boost/src/boost/integer_traits.hpp b/3rdParty/Boost/src/boost/integer_traits.hpp index ac4ef32..129ce82 100644 --- a/3rdParty/Boost/src/boost/integer_traits.hpp +++ b/3rdParty/Boost/src/boost/integer_traits.hpp @@ -5,7 +5,7 @@ * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * - * $Id: integer_traits.hpp 32576 2006-02-05 10:19:42Z johnmaddock $ + * $Id: integer_traits.hpp 58381 2009-12-14 18:14:48Z johnmaddock $ * * Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers */ @@ -27,6 +27,17 @@ #include <wchar.h> #endif +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +// ../../../boost/integer_traits.hpp:164:66: warning: use of C99 long long integer constant +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif namespace boost { template<class T> @@ -225,6 +236,20 @@ class integer_traits< ::boost::ulong_long_type> public detail::integer_traits_base< ::boost::ulong_long_type, 0, ~0uLL> { }; +#elif defined(BOOST_HAS_MS_INT64) + +template<> +class integer_traits< __int64> + : public std::numeric_limits< __int64>, + public detail::integer_traits_base< __int64, _I64_MIN, _I64_MAX> +{ }; + +template<> +class integer_traits< unsigned __int64> + : public std::numeric_limits< unsigned __int64>, + public detail::integer_traits_base< unsigned __int64, 0, _UI64_MAX> +{ }; + #endif #endif diff --git a/3rdParty/Boost/src/boost/io/ios_state.hpp b/3rdParty/Boost/src/boost/io/ios_state.hpp index 9c45c0b..07cfb34 100644 --- a/3rdParty/Boost/src/boost/io/ios_state.hpp +++ b/3rdParty/Boost/src/boost/io/ios_state.hpp @@ -128,6 +128,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_iostate_saver& operator=(const basic_ios_iostate_saver&); }; template < typename Ch, class Tr > @@ -156,6 +157,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_exception_saver& operator=(const basic_ios_exception_saver&); }; template < typename Ch, class Tr > @@ -180,6 +182,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_tie_saver& operator=(const basic_ios_tie_saver&); }; template < typename Ch, class Tr > @@ -204,6 +207,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_rdbuf_saver& operator=(const basic_ios_rdbuf_saver&); }; template < typename Ch, class Tr > @@ -228,6 +232,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_fill_saver& operator=(const basic_ios_fill_saver&); }; #ifndef BOOST_NO_STD_LOCALE @@ -253,6 +258,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_locale_saver& operator=(const basic_ios_locale_saver&); }; #endif @@ -392,6 +398,8 @@ private: #ifndef BOOST_NO_STD_LOCALE ::std::locale const a9_save_; #endif + + basic_ios_all_saver& operator=(const basic_ios_all_saver&); }; class ios_all_word_saver diff --git a/3rdParty/Boost/src/boost/lexical_cast.hpp b/3rdParty/Boost/src/boost/lexical_cast.hpp index 0da0d3d..d7d9052 100644 --- a/3rdParty/Boost/src/boost/lexical_cast.hpp +++ b/3rdParty/Boost/src/boost/lexical_cast.hpp @@ -41,12 +41,17 @@ #include <sstream> #endif -#if defined(BOOST_NO_STRINGSTREAM) || \ - defined(BOOST_NO_STD_WSTRING) || \ - defined(BOOST_NO_STD_LOCALE) +#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_WSTRING) #define BOOST_LCAST_NO_WCHAR_T #endif +#ifdef BOOST_NO_TYPEID +#define BOOST_LCAST_THROW_BAD_CAST(S, T) throw_exception(bad_lexical_cast()) +#else +#define BOOST_LCAST_THROW_BAD_CAST(Source, Target) \ + throw_exception(bad_lexical_cast(typeid(Source), typeid(Target))) +#endif + namespace boost { // exception used to indicate runtime lexical_cast failure @@ -577,7 +582,7 @@ namespace boost lexical_stream(char_type* = 0, char_type* = 0) { stream.unsetf(std::ios::skipws); - lcast_set_precision(stream, (Source*)0, (Target*)0); + lcast_set_precision(stream, static_cast<Source*>(0), static_cast<Target*>(0) ); } ~lexical_stream() { @@ -694,7 +699,7 @@ namespace boost { this->setp(start, finish); std::basic_ostream<CharT> stream(static_cast<Base*>(this)); - lcast_set_precision(stream, (OutputStreamable*)0); + lcast_set_precision(stream, static_cast<OutputStreamable*>(0)); bool const result = !(stream << input).fail(); finish = this->pptr(); return result; @@ -764,7 +769,7 @@ namespace boost this->setg(start, start, finish); std::basic_istream<CharT> stream(static_cast<Base*>(this)); stream.unsetf(std::ios::skipws); - lcast_set_precision(stream, (InputStreamable*)0); + lcast_set_precision(stream, static_cast<InputStreamable*>(0)); #if (defined _MSC_VER) # pragma warning( pop ) #endif @@ -1111,6 +1116,12 @@ namespace boost typedef const T * type; }; +#if (defined _MSC_VER) +# pragma warning( push ) +# pragma warning( disable : 4701 ) // possible use of ... before initialization +# pragma warning( disable : 4702 ) // unreachable code +#endif + template< typename Target , typename Source , bool Unlimited // string representation of Source is unlimited @@ -1136,28 +1147,14 @@ namespace boost , detail::lexical_stream_limited_src<CharT,base,traits> >::type interpreter(buf, buf + src_len); - // The original form, reproduced below, is more elegant - // but yields a spurious C4701 warning ("possible use of - // "result" before initialization") with VC7.1 (/W4). -// -// Target result; -// -// if(!(interpreter << arg && interpreter >> result)) -// throw_exception(bad_lexical_cast(typeid(Source), typeid(Target))); -// return result; - - if(interpreter << arg) { - Target result; - if (interpreter >> result) - return result; - } -#ifndef BOOST_NO_TYPEID - throw_exception(bad_lexical_cast(typeid(Source), typeid(Target))); -#else - throw_exception(bad_lexical_cast()); -#endif - return Target(); // normally never reached (throw_exception) + Target result; + if(!(interpreter << arg && interpreter >> result)) + BOOST_LCAST_THROW_BAD_CAST(Source, Target); + return result; } +#if (defined _MSC_VER) +# pragma warning( pop ) +#endif } template<typename Target, typename Source> diff --git a/3rdParty/Boost/src/boost/memory_order.hpp b/3rdParty/Boost/src/boost/memory_order.hpp index 2524e8a..4945af6 100644 --- a/3rdParty/Boost/src/boost/memory_order.hpp +++ b/3rdParty/Boost/src/boost/memory_order.hpp @@ -11,7 +11,7 @@ // // Defines enum boost::memory_order per the C++0x working draft // -// Copyright (c) 2008 Peter Dimov +// Copyright (c) 2008, 2009 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at @@ -21,13 +21,31 @@ namespace boost { +// +// Enum values are chosen so that code that needs to insert +// a trailing fence for acquire semantics can use a single +// test such as: +// +// if( mo & memory_order_acquire ) { ...fence... } +// +// For leading fences one can use: +// +// if( mo & memory_order_release ) { ...fence... } +// +// Architectures such as Alpha that need a fence on consume +// can use: +// +// if( mo & ( memory_order_acquire | memory_order_consume ) ) { ...fence... } +// + enum memory_order { memory_order_relaxed = 0, memory_order_acquire = 1, memory_order_release = 2, memory_order_acq_rel = 3, // acquire | release - memory_order_seq_cst = 7 // acq_rel | 4 + memory_order_seq_cst = 7, // acq_rel | 4 + memory_order_consume = 8 }; } // namespace boost diff --git a/3rdParty/Boost/src/boost/mpl/aux_/config/compiler.hpp b/3rdParty/Boost/src/boost/mpl/aux_/config/compiler.hpp index 01ff8b8..3238963 100644 --- a/3rdParty/Boost/src/boost/mpl/aux_/config/compiler.hpp +++ b/3rdParty/Boost/src/boost/mpl/aux_/config/compiler.hpp @@ -10,9 +10,9 @@ // // See http://www.boost.org/libs/mpl for documentation. -// $Id: compiler.hpp 49272 2008-10-11 06:50:46Z agurtovoy $ -// $Date: 2008-10-11 02:50:46 -0400 (Sat, 11 Oct 2008) $ -// $Revision: 49272 $ +// $Id: compiler.hpp 53189 2009-05-22 20:07:55Z hkaiser $ +// $Date: 2009-05-22 16:07:55 -0400 (Fri, 22 May 2009) $ +// $Revision: 53189 $ #if !defined(BOOST_MPL_CFG_COMPILER_DIR) @@ -35,7 +35,7 @@ # elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) # if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES) # define BOOST_MPL_CFG_COMPILER_DIR bcc551 -# elseif BOOST_WORKAROUND(__BORLANDC__, >= 0x590) +# elif BOOST_WORKAROUND(__BORLANDC__, >= 0x590) # define BOOST_MPL_CFG_COMPILER_DIR bcc # else # define BOOST_MPL_CFG_COMPILER_DIR bcc_pre590 diff --git a/3rdParty/Boost/src/boost/mpl/for_each.hpp b/3rdParty/Boost/src/boost/mpl/for_each.hpp index 668ec6a..89abc85 100644 --- a/3rdParty/Boost/src/boost/mpl/for_each.hpp +++ b/3rdParty/Boost/src/boost/mpl/for_each.hpp @@ -10,9 +10,9 @@ // // See http://www.boost.org/libs/mpl for documentation. -// $Id: for_each.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ -// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ -// $Revision: 49267 $ +// $Id: for_each.hpp 55648 2009-08-18 05:16:53Z agurtovoy $ +// $Date: 2009-08-18 01:16:53 -0400 (Tue, 18 Aug 2009) $ +// $Revision: 55648 $ #include <boost/mpl/is_sequence.hpp> #include <boost/mpl/begin_end.hpp> @@ -76,7 +76,7 @@ struct for_each_impl<false> typedef typename mpl::next<Iterator>::type iter; for_each_impl<boost::is_same<iter,LastIterator>::value> - ::execute((iter*)0, (LastIterator*)0, (TransformFunc*)0, f); + ::execute( static_cast<iter*>(0), static_cast<LastIterator*>(0), static_cast<TransformFunc*>(0), f); } }; @@ -98,7 +98,7 @@ void for_each(F f, Sequence* = 0, TransformOp* = 0) typedef typename end<Sequence>::type last; aux::for_each_impl< boost::is_same<first,last>::value > - ::execute((first*)0, (last*)0, (TransformOp*)0, f); + ::execute(static_cast<first*>(0), static_cast<last*>(0), static_cast<TransformOp*>(0), f); } template< diff --git a/3rdParty/Boost/src/boost/operators.hpp b/3rdParty/Boost/src/boost/operators.hpp index b3b1bd7..4b47ba4 100644 --- a/3rdParty/Boost/src/boost/operators.hpp +++ b/3rdParty/Boost/src/boost/operators.hpp @@ -8,6 +8,9 @@ // See http://www.boost.org/libs/utility/operators.htm for documentation. // Revision History +// 07 Aug 08 Added "euclidean" spelling. (Daniel Frey) +// 03 Apr 08 Make sure "convertible to bool" is sufficient +// for T::operator<, etc. (Daniel Frey) // 24 May 07 Changed empty_base to depend on T, see // http://svn.boost.org/trac/boost/ticket/979 // 21 Oct 02 Modified implementation of operators to allow compilers with a @@ -124,34 +127,34 @@ namespace boost template <class T, class U, class B = ::boost::detail::empty_base<T> > struct less_than_comparable2 : B { - friend bool operator<=(const T& x, const U& y) { return !(x > y); } - friend bool operator>=(const T& x, const U& y) { return !(x < y); } + friend bool operator<=(const T& x, const U& y) { return !static_cast<bool>(x > y); } + friend bool operator>=(const T& x, const U& y) { return !static_cast<bool>(x < y); } friend bool operator>(const U& x, const T& y) { return y < x; } friend bool operator<(const U& x, const T& y) { return y > x; } - friend bool operator<=(const U& x, const T& y) { return !(y < x); } - friend bool operator>=(const U& x, const T& y) { return !(y > x); } + friend bool operator<=(const U& x, const T& y) { return !static_cast<bool>(y < x); } + friend bool operator>=(const U& x, const T& y) { return !static_cast<bool>(y > x); } }; template <class T, class B = ::boost::detail::empty_base<T> > struct less_than_comparable1 : B { friend bool operator>(const T& x, const T& y) { return y < x; } - friend bool operator<=(const T& x, const T& y) { return !(y < x); } - friend bool operator>=(const T& x, const T& y) { return !(x < y); } + friend bool operator<=(const T& x, const T& y) { return !static_cast<bool>(y < x); } + friend bool operator>=(const T& x, const T& y) { return !static_cast<bool>(x < y); } }; template <class T, class U, class B = ::boost::detail::empty_base<T> > struct equality_comparable2 : B { friend bool operator==(const U& y, const T& x) { return x == y; } - friend bool operator!=(const U& y, const T& x) { return !(x == y); } - friend bool operator!=(const T& y, const U& x) { return !(y == x); } + friend bool operator!=(const U& y, const T& x) { return !static_cast<bool>(x == y); } + friend bool operator!=(const T& y, const U& x) { return !static_cast<bool>(y == x); } }; template <class T, class B = ::boost::detail::empty_base<T> > struct equality_comparable1 : B { - friend bool operator!=(const T& x, const T& y) { return !(x == y); } + friend bool operator!=(const T& x, const T& y) { return !static_cast<bool>(x == y); } }; // A macro which produces "name_2left" from "name". @@ -356,7 +359,7 @@ struct equivalent2 : B { friend bool operator==(const T& x, const U& y) { - return !(x < y) && !(x > y); + return !static_cast<bool>(x < y) && !static_cast<bool>(x > y); } }; @@ -365,7 +368,7 @@ struct equivalent1 : B { friend bool operator==(const T&x, const T&y) { - return !(x < y) && !(y < x); + return !static_cast<bool>(x < y) && !static_cast<bool>(y < x); } }; @@ -373,17 +376,17 @@ template <class T, class U, class B = ::boost::detail::empty_base<T> > struct partially_ordered2 : B { friend bool operator<=(const T& x, const U& y) - { return (x < y) || (x == y); } + { return static_cast<bool>(x < y) || static_cast<bool>(x == y); } friend bool operator>=(const T& x, const U& y) - { return (x > y) || (x == y); } + { return static_cast<bool>(x > y) || static_cast<bool>(x == y); } friend bool operator>(const U& x, const T& y) { return y < x; } friend bool operator<(const U& x, const T& y) { return y > x; } friend bool operator<=(const U& x, const T& y) - { return (y > x) || (y == x); } + { return static_cast<bool>(y > x) || static_cast<bool>(y == x); } friend bool operator>=(const U& x, const T& y) - { return (y < x) || (y == x); } + { return static_cast<bool>(y < x) || static_cast<bool>(y == x); } }; template <class T, class B = ::boost::detail::empty_base<T> > @@ -392,9 +395,9 @@ struct partially_ordered1 : B friend bool operator>(const T& x, const T& y) { return y < x; } friend bool operator<=(const T& x, const T& y) - { return (x < y) || (x == y); } + { return static_cast<bool>(x < y) || static_cast<bool>(x == y); } friend bool operator>=(const T& x, const T& y) - { return (y < x) || (x == y); } + { return static_cast<bool>(y < x) || static_cast<bool>(x == y); } }; // Combined operator classes (contributed by Daryle Walker) ----------------// @@ -580,7 +583,35 @@ struct ordered_euclidian_ring_operators1 : totally_ordered1<T , euclidian_ring_operators1<T, B > > {}; - + +template <class T, class U, class B = ::boost::detail::empty_base<T> > +struct euclidean_ring_operators2 + : ring_operators2<T, U + , dividable2<T, U + , dividable2_left<T, U + , modable2<T, U + , modable2_left<T, U, B + > > > > > {}; + +template <class T, class B = ::boost::detail::empty_base<T> > +struct euclidean_ring_operators1 + : ring_operators1<T + , dividable1<T + , modable1<T, B + > > > {}; + +template <class T, class U, class B = ::boost::detail::empty_base<T> > +struct ordered_euclidean_ring_operators2 + : totally_ordered2<T, U + , euclidean_ring_operators2<T, U, B + > > {}; + +template <class T, class B = ::boost::detail::empty_base<T> > +struct ordered_euclidean_ring_operators1 + : totally_ordered1<T + , euclidean_ring_operators1<T, B + > > {}; + template <class T, class P, class B = ::boost::detail::empty_base<T> > struct input_iteratable : equality_comparable1<T @@ -837,6 +868,8 @@ BOOST_OPERATOR_TEMPLATE(field_operators) BOOST_OPERATOR_TEMPLATE(ordered_field_operators) BOOST_OPERATOR_TEMPLATE(euclidian_ring_operators) BOOST_OPERATOR_TEMPLATE(ordered_euclidian_ring_operators) +BOOST_OPERATOR_TEMPLATE(euclidean_ring_operators) +BOOST_OPERATOR_TEMPLATE(ordered_euclidean_ring_operators) BOOST_OPERATOR_TEMPLATE2(input_iteratable) BOOST_OPERATOR_TEMPLATE1(output_iteratable) BOOST_OPERATOR_TEMPLATE2(forward_iteratable) diff --git a/3rdParty/Boost/src/boost/ref.hpp b/3rdParty/Boost/src/boost/ref.hpp index 0d747bd..6058d69 100644 --- a/3rdParty/Boost/src/boost/ref.hpp +++ b/3rdParty/Boost/src/boost/ref.hpp @@ -173,6 +173,12 @@ class unwrap_reference # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template <class T> inline typename unwrap_reference<T>::type& +unwrap_ref(T& t) +{ + return t; +} + template<class T> inline T* get_pointer( reference_wrapper<T> const & r ) { return r.get_pointer(); diff --git a/3rdParty/Boost/src/boost/regex/config.hpp b/3rdParty/Boost/src/boost/regex/config.hpp index 8c8f524..e4b2138 100644 --- a/3rdParty/Boost/src/boost/regex/config.hpp +++ b/3rdParty/Boost/src/boost/regex/config.hpp @@ -92,6 +92,12 @@ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define BOOST_REGEX_NO_EXTERNAL_TEMPLATES #endif +/* + * Shared regex lib will crash without this, frankly it looks a lot like a gcc bug: + */ +#if defined(__MINGW32__) +# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES +#endif /* * If there isn't good enough wide character support then there will @@ -164,7 +170,7 @@ # pragma warning(push) # pragma warning(disable : 4251 4231 4660) # endif -# ifdef _DLL +# if defined(_DLL) && defined(BOOST_MSVC) && (BOOST_MSVC < 1600) # include <string> extern template class __declspec(dllimport) std::basic_string<unsigned short>; # endif diff --git a/3rdParty/Boost/src/boost/regex/icu.hpp b/3rdParty/Boost/src/boost/regex/icu.hpp index 7af1d67..c8770c6 100644 --- a/3rdParty/Boost/src/boost/regex/icu.hpp +++ b/3rdParty/Boost/src/boost/regex/icu.hpp @@ -184,7 +184,9 @@ private: offset_underscore = U_CHAR_CATEGORY_COUNT+3, offset_unicode = U_CHAR_CATEGORY_COUNT+4, offset_any = U_CHAR_CATEGORY_COUNT+5, - offset_ascii = U_CHAR_CATEGORY_COUNT+6 + offset_ascii = U_CHAR_CATEGORY_COUNT+6, + offset_horizontal = U_CHAR_CATEGORY_COUNT+7, + offset_vertical = U_CHAR_CATEGORY_COUNT+8 }; // @@ -197,6 +199,8 @@ private: static const char_class_type mask_unicode; static const char_class_type mask_any; static const char_class_type mask_ascii; + static const char_class_type mask_horizontal; + static const char_class_type mask_vertical; static char_class_type lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2); @@ -311,12 +315,12 @@ inline u32regex do_make_u32regex(InputIterator i, boost::regex_constants::syntax_option_type opt, const boost::mpl::int_<4>*) { - typedef std::vector<UCHAR32> vector_type; + typedef std::vector<UChar32> vector_type; vector_type v; while(i != j) { - v.push_back((UCHAR32)(*i)); - ++a; + v.push_back((UChar32)(*i)); + ++i; } if(v.size()) return u32regex(&*v.begin(), v.size(), opt); @@ -372,7 +376,7 @@ inline u32regex make_u32regex(const std::basic_string<C, T, A>& s, boost::regex_ // // Construction from ICU string type: // -inline u32regex make_u32regex(const UnicodeString& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) +inline u32regex make_u32regex(const U_NAMESPACE_QUALIFIER UnicodeString& s, boost::regex_constants::syntax_option_type opt = boost::regex_constants::perl) { return re_detail::do_make_u32regex(s.getBuffer(), s.getBuffer() + s.length(), opt, static_cast<boost::mpl::int_<2> const*>(0)); } @@ -494,7 +498,7 @@ inline bool u32regex_match(const std::wstring& s, return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0)); } #endif -inline bool u32regex_match(const UnicodeString& s, +inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, match_results<const UChar*>& m, const u32regex& e, match_flag_type flags = match_default) @@ -558,7 +562,7 @@ inline bool u32regex_match(const std::wstring& s, return re_detail::do_regex_match(s.begin(), s.end(), m, e, flags, static_cast<mpl::int_<sizeof(wchar_t)> const*>(0)); } #endif -inline bool u32regex_match(const UnicodeString& s, +inline bool u32regex_match(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, match_flag_type flags = match_default) { @@ -679,7 +683,7 @@ inline bool u32regex_search(const std::wstring& s, return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0)); } #endif -inline bool u32regex_search(const UnicodeString& s, +inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, match_results<const UChar*>& m, const u32regex& e, match_flag_type flags = match_default) @@ -740,7 +744,7 @@ inline bool u32regex_search(const std::wstring& s, return re_detail::do_regex_search(s.begin(), s.end(), m, e, flags, s.begin(), static_cast<mpl::int_<sizeof(wchar_t)> const*>(0)); } #endif -inline bool u32regex_search(const UnicodeString& s, +inline bool u32regex_search(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, match_flag_type flags = match_default) { @@ -917,7 +921,7 @@ inline OutputIterator u32regex_replace(OutputIterator out, Iterator first, Iterator last, const u32regex& e, - const UnicodeString& fmt, + const U_NAMESPACE_QUALIFIER UnicodeString& fmt, match_flag_type flags = match_default) { return re_detail::extract_output_base @@ -962,9 +966,9 @@ namespace re_detail{ class unicode_string_out_iterator { - UnicodeString* out; + U_NAMESPACE_QUALIFIER UnicodeString* out; public: - unicode_string_out_iterator(UnicodeString& s) : out(&s) {} + unicode_string_out_iterator(U_NAMESPACE_QUALIFIER UnicodeString& s) : out(&s) {} unicode_string_out_iterator& operator++() { return *this; } unicode_string_out_iterator& operator++(int) { return *this; } unicode_string_out_iterator& operator*() { return *this; } @@ -982,23 +986,23 @@ public: } -inline UnicodeString u32regex_replace(const UnicodeString& s, +inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, const UChar* fmt, match_flag_type flags = match_default) { - UnicodeString result; + U_NAMESPACE_QUALIFIER UnicodeString result; re_detail::unicode_string_out_iterator i(result); u32regex_replace(i, s.getBuffer(), s.getBuffer()+s.length(), e, fmt, flags); return result; } -inline UnicodeString u32regex_replace(const UnicodeString& s, +inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, - const UnicodeString& fmt, + const U_NAMESPACE_QUALIFIER UnicodeString& fmt, match_flag_type flags = match_default) { - UnicodeString result; + U_NAMESPACE_QUALIFIER UnicodeString result; re_detail::unicode_string_out_iterator i(result); re_detail::do_regex_replace( re_detail::make_utf32_out(i, static_cast<mpl::int_<2> const*>(0)), diff --git a/3rdParty/Boost/src/boost/regex/pending/object_cache.hpp b/3rdParty/Boost/src/boost/regex/pending/object_cache.hpp index 2a7e00b..e1aa191 100644 --- a/3rdParty/Boost/src/boost/regex/pending/object_cache.hpp +++ b/3rdParty/Boost/src/boost/regex/pending/object_cache.hpp @@ -73,7 +73,9 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, siz // for now just throw, but we should never really get here... // ::boost::throw_exception(std::runtime_error("Error in thread safety code: could not acquire a lock")); +#ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION return boost::shared_ptr<Object>(); +#endif #else return do_get(k, max_cache_size); #endif diff --git a/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp b/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp index 218169c..334ef27 100644 --- a/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp +++ b/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp @@ -140,7 +140,7 @@ inline bool scoped_static_mutex_lock::locked()const namespace boost{ class BOOST_REGEX_DECL scoped_static_mutex_lock; -extern "C" BOOST_REGEX_DECL void free_static_mutex(); +extern "C" BOOST_REGEX_DECL void boost_regex_free_static_mutex(); class BOOST_REGEX_DECL static_mutex { diff --git a/3rdParty/Boost/src/boost/regex/v4/basic_regex.hpp b/3rdParty/Boost/src/boost/regex/v4/basic_regex.hpp index cb9ff3c..09b0467 100644 --- a/3rdParty/Boost/src/boost/regex/v4/basic_regex.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/basic_regex.hpp @@ -19,6 +19,9 @@ #ifndef BOOST_REGEX_V4_BASIC_REGEX_HPP #define BOOST_REGEX_V4_BASIC_REGEX_HPP +#include <boost/type_traits/is_same.hpp> +#include <boost/functional/hash.hpp> + #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) @@ -44,12 +47,160 @@ namespace re_detail{ template <class charT, class traits> class basic_regex_parser; +template <class I> +void bubble_down_one(I first, I last) +{ + if(first != last) + { + I next = last - 1; + while((next != first) && !(*(next-1) < *next)) + { + (next-1)->swap(*next); + --next; + } + } +} + +// +// Class named_subexpressions +// Contains information about named subexpressions within the regex. +// +template <class charT> +class named_subexpressions_base +{ +public: + virtual int get_id(const charT* i, const charT* j)const = 0; + virtual int get_id(std::size_t hash)const = 0; +#ifdef __GNUC__ + // warning supression: + virtual ~named_subexpressions_base(){} +#endif +}; + +template <class Iterator> +inline std::size_t hash_value_from_capture_name(Iterator i, Iterator j) +{ + std::size_t r = boost::hash_range(i, j); + r %= ((std::numeric_limits<int>::max)() - 10001); + r += 10000; + return r; +} + +template <class charT> +class named_subexpressions : public named_subexpressions_base<charT> +{ + struct name + { + name(const charT* i, const charT* j, int idx) + : /*n(i, j), */ index(idx) + { + hash = hash_value_from_capture_name(i, j); + } + name(std::size_t h, int idx) + : index(idx), hash(h) + { + } + //std::vector<charT> n; + int index; + std::size_t hash; + bool operator < (const name& other)const + { + return hash < other.hash; //std::lexicographical_compare(n.begin(), n.end(), other.n.begin(), other.n.end()); + } + bool operator == (const name& other)const + { + return hash == other.hash; //n == other.n; + } + void swap(name& other) + { + //n.swap(other.n); + std::swap(index, other.index); + std::swap(hash, other.hash); + } + }; +public: + named_subexpressions(){} + void set_name(const charT* i, const charT* j, int index) + { + m_sub_names.push_back(name(i, j, index)); + bubble_down_one(m_sub_names.begin(), m_sub_names.end()); + } + int get_id(const charT* i, const charT* j)const + { + name t(i, j, 0); + typename std::vector<name>::const_iterator pos = std::lower_bound(m_sub_names.begin(), m_sub_names.end(), t); + if((pos != m_sub_names.end()) && (*pos == t)) + { + return pos->index; + } + return -1; + } + int get_id(std::size_t h)const + { + name t(h, 0); + typename std::vector<name>::const_iterator pos = std::lower_bound(m_sub_names.begin(), m_sub_names.end(), t); + if((pos != m_sub_names.end()) && (*pos == t)) + { + return pos->index; + } + return -1; + } +private: + std::vector<name> m_sub_names; +}; + +template <class charT, class Other> +class named_subexpressions_converter : public named_subexpressions_base<charT> +{ + boost::shared_ptr<named_subexpressions<Other> > m_converter; +public: + named_subexpressions_converter(boost::shared_ptr<named_subexpressions<Other> > s) + : m_converter(s) {} + int get_id(const charT* i, const charT* j)const + { + if(i == j) + return -1; + std::vector<Other> v; + while(i != j) + { + v.push_back(*i); + ++i; + } + return m_converter->get_id(&v[0], &v[0] + v.size()); + } + int get_id(std::size_t h)const + { + return m_converter->get_id(h); + } +}; + +template <class To> +inline boost::shared_ptr<named_subexpressions_base<To> > convert_to_named_subs_imp( + boost::shared_ptr<named_subexpressions<To> > s, + boost::integral_constant<bool,true> const&) +{ + return s; +} +template <class To, class From> +inline boost::shared_ptr<named_subexpressions_base<To> > convert_to_named_subs_imp( + boost::shared_ptr<named_subexpressions<From> > s, + boost::integral_constant<bool,false> const&) +{ + return boost::shared_ptr<named_subexpressions_converter<To, From> >(new named_subexpressions_converter<To, From>(s)); +} +template <class To, class From> +inline boost::shared_ptr<named_subexpressions_base<To> > convert_to_named_subs( + boost::shared_ptr<named_subexpressions<From> > s) +{ + typedef typename boost::is_same<To, From>::type tag_type; + return convert_to_named_subs_imp<To>(s, tag_type()); +} // // class regex_data: // represents the data we wish to expose to the matching algorithms. // template <class charT, class traits> -struct regex_data +struct regex_data : public named_subexpressions<charT> { typedef regex_constants::syntax_option_type flag_type; typedef std::size_t size_type; @@ -77,6 +228,7 @@ struct regex_data std::vector< std::pair< std::size_t, std::size_t> > m_subs; // Position of sub-expressions within the *string*. + bool m_has_recursions; // whether we have recursive expressions; }; // // class basic_regex_implementation @@ -520,6 +672,10 @@ public: BOOST_ASSERT(0 != m_pimpl.get()); return m_pimpl->get_data(); } + boost::shared_ptr<re_detail::named_subexpressions<charT> > get_named_subs()const + { + return m_pimpl; + } private: shared_ptr<re_detail::basic_regex_implementation<charT, traits> > m_pimpl; diff --git a/3rdParty/Boost/src/boost/regex/v4/basic_regex_creator.hpp b/3rdParty/Boost/src/boost/regex/v4/basic_regex_creator.hpp index 9f2cbee..ee207d0 100644 --- a/3rdParty/Boost/src/boost/regex/v4/basic_regex_creator.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/basic_regex_creator.hpp @@ -240,6 +240,7 @@ protected: bool m_has_backrefs; // true if there are actually any backrefs unsigned m_backrefs; // bitmask of permitted backrefs boost::uintmax_t m_bad_repeats; // bitmask of repeats we can't deduce a startmap for; + bool m_has_recursions; // set when we have recursive expresisons to fixup typename traits::char_class_type m_word_mask; // mask used to determine if a character is a word character typename traits::char_class_type m_mask_space; // mask used to determine if a character is a word character typename traits::char_class_type m_lower_mask; // mask used to determine if a character is a lowercase character @@ -250,6 +251,7 @@ private: basic_regex_creator(const basic_regex_creator&); void fixup_pointers(re_syntax_base* state); + void fixup_recursions(re_syntax_base* state); void create_startmaps(re_syntax_base* state); int calculate_backstep(re_syntax_base* state); void create_startmap(re_syntax_base* state, unsigned char* l_map, unsigned int* pnull, unsigned char mask); @@ -263,7 +265,7 @@ private: template <class charT, class traits> basic_regex_creator<charT, traits>::basic_regex_creator(regex_data<charT, traits>* data) - : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_repeater_id(0), m_has_backrefs(false), m_backrefs(0) + : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_repeater_id(0), m_has_backrefs(false), m_backrefs(0), m_has_recursions(false) { m_pdata->m_data.clear(); m_pdata->m_status = ::boost::regex_constants::error_ok; @@ -675,6 +677,8 @@ re_syntax_base* basic_regex_creator<charT, traits>::append_set( template <class charT, class traits> void basic_regex_creator<charT, traits>::finalize(const charT* p1, const charT* p2) { + if(this->m_pdata->m_status) + return; // we've added all the states we need, now finish things off. // start by adding a terminating state: append_state(syntax_element_match); @@ -692,6 +696,15 @@ void basic_regex_creator<charT, traits>::finalize(const charT* p1, const charT* m_pdata->m_first_state = static_cast<re_syntax_base*>(m_pdata->m_data.data()); // fixup pointers in the machine: fixup_pointers(m_pdata->m_first_state); + if(m_has_recursions) + { + m_pdata->m_has_recursions = true; + fixup_recursions(m_pdata->m_first_state); + if(this->m_pdata->m_status) + return; + } + else + m_pdata->m_has_recursions = false; // create nested startmaps: create_startmaps(m_pdata->m_first_state); // create main startmap: @@ -713,6 +726,13 @@ void basic_regex_creator<charT, traits>::fixup_pointers(re_syntax_base* state) { switch(state->type) { + case syntax_element_recurse: + m_has_recursions = true; + if(state->next.i) + state->next.p = getaddress(state->next.i, state); + else + state->next.p = 0; + break; case syntax_element_rep: case syntax_element_dot_rep: case syntax_element_char_rep: @@ -739,6 +759,128 @@ void basic_regex_creator<charT, traits>::fixup_pointers(re_syntax_base* state) } template <class charT, class traits> +void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state) +{ + re_syntax_base* base = state; + while(state) + { + switch(state->type) + { + case syntax_element_assert_backref: + { + // just check that the index is valid: + int id = static_cast<const re_brace*>(state)->index; + if(id < 0) + { + id = -id-1; + if(id >= 10000) + { + id = m_pdata->get_id(id); + if(id <= 0) + { + // check of sub-expression that doesn't exist: + if(0 == this->m_pdata->m_status) // update the error code if not already set + this->m_pdata->m_status = boost::regex_constants::error_bad_pattern; + // + // clear the expression, we should be empty: + // + this->m_pdata->m_expression = 0; + this->m_pdata->m_expression_len = 0; + // + // and throw if required: + // + if(0 == (this->flags() & regex_constants::no_except)) + { + std::string message = "Encountered a forward reference to a marked sub-expression that does not exist."; + boost::regex_error e(message, boost::regex_constants::error_bad_pattern, 0); + e.raise(); + } + } + } + } + } + break; + case syntax_element_recurse: + { + bool ok = false; + re_syntax_base* p = base; + int id = static_cast<re_jump*>(state)->alt.i; + if(id > 10000) + id = m_pdata->get_id(id); + while(p) + { + if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == id)) + { + // + // We've found the target of the recursion, set the jump target: + // + static_cast<re_jump*>(state)->alt.p = p; + ok = true; + // + // Now scan the target for nested repeats: + // + p = p->next.p; + int next_rep_id = 0; + while(p) + { + switch(p->type) + { + case syntax_element_rep: + case syntax_element_dot_rep: + case syntax_element_char_rep: + case syntax_element_short_set_rep: + case syntax_element_long_set_rep: + next_rep_id = static_cast<re_repeat*>(p)->state_id; + break; + case syntax_element_endmark: + if(static_cast<const re_brace*>(p)->index == id) + next_rep_id = -1; + break; + default: + break; + } + if(next_rep_id) + break; + p = p->next.p; + } + if(next_rep_id > 0) + { + static_cast<re_recurse*>(state)->state_id = next_rep_id - 1; + } + + break; + } + p = p->next.p; + } + if(!ok) + { + // recursion to sub-expression that doesn't exist: + if(0 == this->m_pdata->m_status) // update the error code if not already set + this->m_pdata->m_status = boost::regex_constants::error_bad_pattern; + // + // clear the expression, we should be empty: + // + this->m_pdata->m_expression = 0; + this->m_pdata->m_expression_len = 0; + // + // and throw if required: + // + if(0 == (this->flags() & regex_constants::no_except)) + { + std::string message = "Encountered a forward reference to a recursive sub-expression that does not exist."; + boost::regex_error e(message, boost::regex_constants::error_bad_pattern, 0); + e.raise(); + } + } + } + default: + break; + } + state = state->next.p; + } +} + +template <class charT, class traits> void basic_regex_creator<charT, traits>::create_startmaps(re_syntax_base* state) { // non-recursive implementation: @@ -790,7 +932,7 @@ void basic_regex_creator<charT, traits>::create_startmaps(re_syntax_base* state) // if(0 == (this->flags() & regex_constants::no_except)) { - std::string message = this->m_pdata->m_ptraits->error_string(boost::regex_constants::error_bad_pattern); + std::string message = "Invalid lookbehind assertion encountered in the regular expression."; boost::regex_error e(message, boost::regex_constants::error_bad_pattern, 0); e.raise(); } @@ -909,6 +1051,9 @@ template <class charT, class traits> void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state, unsigned char* l_map, unsigned int* pnull, unsigned char mask) { int not_last_jump = 1; + re_syntax_base* recursion_start = 0; + int recursion_sub = 0; + re_syntax_base* recursion_restart = 0; // track case sensitivity: bool l_icase = m_icase; @@ -953,6 +1098,41 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state, create_startmap(state->next.p, 0, pnull, mask); return; } + case syntax_element_recurse: + { + if(recursion_start == state) + { + // Infinite recursion!! + if(0 == this->m_pdata->m_status) // update the error code if not already set + this->m_pdata->m_status = boost::regex_constants::error_bad_pattern; + // + // clear the expression, we should be empty: + // + this->m_pdata->m_expression = 0; + this->m_pdata->m_expression_len = 0; + // + // and throw if required: + // + if(0 == (this->flags() & regex_constants::no_except)) + { + std::string message = "Encountered an infinite recursion."; + boost::regex_error e(message, boost::regex_constants::error_bad_pattern, 0); + e.raise(); + } + } + else if(recursion_start == 0) + { + recursion_start = state; + recursion_restart = state->next.p; + state = static_cast<re_jump*>(state)->alt.p; + if(state->type == syntax_element_startmark) + recursion_sub = static_cast<re_brace*>(state)->index; + else + recursion_sub = 0; + break; + } + // fall through, can't handle nested recursion here... + } case syntax_element_backref: // can be null, and any character can match: if(pnull) @@ -1111,12 +1291,45 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state, *pnull |= mask; return; } - else + else if(recursion_start && (recursion_sub != 0) && (recursion_sub == static_cast<re_brace*>(state)->index)) { - state = state->next.p; + // recursion termination: + recursion_start = 0; + state = recursion_restart; break; } + // + // Normally we just go to the next state... but if this sub-expression is + // the target of a recursion, then we might be ending a recursion, in which + // case we should check whatever follows that recursion, as well as whatever + // follows this state: + // + if(m_pdata->m_has_recursions && static_cast<re_brace*>(state)->index) + { + bool ok = false; + re_syntax_base* p = m_pdata->m_first_state; + while(p) + { + if((p->type == syntax_element_recurse)) + { + re_brace* p2 = static_cast<re_brace*>(static_cast<re_jump*>(p)->alt.p); + if((p2->type == syntax_element_startmark) && (p2->index == static_cast<re_brace*>(state)->index)) + { + ok = true; + break; + } + } + p = p->next.p; + } + if(ok) + { + create_startmap(p->next.p, l_map, pnull, mask); + } + } + state = state->next.p; + break; + case syntax_element_startmark: // need to handle independent subs as a special case: if(static_cast<re_brace*>(state)->index == -3) diff --git a/3rdParty/Boost/src/boost/regex/v4/basic_regex_parser.hpp b/3rdParty/Boost/src/boost/regex/v4/basic_regex_parser.hpp index b8bc996..3ea4d64 100644 --- a/3rdParty/Boost/src/boost/regex/v4/basic_regex_parser.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/basic_regex_parser.hpp @@ -45,6 +45,11 @@ public: basic_regex_parser(regex_data<charT, traits>* data); void parse(const charT* p1, const charT* p2, unsigned flags); void fail(regex_constants::error_type error_code, std::ptrdiff_t position); + void fail(regex_constants::error_type error_code, std::ptrdiff_t position, std::string message, std::ptrdiff_t start_pos); + void fail(regex_constants::error_type error_code, std::ptrdiff_t position, const std::string& message) + { + fail(error_code, position, message, position); + } bool parse_all(); bool parse_basic(); @@ -78,6 +83,8 @@ private: const charT* m_end; // the end of the string being parsed const charT* m_position; // our current parser position unsigned m_mark_count; // how many sub-expressions we have + int m_mark_reset; // used to indicate that we're inside a (?|...) block. + unsigned m_max_mark; // largest mark count seen inside a (?|...) block. std::ptrdiff_t m_paren_start; // where the last seen ')' began (where repeats are inserted). std::ptrdiff_t m_alt_insert_point; // where to insert the next alternative bool m_has_case_change; // true if somewhere in the current block the case has changed @@ -96,7 +103,7 @@ private: template <class charT, class traits> basic_regex_parser<charT, traits>::basic_regex_parser(regex_data<charT, traits>* data) - : basic_regex_creator<charT, traits>(data), m_mark_count(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false) + : basic_regex_creator<charT, traits>(data), m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false) { } @@ -123,14 +130,27 @@ void basic_regex_parser<charT, traits>::parse(const charT* p1, const charT* p2, switch(l_flags & regbase::main_option_type) { case regbase::perl_syntax_group: - m_parser_proc = &basic_regex_parser<charT, traits>::parse_extended; - break; + { + m_parser_proc = &basic_regex_parser<charT, traits>::parse_extended; + // + // Add a leading paren with index zero to give recursions a target: + // + re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace))); + br->index = 0; + br->icase = this->flags() & regbase::icase; + break; + } case regbase::basic_syntax_group: m_parser_proc = &basic_regex_parser<charT, traits>::parse_basic; break; case regbase::literal: m_parser_proc = &basic_regex_parser<charT, traits>::parse_literal; break; + default: + // Ooops, someone has managed to set more than one of the main option flags, + // so this must be an error: + fail(regex_constants::error_unknown, 0, "An invalid combination of regular expression syntax flags was used."); + return; } // parse all our characters: @@ -145,7 +165,7 @@ void basic_regex_parser<charT, traits>::parse(const charT* p1, const charT* p2, // have had an unexpected ')' : if(!result) { - fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_position)); + fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_position), "Found a closing ) with no corresponding openening parenthesis."); return; } // if an error has been set then give up now: @@ -159,12 +179,39 @@ void basic_regex_parser<charT, traits>::parse(const charT* p1, const charT* p2, template <class charT, class traits> void basic_regex_parser<charT, traits>::fail(regex_constants::error_type error_code, std::ptrdiff_t position) { + // get the error message: + std::string message = this->m_pdata->m_ptraits->error_string(error_code); + fail(error_code, position, message); +} + +template <class charT, class traits> +void basic_regex_parser<charT, traits>::fail(regex_constants::error_type error_code, std::ptrdiff_t position, std::string message, std::ptrdiff_t start_pos) +{ if(0 == this->m_pdata->m_status) // update the error code if not already set this->m_pdata->m_status = error_code; m_position = m_end; // don't bother parsing anything else - // get the error message: - std::string message = this->m_pdata->m_ptraits->error_string(error_code); - // and raise the exception, this will do nothing if exceptions are disabled: + + // + // Augment error message with the regular expression text: + // + if(start_pos == position) + start_pos = (std::max)(static_cast<std::ptrdiff_t>(0), position - static_cast<std::ptrdiff_t>(10)); + std::ptrdiff_t end_pos = (std::min)(position + static_cast<std::ptrdiff_t>(10), static_cast<std::ptrdiff_t>(m_end - m_base)); + if(error_code != regex_constants::error_empty) + { + if((start_pos != 0) || (end_pos != (m_end - m_base))) + message += " The error occured while parsing the regular expression fragment: '"; + else + message += " The error occured while parsing the regular expression: '"; + if(start_pos != end_pos) + { + message += std::string(m_base + start_pos, m_base + position); + message += ">>>HERE>>>"; + message += std::string(m_base + position, m_base + end_pos); + } + message += "'."; + } + #ifndef BOOST_NO_EXCEPTIONS if(0 == (this->flags() & regex_constants::no_except)) { @@ -272,7 +319,7 @@ bool basic_regex_parser<charT, traits>::parse_extended() case regex_constants::syntax_star: if(m_position == this->m_base) { - fail(regex_constants::error_badrepeat, 0); + fail(regex_constants::error_badrepeat, 0, "The repeat operator \"*\" cannot start a regular expression."); return false; } ++m_position; @@ -280,7 +327,7 @@ bool basic_regex_parser<charT, traits>::parse_extended() case regex_constants::syntax_question: if(m_position == this->m_base) { - fail(regex_constants::error_badrepeat, 0); + fail(regex_constants::error_badrepeat, 0, "The repeat operator \"?\" cannot start a regular expression."); return false; } ++m_position; @@ -288,7 +335,7 @@ bool basic_regex_parser<charT, traits>::parse_extended() case regex_constants::syntax_plus: if(m_position == this->m_base) { - fail(regex_constants::error_badrepeat, 0); + fail(regex_constants::error_badrepeat, 0, "The repeat operator \"+\" cannot start a regular expression."); return false; } ++m_position; @@ -297,7 +344,7 @@ bool basic_regex_parser<charT, traits>::parse_extended() ++m_position; return parse_repeat_range(false); case regex_constants::syntax_close_brace: - fail(regex_constants::error_brace, this->m_position - this->m_end); + fail(regex_constants::error_brace, this->m_position - this->m_base, "Found a closing repetition operator } with no corresponding {."); return false; case regex_constants::syntax_or: return parse_alt(); @@ -375,11 +422,17 @@ bool basic_regex_parser<charT, traits>::parse_open_paren() if(0 == (this->flags() & regbase::nosubs)) { markid = ++m_mark_count; +#ifndef BOOST_NO_STD_DISTANCE if(this->flags() & regbase::save_subexpression_location) this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>(std::distance(m_base, m_position) - 1, 0)); +#else + if(this->flags() & regbase::save_subexpression_location) + this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>((m_position - m_base) - 1, 0)); +#endif } re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace))); pb->index = markid; + pb->icase = this->flags() & regbase::icase; std::ptrdiff_t last_paren_start = this->getoffset(pb); // back up insertion point for alternations, and set new point: std::ptrdiff_t last_alt_point = m_alt_insert_point; @@ -392,6 +445,11 @@ bool basic_regex_parser<charT, traits>::parse_open_paren() bool old_case_change = m_has_case_change; m_has_case_change = false; // no changes to this scope as yet... // + // Back up branch reset data in case we have a nested (?|...) + // + int mark_reset = m_mark_reset; + m_mark_reset = -1; + // // now recursively add more states, this will terminate when we get to a // matching ')' : // @@ -416,6 +474,10 @@ bool basic_regex_parser<charT, traits>::parse_open_paren() this->flags(opts); m_has_case_change = old_case_change; // + // restore branch reset: + // + m_mark_reset = mark_reset; + // // we either have a ')' or we have run out of characters prematurely: // if(m_position == m_end) @@ -424,14 +486,20 @@ bool basic_regex_parser<charT, traits>::parse_open_paren() return false; } BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark); +#ifndef BOOST_NO_STD_DISTANCE if(markid && (this->flags() & regbase::save_subexpression_location)) this->m_pdata->m_subs.at(markid - 1).second = std::distance(m_base, m_position); +#else + if(markid && (this->flags() & regbase::save_subexpression_location)) + this->m_pdata->m_subs.at(markid - 1).second = (m_position - m_base); +#endif ++m_position; // // append closing parenthesis state: // pb = static_cast<re_brace*>(this->append_state(syntax_element_endmark, sizeof(re_brace))); pb->index = markid; + pb->icase = this->flags() & regbase::icase; this->m_paren_start = last_paren_start; // // restore the alternate insertion point: @@ -481,7 +549,7 @@ bool basic_regex_parser<charT, traits>::parse_basic_escape() case regex_constants::syntax_close_brace: if(this->flags() & regbase::no_intervals) return parse_literal(); - fail(regex_constants::error_brace, this->m_position - this->m_base); + fail(regex_constants::error_brace, this->m_position - this->m_base, "Found a closing repetition operator } with no corresponding {."); return false; case regex_constants::syntax_or: if(this->flags() & regbase::bk_vbar) @@ -576,7 +644,7 @@ bool basic_regex_parser<charT, traits>::parse_basic_escape() case 'c': case 'C': // not supported yet: - fail(regex_constants::error_escape, m_position - m_base); + fail(regex_constants::error_escape, m_position - m_base, "The \\c and \\C escape sequences are not supported by POSIX basic regular expressions: try the Perl syntax instead."); return false; default: break; @@ -600,6 +668,7 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape() // fall through: case regex_constants::escape_type_class: { +escape_type_class_jump: typedef typename traits::char_class_type mask_type; mask_type m = this->m_traits.lookup_classname(m_position, m_position+1); if(m != 0) @@ -673,7 +742,7 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape() char_class_type m; if(m_position == m_end) { - fail(regex_constants::error_escape, m_position - m_base); + fail(regex_constants::error_escape, m_position - m_base, "Incomplete property escape found."); return false; } // maybe have \p{ddd} @@ -685,7 +754,7 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape() ++m_position; if(m_position == m_end) { - fail(regex_constants::error_escape, m_position - m_base); + fail(regex_constants::error_escape, m_position - m_base, "Closing } missing from property escape sequence."); return false; } m = this->m_traits.lookup_classname(++base, m_position++); @@ -708,8 +777,106 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape() } return true; } - fail(regex_constants::error_ctype, m_position - m_base); + fail(regex_constants::error_ctype, m_position - m_base, "Escape sequence was neither a valid property nor a valid character class name."); + return false; + } + case regex_constants::escape_type_reset_start_mark: + if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex))) + { + re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace))); + pb->index = -5; + pb->icase = this->flags() & regbase::icase; + this->m_pdata->m_data.align(); + ++m_position; + return true; + } + goto escape_type_class_jump; + case regex_constants::escape_type_line_ending: + if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex))) + { + const charT* e = get_escape_R_string<charT>(); + const charT* old_position = m_position; + const charT* old_end = m_end; + const charT* old_base = m_base; + m_position = e; + m_base = e; + m_end = e + traits::length(e); + bool r = parse_all(); + m_position = ++old_position; + m_end = old_end; + m_base = old_base; + return r; + } + goto escape_type_class_jump; + case regex_constants::escape_type_extended_backref: + if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex))) + { + bool have_brace = false; + bool negative = false; + static const char* incomplete_message = "Incomplete \\g escape found."; + if(++m_position == m_end) + { + fail(regex_constants::error_escape, m_position - m_base, incomplete_message); + return false; + } + // maybe have \g{ddd} + if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_open_brace) + { + if(++m_position == m_end) + { + fail(regex_constants::error_escape, m_position - m_base, incomplete_message); + return false; + } + have_brace = true; + } + negative = (*m_position == static_cast<charT>('-')); + if((negative) && (++m_position == m_end)) + { + fail(regex_constants::error_escape, m_position - m_base, incomplete_message); + return false; + } + const charT* pc = m_position; + int i = this->m_traits.toi(pc, m_end, 10); + if(i < 0) + { + // Check for a named capture: + const charT* base = m_position; + while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace)) + ++m_position; + i = this->m_pdata->get_id(base, m_position); + pc = m_position; + } + if(negative) + i = 1 + m_mark_count - i; + if((i > 0) && (this->m_backrefs & (1u << (i-1)))) + { + m_position = pc; + re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_backref, sizeof(re_brace))); + pb->index = i; + pb->icase = this->flags() & regbase::icase; + } + else + { + fail(regex_constants::error_backref, m_position - m_base); + return false; + } + m_position = pc; + if(have_brace) + { + if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace)) + { + fail(regex_constants::error_escape, m_position - m_base, incomplete_message); + return false; + } + ++m_position; + } + return true; } + goto escape_type_class_jump; + case regex_constants::escape_type_control_v: + if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex))) + goto escape_type_class_jump; + // fallthrough: default: this->append_literal(unescape_character()); break; @@ -737,6 +904,7 @@ template <class charT, class traits> bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_t high) { bool greedy = true; + bool pocessive = false; std::size_t insert_point; // // when we get to here we may have a non-greedy ? mark still to come: @@ -748,16 +916,23 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_ ) ) { - // OK we have a perl regex, check for a '?': + // OK we have a perl or emacs regex, check for a '?': if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_question) { greedy = false; ++m_position; } + // for perl regexes only check for pocessive ++ repeats. + if((0 == (this->flags() & regbase::main_option_type)) + && (this->m_traits.syntax_type(*m_position) == regex_constants::syntax_plus)) + { + pocessive = true; + ++m_position; + } } if(0 == this->m_last_state) { - fail(regex_constants::error_badrepeat, ::boost::re_detail::distance(m_base, m_position)); + fail(regex_constants::error_badrepeat, ::boost::re_detail::distance(m_base, m_position), "Nothing to repeat."); return false; } if(this->m_last_state->type == syntax_element_endmark) @@ -822,12 +997,29 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_ // now fill in the alt jump for the repeat: rep = static_cast<re_repeat*>(this->getaddress(rep_off)); rep->alt.i = this->m_pdata->m_data.size() - rep_off; + // + // If the repeat is pocessive then bracket the repeat with a (?>...) + // independent sub-expression construct: + // + if(pocessive) + { + re_brace* pb = static_cast<re_brace*>(this->insert_state(insert_point, syntax_element_startmark, sizeof(re_brace))); + pb->index = -3; + pb->icase = this->flags() & regbase::icase; + jmp = static_cast<re_jump*>(this->insert_state(insert_point + sizeof(re_brace), syntax_element_jump, sizeof(re_jump))); + this->m_pdata->m_data.align(); + jmp->alt.i = this->m_pdata->m_data.size() - this->getoffset(jmp); + pb = static_cast<re_brace*>(this->append_state(syntax_element_endmark, sizeof(re_brace))); + pb->index = -3; + pb->icase = this->flags() & regbase::icase; + } return true; } template <class charT, class traits> bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic) { + static const char* incomplete_message = "Missing } in quantified repetition."; // // parse a repeat-range: // @@ -839,7 +1031,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic) // fail if at end: if(this->m_position == this->m_end) { - fail(regex_constants::error_brace, this->m_position - this->m_base); + fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message); return false; } // get min: @@ -854,7 +1046,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic) } else if(this->m_position == this->m_end) { - fail(regex_constants::error_brace, this->m_position - this->m_base); + fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message); return false; } min = v; @@ -868,7 +1060,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic) ++m_position; if(this->m_position == this->m_end) { - fail(regex_constants::error_brace, this->m_position - this->m_base); + fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message); return false; } // get the value if any: @@ -886,7 +1078,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic) // OK now check trailing }: if(this->m_position == this->m_end) { - fail(regex_constants::error_brace, this->m_position - this->m_base); + fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message); return false; } if(isbasic) @@ -896,13 +1088,13 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic) ++m_position; if(this->m_position == this->m_end) { - fail(regex_constants::error_brace, this->m_position - this->m_base); + fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message); return false; } } else { - fail(regex_constants::error_badbrace, this->m_position - this->m_base); + fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message); return false; } } @@ -910,7 +1102,7 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic) ++m_position; else { - fail(regex_constants::error_badbrace, this->m_position - this->m_base); + fail(regex_constants::error_brace, this->m_position - this->m_base, incomplete_message); return false; } // @@ -918,7 +1110,11 @@ bool basic_regex_parser<charT, traits>::parse_repeat_range(bool isbasic) // if(min > max) { - fail(regex_constants::error_badbrace, this->m_position - this->m_base); + // Backtrack to error location: + m_position -= 2; + while(this->m_traits.isctype(*m_position, this->m_word_mask)) --m_position; + ++m_position; + fail(regex_constants::error_badbrace, m_position - m_base); return false; } return parse_repeat(min, max); @@ -941,9 +1137,17 @@ bool basic_regex_parser<charT, traits>::parse_alt() ) ) { - fail(regex_constants::error_empty, this->m_position - this->m_base); + fail(regex_constants::error_empty, this->m_position - this->m_base, "A regular expression can start with the alternation operator |."); return false; } + // + // Reset mark count if required: + // + if(m_max_mark < m_mark_count) + m_max_mark = m_mark_count; + if(m_mark_reset >= 0) + m_mark_count = m_mark_reset; + ++m_position; // // we need to append a trailing jump: @@ -985,10 +1189,11 @@ bool basic_regex_parser<charT, traits>::parse_alt() template <class charT, class traits> bool basic_regex_parser<charT, traits>::parse_set() { + static const char* incomplete_message = "Character set declaration starting with [ terminated prematurely - either no ] was found or the set had no content."; ++m_position; if(m_position == m_end) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } basic_char_set<charT, traits> char_set; @@ -1021,7 +1226,7 @@ bool basic_regex_parser<charT, traits>::parse_set() ++m_position; if(0 == this->append_set(char_set)) { - fail(regex_constants::error_range, m_position - m_base); + fail(regex_constants::error_ctype, m_position - m_base); return false; } } @@ -1076,6 +1281,7 @@ bool basic_regex_parser<charT, traits>::parse_set() template <class charT, class traits> bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, traits>& char_set) { + static const char* incomplete_message = "Character class declaration starting with [ terminated prematurely - either no ] was found or the set had no content."; // // we have either a character class [:name:] // a collating element [.name.] @@ -1083,7 +1289,7 @@ bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, tr // if(m_end == ++m_position) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } switch(this->m_traits.syntax_type(*m_position)) @@ -1108,14 +1314,14 @@ bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, tr // skip the ':' if(m_end == ++m_position) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } const charT* name_first = m_position; // skip at least one character, then find the matching ':]' if(m_end == ++m_position) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } while((m_position != m_end) @@ -1124,13 +1330,13 @@ bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, tr const charT* name_last = m_position; if(m_end == m_position) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } if((m_end == ++m_position) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_set)) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } // @@ -1185,14 +1391,14 @@ bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, tr // skip the '=' if(m_end == ++m_position) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } const charT* name_first = m_position; // skip at least one character, then find the matching '=]' if(m_end == ++m_position) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } while((m_position != m_end) @@ -1201,13 +1407,13 @@ bool basic_regex_parser<charT, traits>::parse_inner_set(basic_char_set<charT, tr const charT* name_last = m_position; if(m_end == m_position) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } if((m_end == ++m_position) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_set)) { - fail(regex_constants::error_brack, m_position - m_base); + fail(regex_constants::error_brack, m_position - m_base, incomplete_message); return false; } string_type m = this->m_traits.lookup_collatename(name_first, name_last); @@ -1397,7 +1603,7 @@ charT basic_regex_parser<charT, traits>::unescape_character() charT result(0); if(m_position == m_end) { - fail(regex_constants::error_escape, m_position - m_base); + fail(regex_constants::error_escape, m_position - m_base, "Escape sequence terminated prematurely."); return false; } switch(this->m_traits.escape_syntax_type(*m_position)) @@ -1430,24 +1636,22 @@ charT basic_regex_parser<charT, traits>::unescape_character() ++m_position; if(m_position == m_end) { - fail(regex_constants::error_escape, m_position - m_base); - return result; - } - /* - if((*m_position < charT('@')) - || (*m_position > charT(125)) ) - { - fail(regex_constants::error_escape, m_position - m_base); + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; + fail(regex_constants::error_escape, m_position - m_base, "ASCII escape sequence terminated prematurely."); return result; } - */ result = static_cast<charT>(*m_position % 32); break; case regex_constants::escape_type_hex: ++m_position; if(m_position == m_end) { - fail(regex_constants::error_escape, m_position - m_base); + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; + fail(regex_constants::error_escape, m_position - m_base, "Hexadecimal escape sequence terminated prematurely."); return result; } // maybe have \x{ddd} @@ -1456,16 +1660,22 @@ charT basic_regex_parser<charT, traits>::unescape_character() ++m_position; if(m_position == m_end) { - fail(regex_constants::error_escape, m_position - m_base); + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; + fail(regex_constants::error_escape, m_position - m_base, "Missing } in hexadecimal escape sequence."); return result; } int i = this->m_traits.toi(m_position, m_end, 16); if((m_position == m_end) || (i < 0) - || ((std::numeric_limits<charT>::is_specialized) && (charT(i) > (std::numeric_limits<charT>::max)())) + || ((std::numeric_limits<charT>::is_specialized) && (i > (int)(std::numeric_limits<charT>::max)())) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace)) { - fail(regex_constants::error_badbrace, m_position - m_base); + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; + fail(regex_constants::error_badbrace, m_position - m_base, "Hexadecimal escape sequence was invalid."); return result; } ++m_position; @@ -1473,12 +1683,15 @@ charT basic_regex_parser<charT, traits>::unescape_character() } else { - std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(2), m_end - m_position); + std::ptrdiff_t len = (std::min)(static_cast<std::ptrdiff_t>(2), static_cast<std::ptrdiff_t>(m_end - m_position)); int i = this->m_traits.toi(m_position, m_position + len, 16); if((i < 0) || !valid_value(charT(0), i)) { - fail(regex_constants::error_escape, m_position - m_base); + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; + fail(regex_constants::error_escape, m_position - m_base, "Escape sequence did not encode a valid character."); return result; } result = charT(i); @@ -1493,14 +1706,20 @@ charT basic_regex_parser<charT, traits>::unescape_character() int val = this->m_traits.toi(bp, bp + 1, 8); if(val != 0) { + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; // Oops not an octal escape after all: - fail(regex_constants::error_escape, m_position - m_base); + fail(regex_constants::error_escape, m_position - m_base, "Invalid octal escape sequence."); return result; } val = this->m_traits.toi(m_position, m_position + len, 8); if(val < 0) { - fail(regex_constants::error_escape, m_position - m_base); + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; + fail(regex_constants::error_escape, m_position - m_base, "Octal escape sequence is invalid."); return result; } return static_cast<charT>(val); @@ -1510,6 +1729,9 @@ charT basic_regex_parser<charT, traits>::unescape_character() ++m_position; if(m_position == m_end) { + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; fail(regex_constants::error_escape, m_position - m_base); return false; } @@ -1522,12 +1744,18 @@ charT basic_regex_parser<charT, traits>::unescape_character() ++m_position; if(m_position == m_end) { + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; fail(regex_constants::error_escape, m_position - m_base); return false; } string_type s = this->m_traits.lookup_collatename(++base, m_position++); if(s.empty()) { + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; fail(regex_constants::error_collate, m_position - m_base); return false; } @@ -1537,6 +1765,9 @@ charT basic_regex_parser<charT, traits>::unescape_character() } } // fall through is a failure: + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; fail(regex_constants::error_escape, m_position - m_base); return false; } @@ -1568,10 +1799,14 @@ bool basic_regex_parser<charT, traits>::parse_backref() m_position = pc; re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_backref, sizeof(re_brace))); pb->index = i; + pb->icase = this->flags() & regbase::icase; } else { - fail(regex_constants::error_backref, m_position - m_end); + // Rewind to start of escape: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; + fail(regex_constants::error_backref, m_position - m_base); return false; } return true; @@ -1603,7 +1838,7 @@ bool basic_regex_parser<charT, traits>::parse_QE() } if(++m_position == m_end) // skip the escape { - fail(regex_constants::error_escape, m_position - m_base); + fail(regex_constants::error_escape, m_position - m_base, "Unterminated \\Q...\\E sequence."); return false; } // check to see if it's a \E: @@ -1634,7 +1869,10 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() { if(++m_position == m_end) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } // @@ -1655,6 +1893,7 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() int markid = 0; std::ptrdiff_t jump_offset = 0; re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace))); + pb->icase = this->flags() & regbase::icase; std::ptrdiff_t last_paren_start = this->getoffset(pb); // back up insertion point for alternations, and set new point: std::ptrdiff_t last_alt_point = m_alt_insert_point; @@ -1665,11 +1904,18 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() regex_constants::syntax_option_type old_flags = this->flags(); bool old_case_change = m_has_case_change; m_has_case_change = false; + charT name_delim; + int mark_reset = m_mark_reset; + m_mark_reset = -1; + int v; // // select the actual extension used: // switch(this->m_traits.syntax_type(*m_position)) { + case regex_constants::syntax_or: + m_mark_reset = m_mark_count; + // fall through: case regex_constants::syntax_colon: // // a non-capturing mark: @@ -1677,6 +1923,68 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() pb->index = markid = 0; ++m_position; break; + case regex_constants::syntax_digit: + { + // + // a recursive subexpression: + // + v = this->m_traits.toi(m_position, m_end, 10); + if((v < 0) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base, "The recursive sub-expression refers to an invalid marking group, or is unterminated."); + return false; + } +insert_recursion: + pb->index = markid = 0; + re_recurse* pr = static_cast<re_recurse*>(this->append_state(syntax_element_recurse, sizeof(re_recurse))); + pr->alt.i = v; + pr->state_id = 0; + static_cast<re_case*>( + this->append_state(syntax_element_toggle_case, sizeof(re_case)) + )->icase = this->flags() & regbase::icase; + break; + } + case regex_constants::syntax_plus: + // + // A forward-relative recursive subexpression: + // + ++m_position; + v = this->m_traits.toi(m_position, m_end, 10); + if((v <= 0) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base, "An invalid or unterminated recursive sub-expression."); + return false; + } + v += m_mark_count; + goto insert_recursion; + case regex_constants::syntax_dash: + // + // Possibly a backward-relative recursive subexpression: + // + ++m_position; + v = this->m_traits.toi(m_position, m_end, 10); + if(v <= 0) + { + --m_position; + // Oops not a relative recursion at all, but a (?-imsx) group: + goto option_group_jump; + } + v = m_mark_count + 1 - v; + if(v <= 0) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base, "An invalid or unterminated recursive sub-expression."); + return false; + } + goto insert_recursion; case regex_constants::syntax_equal: pb->index = markid = -1; ++m_position; @@ -1696,7 +2004,10 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() // a lookbehind assertion: if(++m_position == m_end) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } regex_constants::syntax_type t = this->m_traits.syntax_type(*m_position); @@ -1706,8 +2017,10 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() pb->index = markid = -1; else { - fail(regex_constants::error_badrepeat, m_position - m_base); - return false; + // Probably a named capture which also starts (?< : + name_delim = '>'; + --m_position; + goto named_capture_jump; } ++m_position; jump_offset = this->getoffset(this->append_state(syntax_element_jump, sizeof(re_jump))); @@ -1732,22 +2045,152 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() pb->index = markid = -4; if(++m_position == m_end) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } - int v = this->m_traits.toi(m_position, m_end, 10); - if(v > 0) + v = this->m_traits.toi(m_position, m_end, 10); + if(*m_position == charT('R')) + { + if(++m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + if(*m_position == charT('&')) + { + const charT* base = ++m_position; + while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)) + ++m_position; + if(m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + v = -static_cast<int>(hash_value_from_capture_name(base, m_position)); + } + else + { + v = -this->m_traits.toi(m_position, m_end, 10); + } + re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace))); + br->index = v < 0 ? (v - 1) : 0; + if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + if(++m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + } + else if((*m_position == charT('\'')) || (*m_position == charT('<'))) + { + const charT* base = ++m_position; + while((m_position != m_end) && (*m_position != charT('>')) && (*m_position != charT('\''))) + ++m_position; + if(m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + v = static_cast<int>(hash_value_from_capture_name(base, m_position)); + re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace))); + br->index = v; + if(((*m_position != charT('>')) && (*m_position != charT('\''))) || (++m_position == m_end)) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base, "Unterminated named capture."); + return false; + } + if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + if(++m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + } + else if(*m_position == charT('D')) + { + const char* def = "DEFINE"; + while(*def && (m_position != m_end) && (*m_position == charT(*def))) + ++m_position, ++def; + if((m_position == m_end) || *def) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace))); + br->index = 9999; // special magic value! + if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + if(++m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + } + else if(v > 0) { re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace))); br->index = v; if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } if(++m_position == m_end) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } } @@ -1756,25 +2199,37 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() // verify that we have a lookahead or lookbehind assert: if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_question) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } if(++m_position == m_end) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } if(this->m_traits.syntax_type(*m_position) == regex_constants::escape_type_left_word) { if(++m_position == m_end) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } if((this->m_traits.syntax_type(*m_position) != regex_constants::syntax_equal) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_not)) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } m_position -= 3; @@ -1784,7 +2239,10 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() if((this->m_traits.syntax_type(*m_position) != regex_constants::syntax_equal) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_not)) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } m_position -= 2; @@ -1793,15 +2251,125 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() break; } case regex_constants::syntax_close_mark: - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; + case regex_constants::escape_type_end_buffer: + { + name_delim = *m_position; +named_capture_jump: + markid = 0; + if(0 == (this->flags() & regbase::nosubs)) + { + markid = ++m_mark_count; + #ifndef BOOST_NO_STD_DISTANCE + if(this->flags() & regbase::save_subexpression_location) + this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>(std::distance(m_base, m_position) - 2, 0)); + #else + if(this->flags() & regbase::save_subexpression_location) + this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>((m_position - m_base) - 2, 0)); + #endif + } + pb->index = markid; + const charT* base = ++m_position; + if(m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + while((m_position != m_end) && (*m_position != name_delim)) + ++m_position; + if(m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + this->m_pdata->set_name(base, m_position, markid); + ++m_position; + break; + } default: + if(*m_position == charT('R')) + { + ++m_position; + v = 0; + if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + goto insert_recursion; + } + if(*m_position == charT('&')) + { + ++m_position; + const charT* base = m_position; + while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)) + ++m_position; + if(m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + v = static_cast<int>(hash_value_from_capture_name(base, m_position)); + goto insert_recursion; + } + if(*m_position == charT('P')) + { + ++m_position; + if(m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + if(*m_position == charT('>')) + { + ++m_position; + const charT* base = m_position; + while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)) + ++m_position; + if(m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); + return false; + } + v = static_cast<int>(hash_value_from_capture_name(base, m_position)); + goto insert_recursion; + } + } // // lets assume that we have a (?imsx) group and try and parse it: // +option_group_jump: regex_constants::syntax_option_type opts = parse_options(); if(m_position == m_end) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; + } // make a note of whether we have a case change: m_has_case_change = ((opts & regbase::icase) != (this->flags() & regbase::icase)); pb->index = markid = 0; @@ -1820,7 +2388,10 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() } else { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base); return false; } @@ -1842,12 +2413,21 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() // Unwind alternatives: // if(0 == unwind_alts(last_paren_start)) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base, "Invalid alternation operators within (?...) block."); return false; + } // // we either have a ')' or we have run out of characters prematurely: // if(m_position == m_end) { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; this->fail(regex_constants::error_paren, ::boost::re_detail::distance(m_base, m_end)); return false; } @@ -1878,7 +2458,10 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() if(this->m_last_state == jmp) { // Oops... we didn't have anything inside the assertion: - fail(regex_constants::error_empty, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_perl_extension, m_position - m_base, "Invalid or empty zero width assertion."); return false; } } @@ -1897,16 +2480,36 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() } else if(this->getaddress(static_cast<re_alt*>(b)->alt.i, b)->type == syntax_element_alt) { - fail(regex_constants::error_bad_pattern, m_position - m_base); + // Can't have seen more than one alternative: + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_bad_pattern, m_position - m_base, "More than one alternation operator | was encountered inside a conditional expression."); return false; } + else + { + // We must *not* have seen an alternative inside a (DEFINE) block: + b = this->getaddress(b->next.i, b); + if((b->type == syntax_element_assert_backref) && (static_cast<re_brace*>(b)->index == 9999)) + { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_bad_pattern, m_position - m_base, "Alternation operators are not allowed inside a DEFINE block."); + return false; + } + } // check for invalid repetition of next state: b = this->getaddress(expected_alt_point); b = this->getaddress(static_cast<re_alt*>(b)->next.i, b); if((b->type != syntax_element_assert_backref) && (b->type != syntax_element_startmark)) { - fail(regex_constants::error_badrepeat, m_position - m_base); + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; + fail(regex_constants::error_badrepeat, m_position - m_base, "A repetition operator cannot be applied to a zero-width assertion."); return false; } } @@ -1915,6 +2518,7 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() // pb = static_cast<re_brace*>(this->append_state(syntax_element_endmark, sizeof(re_brace))); pb->index = markid; + pb->icase = this->flags() & regbase::icase; this->m_paren_start = last_paren_start; // // restore the alternate insertion point: @@ -1924,6 +2528,31 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension() // and the case change data: // m_has_case_change = old_case_change; + // + // And the mark_reset data: + // + if(m_max_mark > m_mark_count) + { + m_mark_count = m_max_mark; + } + m_mark_reset = mark_reset; + + + if(markid > 0) + { +#ifndef BOOST_NO_STD_DISTANCE + if(this->flags() & regbase::save_subexpression_location) + this->m_pdata->m_subs.at(markid - 1).second = std::distance(m_base, m_position) - 1; +#else + if(this->flags() & regbase::save_subexpression_location) + this->m_pdata->m_subs.at(markid - 1).second = (m_position - m_base) - 1; +#endif + // + // allow backrefs to this mark: + // + if((markid > 0) && (markid < (int)(sizeof(unsigned) * CHAR_BIT))) + this->m_backrefs |= 1u << (markid - 1); + } return true; } @@ -1935,6 +2564,9 @@ bool basic_regex_parser<charT, traits>::add_emacs_code(bool negate) // if(++m_position == m_end) { + // Rewind to start of sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_escape) --m_position; fail(regex_constants::error_escape, m_position - m_base); return false; } @@ -2035,6 +2667,9 @@ regex_constants::syntax_option_type basic_regex_parser<charT, traits>::parse_opt } if(++m_position == m_end) { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; fail(regex_constants::error_paren, m_position - m_base); return false; } @@ -2045,6 +2680,9 @@ regex_constants::syntax_option_type basic_regex_parser<charT, traits>::parse_opt { if(++m_position == m_end) { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; fail(regex_constants::error_paren, m_position - m_base); return false; } @@ -2071,6 +2709,9 @@ regex_constants::syntax_option_type basic_regex_parser<charT, traits>::parse_opt } if(++m_position == m_end) { + // Rewind to start of (? sequence: + --m_position; + while(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_open_mark) --m_position; fail(regex_constants::error_paren, m_position - m_base); return false; } @@ -2097,7 +2738,7 @@ bool basic_regex_parser<charT, traits>::unwind_alts(std::ptrdiff_t last_paren_st ) ) { - fail(regex_constants::error_empty, this->m_position - this->m_base); + fail(regex_constants::error_empty, this->m_position - this->m_base, "Can't terminate a sub-expression with an alternation operator |."); return false; } // diff --git a/3rdParty/Boost/src/boost/regex/v4/cpp_regex_traits.hpp b/3rdParty/Boost/src/boost/regex/v4/cpp_regex_traits.hpp index 89fe49d..bb40aa1 100644 --- a/3rdParty/Boost/src/boost/regex/v4/cpp_regex_traits.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/cpp_regex_traits.hpp @@ -187,6 +187,7 @@ struct cpp_regex_traits_base #ifndef BOOST_NO_STD_MESSAGES if(m_pmessages == b.m_pmessages) { + return m_pcollate < b.m_pcollate; } return m_pmessages < b.m_pmessages; #else @@ -212,7 +213,7 @@ std::locale cpp_regex_traits_base<charT>::imbue(const std::locale& l) m_locale = l; m_pctype = &BOOST_USE_FACET(std::ctype<charT>, l); #ifndef BOOST_NO_STD_MESSAGES - m_pmessages = &BOOST_USE_FACET(std::messages<charT>, l); + m_pmessages = BOOST_HAS_FACET(std::messages<charT>, l) ? &BOOST_USE_FACET(std::messages<charT>, l) : 0; #endif m_pcollate = &BOOST_USE_FACET(std::collate<charT>, l); return result; @@ -276,7 +277,7 @@ void cpp_regex_traits_char_layer<charT>::init() typename std::messages<charT>::catalog cat = reinterpret_cast<std::messages<char>::catalog>(-1); #endif std::string cat_name(cpp_regex_traits<charT>::get_catalog_name()); - if(cat_name.size()) + if(cat_name.size() && (this->m_pmessages != 0)) { cat = this->m_pmessages->open( cat_name, @@ -309,7 +310,8 @@ void cpp_regex_traits_char_layer<charT>::init() } catch(...) { - this->m_pmessages->close(cat); + if(this->m_pmessages) + this->m_pmessages->close(cat); throw; } #endif @@ -394,7 +396,9 @@ enum char_class_graph=char_class_alnum|char_class_punct, char_class_blank=1<<9, char_class_word=1<<10, - char_class_unicode=1<<11 + char_class_unicode=1<<11, + char_class_horizontal_space=1<<12, + char_class_vertical_space=1<<13 }; #endif @@ -413,6 +417,8 @@ public: BOOST_STATIC_CONSTANT(char_class_type, mask_blank = 1u << 24); BOOST_STATIC_CONSTANT(char_class_type, mask_word = 1u << 25); BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 1u << 26); + BOOST_STATIC_CONSTANT(char_class_type, mask_horizontal = 1u << 27); + BOOST_STATIC_CONSTANT(char_class_type, mask_vertical = 1u << 28); #endif typedef std::basic_string<charT> string_type; @@ -477,6 +483,10 @@ template <class charT> typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_word; template <class charT> typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_unicode; +template <class charT> +typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_vertical; +template <class charT> +typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_horizontal; #endif #endif @@ -645,7 +655,7 @@ void cpp_regex_traits_implementation<charT>::init() typename std::messages<charT>::catalog cat = reinterpret_cast<std::messages<char>::catalog>(-1); #endif std::string cat_name(cpp_regex_traits<charT>::get_catalog_name()); - if(cat_name.size()) + if(cat_name.size() && (this->m_pmessages != 0)) { cat = this->m_pmessages->open( cat_name, @@ -688,36 +698,40 @@ void cpp_regex_traits_implementation<charT>::init() // Custom class names: // #ifndef BOOST_REGEX_BUGGY_CTYPE_FACET - static const char_class_type masks[14] = + static const char_class_type masks[16] = { std::ctype<charT>::alnum, std::ctype<charT>::alpha, std::ctype<charT>::cntrl, std::ctype<charT>::digit, std::ctype<charT>::graph, + cpp_regex_traits_implementation<charT>::mask_horizontal, std::ctype<charT>::lower, std::ctype<charT>::print, std::ctype<charT>::punct, std::ctype<charT>::space, std::ctype<charT>::upper, + cpp_regex_traits_implementation<charT>::mask_vertical, std::ctype<charT>::xdigit, cpp_regex_traits_implementation<charT>::mask_blank, cpp_regex_traits_implementation<charT>::mask_word, cpp_regex_traits_implementation<charT>::mask_unicode, }; #else - static const char_class_type masks[14] = + static const char_class_type masks[16] = { ::boost::re_detail::char_class_alnum, ::boost::re_detail::char_class_alpha, ::boost::re_detail::char_class_cntrl, ::boost::re_detail::char_class_digit, ::boost::re_detail::char_class_graph, + ::boost::re_detail::char_class_horizontal_space, ::boost::re_detail::char_class_lower, ::boost::re_detail::char_class_print, ::boost::re_detail::char_class_punct, ::boost::re_detail::char_class_space, ::boost::re_detail::char_class_upper, + ::boost::re_detail::char_class_vertical_space, ::boost::re_detail::char_class_xdigit, ::boost::re_detail::char_class_blank, ::boost::re_detail::char_class_word, @@ -744,7 +758,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type cpp_regex_traits_implementation<charT>::lookup_classname_imp(const charT* p1, const charT* p2) const { #ifndef BOOST_REGEX_BUGGY_CTYPE_FACET - static const char_class_type masks[20] = + static const char_class_type masks[22] = { 0, std::ctype<char>::alnum, @@ -754,6 +768,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type std::ctype<char>::digit, std::ctype<char>::digit, std::ctype<char>::graph, + cpp_regex_traits_implementation<charT>::mask_horizontal, std::ctype<char>::lower, std::ctype<char>::lower, std::ctype<char>::print, @@ -763,12 +778,13 @@ typename cpp_regex_traits_implementation<charT>::char_class_type std::ctype<char>::upper, cpp_regex_traits_implementation<charT>::mask_unicode, std::ctype<char>::upper, + cpp_regex_traits_implementation<charT>::mask_vertical, std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word, std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word, std::ctype<char>::xdigit, }; #else - static const char_class_type masks[20] = + static const char_class_type masks[22] = { 0, ::boost::re_detail::char_class_alnum, @@ -778,6 +794,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type ::boost::re_detail::char_class_digit, ::boost::re_detail::char_class_digit, ::boost::re_detail::char_class_graph, + ::boost::re_detail::char_class_horizontal_space, ::boost::re_detail::char_class_lower, ::boost::re_detail::char_class_lower, ::boost::re_detail::char_class_print, @@ -787,6 +804,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type ::boost::re_detail::char_class_upper, ::boost::re_detail::char_class_unicode, ::boost::re_detail::char_class_upper, + ::boost::re_detail::char_class_vertical_space, ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, ::boost::re_detail::char_class_xdigit, @@ -820,7 +838,9 @@ bool cpp_regex_traits_implementation<charT>::isctype(const charT c, char_class_t || ((mask & ::boost::re_detail::char_class_xdigit) && (m_pctype->is(std::ctype<charT>::xdigit, c))) || ((mask & ::boost::re_detail::char_class_blank) && (m_pctype->is(std::ctype<charT>::space, c)) && !::boost::re_detail::is_separator(c)) || ((mask & ::boost::re_detail::char_class_word) && (c == '_')) - || ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c)); + || ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c)) + || ((mask & ::boost::re_detail::char_class_vertical_space) && (is_separator(c) || (c == '\v'))) + || ((mask & ::boost::re_detail::char_class_horizontal_space) && m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v'))); } #endif @@ -930,6 +950,12 @@ public: && m_pimpl->m_pctype->is(std::ctype<charT>::space, c) && !re_detail::is_separator(c)) return true; + else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_vertical) + && (::boost::re_detail::is_separator(c) || (c == '\v'))) + return true; + else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_horizontal) + && this->isctype(c, std::ctype<charT>::space) && !this->isctype(c, re_detail::cpp_regex_traits_implementation<charT>::mask_vertical)) + return true; return false; #else return m_pimpl->isctype(c, f); diff --git a/3rdParty/Boost/src/boost/regex/v4/cregex.hpp b/3rdParty/Boost/src/boost/regex/v4/cregex.hpp index cafe396..7b3df1e 100644 --- a/3rdParty/Boost/src/boost/regex/v4/cregex.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/cregex.hpp @@ -124,11 +124,11 @@ typedef enum{ REG_STARTEND = 00004 } reg_exec_flags; -// -// POSIX error codes: -// +/* + * POSIX error codes: + */ typedef unsigned reg_error_t; -typedef reg_error_t reg_errcode_t; // backwards compatibility +typedef reg_error_t reg_errcode_t; /* backwards compatibility */ static const reg_error_t REG_NOERROR = 0; /* Success. */ static const reg_error_t REG_NOMATCH = 1; /* Didn't find a match (for regexec). */ @@ -154,8 +154,9 @@ static const reg_error_t REG_EMPTY = 17; /* empty expression */ static const reg_error_t REG_E_MEMORY = 15; /* = REG_ESIZE : out of memory */ static const reg_error_t REG_ECOMPLEXITY = 18; /* complexity too high */ static const reg_error_t REG_ESTACK = 19; /* out of stack space */ -static const reg_error_t REG_E_UNKNOWN = 20; /* unknown error */ -static const reg_error_t REG_ENOSYS = 20; /* = REG_E_UNKNOWN : Reserved. */ +static const reg_error_t REG_E_PERL = 20; /* Perl (?...) error */ +static const reg_error_t REG_E_UNKNOWN = 21; /* unknown error */ +static const reg_error_t REG_ENOSYS = 21; /* = REG_E_UNKNOWN : Reserved. */ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA*, const char*, int); BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int, const regex_tA*, char*, regsize_t); @@ -195,14 +196,14 @@ BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*); #endif #ifdef __cplusplus -} // extern "C" -} // namespace +} /* extern "C" */ +} /* namespace */ #endif -// -// C++ high level wrapper goes here: -// #if defined(__cplusplus) +/* + * C++ high level wrapper goes here: + */ #include <string> #include <vector> namespace boost{ @@ -228,7 +229,7 @@ struct pred2; struct pred3; struct pred4; -} // namespace re_detail +} /* namespace re_detail */ #if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_DISABLE_WIN32) typedef bool (__cdecl *GrepCallback)(const RegEx& expression); @@ -257,9 +258,9 @@ public: unsigned int SetExpression(const std::string& s, bool icase = false){ return SetExpression(s.c_str(), icase); } std::string Expression()const; unsigned int error_code()const; - // - // now matching operators: - // + /* + * now matching operators: + */ bool Match(const char* p, match_flag_type flags = match_default); bool Match(const std::string& s, match_flag_type flags = match_default) { return Match(s.c_str(), flags); } bool Search(const char* p, match_flag_type flags = match_default); @@ -283,9 +284,9 @@ public: bool copy = true, match_flag_type flags = match_default); std::size_t Split(std::vector<std::string>& v, std::string& s, match_flag_type flags = match_default, unsigned max_count = ~0); - // - // now operators for returning what matched in more detail: - // + /* + * now operators for returning what matched in more detail: + */ std::size_t Position(int i = 0)const; std::size_t Length(int i = 0)const; bool Matched(int i = 0)const; @@ -312,11 +313,11 @@ public: #pragma warning(pop) #endif -} // namespace boost +} /* namespace boost */ -#endif +#endif /* __cplusplus */ -#endif // include guard +#endif /* include guard */ diff --git a/3rdParty/Boost/src/boost/regex/v4/error_type.hpp b/3rdParty/Boost/src/boost/regex/v4/error_type.hpp index b6633a0..afcc71e 100644 --- a/3rdParty/Boost/src/boost/regex/v4/error_type.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/error_type.hpp @@ -28,8 +28,8 @@ namespace regex_constants{ enum error_type{ - error_ok = 0, // not used - error_no_match = 1, // not used + error_ok = 0, /* not used */ + error_no_match = 1, /* not used */ error_bad_pattern = 2, error_collate = 3, error_ctype = 4, @@ -42,17 +42,18 @@ enum error_type{ error_range = 11, error_space = 12, error_badrepeat = 13, - error_end = 14, // not used + error_end = 14, /* not used */ error_size = 15, - error_right_paren = 16, // not used + error_right_paren = 16, /* not used */ error_empty = 17, error_complexity = 18, error_stack = 19, - error_unknown = 20 + error_perl_extension = 20, + error_unknown = 21 }; } } -#endif // __cplusplus +#endif /* __cplusplus */ #endif diff --git a/3rdParty/Boost/src/boost/regex/v4/iterator_category.hpp b/3rdParty/Boost/src/boost/regex/v4/iterator_category.hpp index 20870a0..9e40142 100644 --- a/3rdParty/Boost/src/boost/regex/v4/iterator_category.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/iterator_category.hpp @@ -31,10 +31,14 @@ namespace detail{ template <class I> struct is_random_imp { +#ifndef BOOST_NO_STD_ITERATOR_TRAITS private: typedef typename std::iterator_traits<I>::iterator_category cat; public: BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible<cat*, std::random_access_iterator_tag*>::value)); +#else + BOOST_STATIC_CONSTANT(bool, value = false); +#endif }; template <class I> diff --git a/3rdParty/Boost/src/boost/regex/v4/match_flags.hpp b/3rdParty/Boost/src/boost/regex/v4/match_flags.hpp index 9585aca..26bde9a 100644 --- a/3rdParty/Boost/src/boost/regex/v4/match_flags.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/match_flags.hpp @@ -31,43 +31,43 @@ namespace boost{ typedef enum _match_flags { match_default = 0, - match_not_bol = 1, // first is not start of line - match_not_eol = match_not_bol << 1, // last is not end of line - match_not_bob = match_not_eol << 1, // first is not start of buffer - match_not_eob = match_not_bob << 1, // last is not end of buffer - match_not_bow = match_not_eob << 1, // first is not start of word - match_not_eow = match_not_bow << 1, // last is not end of word - match_not_dot_newline = match_not_eow << 1, // \n is not matched by '.' - match_not_dot_null = match_not_dot_newline << 1, // '\0' is not matched by '.' - match_prev_avail = match_not_dot_null << 1, // *--first is a valid expression - match_init = match_prev_avail << 1, // internal use - match_any = match_init << 1, // don't care what we match - match_not_null = match_any << 1, // string can't be null - match_continuous = match_not_null << 1, // each grep match must continue from - // uninterupted from the previous one - match_partial = match_continuous << 1, // find partial matches + match_not_bol = 1, /* first is not start of line */ + match_not_eol = match_not_bol << 1, /* last is not end of line */ + match_not_bob = match_not_eol << 1, /* first is not start of buffer */ + match_not_eob = match_not_bob << 1, /* last is not end of buffer */ + match_not_bow = match_not_eob << 1, /* first is not start of word */ + match_not_eow = match_not_bow << 1, /* last is not end of word */ + match_not_dot_newline = match_not_eow << 1, /* \n is not matched by '.' */ + match_not_dot_null = match_not_dot_newline << 1, /* '\0' is not matched by '.' */ + match_prev_avail = match_not_dot_null << 1, /* *--first is a valid expression */ + match_init = match_prev_avail << 1, /* internal use */ + match_any = match_init << 1, /* don't care what we match */ + match_not_null = match_any << 1, /* string can't be null */ + match_continuous = match_not_null << 1, /* each grep match must continue from */ + /* uninterupted from the previous one */ + match_partial = match_continuous << 1, /* find partial matches */ - match_stop = match_partial << 1, // stop after first match (grep) V3 only - match_not_initial_null = match_stop, // don't match initial null, V4 only - match_all = match_stop << 1, // must find the whole of input even if match_any is set - match_perl = match_all << 1, // Use perl matching rules - match_posix = match_perl << 1, // Use POSIX matching rules - match_nosubs = match_posix << 1, // don't trap marked subs - match_extra = match_nosubs << 1, // include full capture information for repeated captures - match_single_line = match_extra << 1, // treat text as single line and ignor any \n's when matching ^ and $. - match_unused1 = match_single_line << 1, // unused - match_unused2 = match_unused1 << 1, // unused - match_unused3 = match_unused2 << 1, // unused + match_stop = match_partial << 1, /* stop after first match (grep) V3 only */ + match_not_initial_null = match_stop, /* don't match initial null, V4 only */ + match_all = match_stop << 1, /* must find the whole of input even if match_any is set */ + match_perl = match_all << 1, /* Use perl matching rules */ + match_posix = match_perl << 1, /* Use POSIX matching rules */ + match_nosubs = match_posix << 1, /* don't trap marked subs */ + match_extra = match_nosubs << 1, /* include full capture information for repeated captures */ + match_single_line = match_extra << 1, /* treat text as single line and ignor any \n's when matching ^ and $. */ + match_unused1 = match_single_line << 1, /* unused */ + match_unused2 = match_unused1 << 1, /* unused */ + match_unused3 = match_unused2 << 1, /* unused */ match_max = match_unused3, - format_perl = 0, // perl style replacement - format_default = 0, // ditto. - format_sed = match_max << 1, // sed style replacement. - format_all = format_sed << 1, // enable all extentions to sytax. - format_no_copy = format_all << 1, // don't copy non-matching segments. - format_first_only = format_no_copy << 1, // Only replace first occurance. - format_is_if = format_first_only << 1, // internal use only. - format_literal = format_is_if << 1 // treat string as a literal + format_perl = 0, /* perl style replacement */ + format_default = 0, /* ditto. */ + format_sed = match_max << 1, /* sed style replacement. */ + format_all = format_sed << 1, /* enable all extentions to sytax. */ + format_no_copy = format_all << 1, /* don't copy non-matching segments. */ + format_first_only = format_no_copy << 1, /* Only replace first occurance. */ + format_is_if = format_first_only << 1, /* internal use only. */ + format_literal = format_is_if << 1 /* treat string as a literal */ } match_flags; @@ -96,10 +96,10 @@ inline match_flags& operator^=(match_flags& m1, match_flags m2) #endif #ifdef __cplusplus -} // namespace regex_constants -// -// import names into boost for backwards compatiblity: -// +} /* namespace regex_constants */ +/* + * import names into boost for backwards compatiblity: + */ using regex_constants::match_flag_type; using regex_constants::match_default; using regex_constants::match_not_bol; @@ -111,28 +111,28 @@ using regex_constants::match_not_eow; using regex_constants::match_not_dot_newline; using regex_constants::match_not_dot_null; using regex_constants::match_prev_avail; -//using regex_constants::match_init; +/* using regex_constants::match_init; */ using regex_constants::match_any; using regex_constants::match_not_null; using regex_constants::match_continuous; using regex_constants::match_partial; -//using regex_constants::match_stop; +/*using regex_constants::match_stop; */ using regex_constants::match_all; using regex_constants::match_perl; using regex_constants::match_posix; using regex_constants::match_nosubs; using regex_constants::match_extra; using regex_constants::match_single_line; -//using regex_constants::match_max; +/*using regex_constants::match_max; */ using regex_constants::format_all; using regex_constants::format_sed; using regex_constants::format_perl; using regex_constants::format_default; using regex_constants::format_no_copy; using regex_constants::format_first_only; -//using regex_constants::format_is_if; +/*using regex_constants::format_is_if;*/ -} // namespace boost -#endif // __cplusplus -#endif // include guard +} /* namespace boost */ +#endif /* __cplusplus */ +#endif /* include guard */ diff --git a/3rdParty/Boost/src/boost/regex/v4/match_results.hpp b/3rdParty/Boost/src/boost/regex/v4/match_results.hpp index acf509f..cd6b9eb 100644 --- a/3rdParty/Boost/src/boost/regex/v4/match_results.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/match_results.hpp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 1998-2002 + * Copyright (c) 1998-2009 * John Maddock * * Use, modification and distribution are subject to the @@ -36,6 +36,13 @@ namespace boost{ #pragma warning(disable : 4251 4231 4660) #endif +namespace re_detail{ + +template <class charT> +class named_subexpressions; + +} + template <class BidiIterator, class Allocator> class match_results { @@ -62,20 +69,35 @@ public: typedef typename re_detail::regex_iterator_traits< BidiIterator>::value_type char_type; typedef std::basic_string<char_type> string_type; + typedef re_detail::named_subexpressions_base<char_type> named_sub_type; // construct/copy/destroy: explicit match_results(const Allocator& a = Allocator()) #ifndef BOOST_NO_STD_ALLOCATOR - : m_subs(a), m_base() {} + : m_subs(a), m_base(), m_last_closed_paren(0), m_is_singular(true) {} #else - : m_subs(), m_base() { (void)a; } + : m_subs(), m_base(), m_last_closed_paren(0), m_is_singular(true) { (void)a; } #endif match_results(const match_results& m) - : m_subs(m.m_subs), m_base(m.m_base) {} + : m_subs(m.m_subs), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular) + { + if(!m_is_singular) + { + m_base = m.m_base; + m_null = m.m_null; + } + } match_results& operator=(const match_results& m) { m_subs = m.m_subs; - m_base = m.m_base; + m_named_subs = m.m_named_subs; + m_last_closed_paren = m.m_last_closed_paren; + m_is_singular = m.m_is_singular; + if(!m_is_singular) + { + m_base = m.m_base; + m_null = m.m_null; + } return *this; } ~match_results(){} @@ -90,13 +112,39 @@ public: // element access: difference_type length(int sub = 0) const { + if(m_is_singular) + raise_logic_error(); sub += 2; if((sub < (int)m_subs.size()) && (sub > 0)) return m_subs[sub].length(); return 0; } + difference_type length(const char_type* sub) const + { + if(m_is_singular) + raise_logic_error(); + const char_type* sub_end = sub; + while(*sub_end) ++sub_end; + return length(named_subexpression_index(sub, sub_end)); + } + template <class charT> + difference_type length(const charT* sub) const + { + if(m_is_singular) + raise_logic_error(); + const charT* sub_end = sub; + while(*sub_end) ++sub_end; + return length(named_subexpression_index(sub, sub_end)); + } + template <class charT, class Traits, class A> + difference_type length(const std::basic_string<charT, Traits, A>& sub) const + { + return length(sub.c_str()); + } difference_type position(size_type sub = 0) const { + if(m_is_singular) + raise_logic_error(); sub += 2; if(sub < m_subs.size()) { @@ -108,8 +156,28 @@ public: } return ~static_cast<difference_type>(0); } + difference_type position(const char_type* sub) const + { + const char_type* sub_end = sub; + while(*sub_end) ++sub_end; + return position(named_subexpression_index(sub, sub_end)); + } + template <class charT> + difference_type position(const charT* sub) const + { + const charT* sub_end = sub; + while(*sub_end) ++sub_end; + return position(named_subexpression_index(sub, sub_end)); + } + template <class charT, class Traits, class A> + difference_type position(const std::basic_string<charT, Traits, A>& sub) const + { + return position(sub.c_str()); + } string_type str(int sub = 0) const { + if(m_is_singular) + raise_logic_error(); sub += 2; string_type result; if(sub < (int)m_subs.size() && (sub > 0)) @@ -122,8 +190,29 @@ public: } return result; } + string_type str(const char_type* sub) const + { + return (*this)[sub].str(); + } + template <class Traits, class A> + string_type str(const std::basic_string<char_type, Traits, A>& sub) const + { + return (*this)[sub].str(); + } + template <class charT> + string_type str(const charT* sub) const + { + return (*this)[sub].str(); + } + template <class charT, class Traits, class A> + string_type str(const std::basic_string<charT, Traits, A>& sub) const + { + return (*this)[sub].str(); + } const_reference operator[](int sub) const { + if(m_is_singular && m_subs.empty()) + raise_logic_error(); sub += 2; if(sub < (int)m_subs.size() && (sub >= 0)) { @@ -131,14 +220,91 @@ public: } return m_null; } + // + // Named sub-expressions: + // + const_reference named_subexpression(const char_type* i, const char_type* j) const + { + if(m_is_singular) + raise_logic_error(); + int index = m_named_subs->get_id(i, j); + return index > 0 ? (*this)[index] : m_null; + } + template <class charT> + const_reference named_subexpression(const charT* i, const charT* j) const + { + BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type)); + if(i == j) + return m_null; + std::vector<char_type> s; + while(i != j) + s.insert(s.end(), *i++); + return named_subexpression(&*s.begin(), &*s.begin() + s.size()); + } + int named_subexpression_index(const char_type* i, const char_type* j) const + { + if(m_is_singular) + raise_logic_error(); + int index = m_named_subs->get_id(i, j); + return index > 0 ? index : -20; + } + template <class charT> + int named_subexpression_index(const charT* i, const charT* j) const + { + BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type)); + if(i == j) + return -20; + std::vector<char_type> s; + while(i != j) + s.insert(s.end(), *i++); + return named_subexpression_index(&*s.begin(), &*s.begin() + s.size()); + } + template <class Traits, class A> + const_reference operator[](const std::basic_string<char_type, Traits, A>& s) const + { + return named_subexpression(s.c_str(), s.c_str() + s.size()); + } + const_reference operator[](const char_type* p) const + { + const char_type* e = p; + while(*e) ++e; + return named_subexpression(p, e); + } + + template <class charT> + const_reference operator[](const charT* p) const + { + BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type)); + if(*p == 0) + return m_null; + std::vector<char_type> s; + while(*p) + s.insert(s.end(), *p++); + return named_subexpression(&*s.begin(), &*s.begin() + s.size()); + } + template <class charT, class Traits, class A> + const_reference operator[](const std::basic_string<charT, Traits, A>& ns) const + { + BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type)); + if(ns.empty()) + return m_null; + std::vector<char_type> s; + for(unsigned i = 0; i < ns.size(); ++i) + s.insert(s.end(), ns[i]); + return named_subexpression(&*s.begin(), &*s.begin() + s.size()); + } const_reference prefix() const { + if(m_is_singular) + raise_logic_error(); return (*this)[-1]; } const_reference suffix() const { + if(m_is_singular) + raise_logic_error(); return (*this)[-2]; } const_iterator begin() const @@ -150,43 +316,70 @@ public: return m_subs.end(); } // format: - template <class OutputIterator> + template <class OutputIterator, class Functor> OutputIterator format(OutputIterator out, - const string_type& fmt, + Functor fmt, match_flag_type flags = format_default) const { - re_detail::trivial_format_traits<char_type> traits; - return re_detail::regex_format_imp(out, *this, fmt.data(), fmt.data() + fmt.size(), flags, traits); + if(m_is_singular) + raise_logic_error(); + typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator>::type F; + F func(fmt); + return func(*this, out, flags); } - string_type format(const string_type& fmt, - match_flag_type flags = format_default) const + template <class Functor> + string_type format(Functor fmt, match_flag_type flags = format_default) const { - string_type result; - re_detail::string_out_iterator<string_type> i(result); - re_detail::trivial_format_traits<char_type> traits; - re_detail::regex_format_imp(i, *this, fmt.data(), fmt.data() + fmt.size(), flags, traits); + if(m_is_singular) + raise_logic_error(); + std::basic_string<char_type> result; + re_detail::string_out_iterator<std::basic_string<char_type> > i(result); + + typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, re_detail::string_out_iterator<std::basic_string<char_type> > >::type F; + F func(fmt); + + func(*this, i, flags); return result; } // format with locale: - template <class OutputIterator, class RegexT> + template <class OutputIterator, class Functor, class RegexT> OutputIterator format(OutputIterator out, - const string_type& fmt, + Functor fmt, match_flag_type flags, const RegexT& re) const { - return ::boost::re_detail::regex_format_imp(out, *this, fmt.data(), fmt.data() + fmt.size(), flags, re.get_traits()); + if(m_is_singular) + raise_logic_error(); + typedef ::boost::regex_traits_wrapper<typename RegexT::traits_type> traits_type; + typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, OutputIterator, traits_type>::type F; + F func(fmt); + return func(*this, out, flags, re.get_traits()); } - template <class RegexT> - string_type format(const string_type& fmt, + template <class RegexT, class Functor> + string_type format(Functor fmt, match_flag_type flags, const RegexT& re) const { - string_type result; - re_detail::string_out_iterator<string_type> i(result); - ::boost::re_detail::regex_format_imp(i, *this, fmt.data(), fmt.data() + fmt.size(), flags, re.get_traits()); + if(m_is_singular) + raise_logic_error(); + typedef ::boost::regex_traits_wrapper<typename RegexT::traits_type> traits_type; + std::basic_string<char_type> result; + re_detail::string_out_iterator<std::basic_string<char_type> > i(result); + + typedef typename re_detail::compute_functor_type<Functor, match_results<BidiIterator, Allocator>, re_detail::string_out_iterator<std::basic_string<char_type> >, traits_type >::type F; + F func(fmt); + + func(*this, i, flags, re.get_traits()); return result; } + const_reference get_last_closed_paren()const + { + if(m_is_singular) + raise_logic_error(); + return m_last_closed_paren == 0 ? m_null : (*this)[m_last_closed_paren]; + } + allocator_type get_allocator() const { #ifndef BOOST_NO_STD_ALLOCATOR @@ -198,11 +391,39 @@ public: void swap(match_results& that) { std::swap(m_subs, that.m_subs); - std::swap(m_base, that.m_base); + std::swap(m_named_subs, that.m_named_subs); + std::swap(m_last_closed_paren, that.m_last_closed_paren); + std::swap(m_is_singular, that.m_is_singular); + if(m_is_singular) + { + if(!that.m_is_singular) + { + m_base = that.m_base; + m_null = that.m_null; + } + } + else if(that.m_is_singular) + { + that.m_base = m_base; + that.m_null = m_null; + } + else + { + std::swap(m_base, that.m_base); + std::swap(m_null, that.m_null); + } } bool operator==(const match_results& that)const { - return (m_subs == that.m_subs) && (m_base == that.m_base); + if(m_is_singular) + { + return that.m_is_singular; + } + else if(that.m_is_singular) + { + return false; + } + return (m_subs == that.m_subs) && (m_base == that.m_base) && (m_last_closed_paren == that.m_last_closed_paren); } bool operator!=(const match_results& that)const { return !(*this == that); } @@ -212,6 +433,8 @@ public: const capture_sequence_type& captures(int i)const { + if(m_is_singular) + raise_logic_error(); return (*this)[i].captures(); } #endif @@ -228,21 +451,25 @@ public: m_null.first = i; m_null.second = i; m_null.matched = false; + m_is_singular = false; } - void BOOST_REGEX_CALL set_second(BidiIterator i, size_type pos, bool m = true) + void BOOST_REGEX_CALL set_second(BidiIterator i, size_type pos, bool m = true, bool escape_k = false) { + if(pos) + m_last_closed_paren = pos; pos += 2; BOOST_ASSERT(m_subs.size() > pos); m_subs[pos].second = i; m_subs[pos].matched = m; - if(pos == 2) + if((pos == 2) && !escape_k) { m_subs[0].first = i; m_subs[0].matched = (m_subs[0].first != m_subs[0].second); m_null.first = i; m_null.second = i; m_null.matched = false; + m_is_singular = false; } } void BOOST_REGEX_CALL set_size(size_type n, BidiIterator i, BidiIterator j) @@ -261,6 +488,7 @@ public: m_subs.insert(m_subs.end(), n+2-len, v); } m_subs[1].first = i; + m_last_closed_paren = 0; } void BOOST_REGEX_CALL set_base(BidiIterator pos) { @@ -272,6 +500,7 @@ public: } void BOOST_REGEX_CALL set_first(BidiIterator i) { + BOOST_ASSERT(m_subs.size() > 2); // set up prefix: m_subs[1].second = i; m_subs[1].matched = (m_subs[1].first != i); @@ -284,26 +513,55 @@ public: m_subs[n].matched = false; } } - void BOOST_REGEX_CALL set_first(BidiIterator i, size_type pos) + void BOOST_REGEX_CALL set_first(BidiIterator i, size_type pos, bool escape_k = false) { BOOST_ASSERT(pos+2 < m_subs.size()); - if(pos) + if(pos || escape_k) + { m_subs[pos+2].first = i; + if(escape_k) + { + m_subs[1].second = i; + m_subs[1].matched = (m_subs[1].first != m_subs[1].second); + } + } else set_first(i); } void BOOST_REGEX_CALL maybe_assign(const match_results<BidiIterator, Allocator>& m); + void BOOST_REGEX_CALL set_named_subs(boost::shared_ptr<named_sub_type> subs) + { + m_named_subs = subs; + } private: - vector_type m_subs; // subexpressions - BidiIterator m_base; // where the search started from - sub_match<BidiIterator> m_null; // a null match + // + // Error handler called when an uninitialized match_results is accessed: + // + static void raise_logic_error() + { + std::logic_error e("Attempt to access an uninitialzed boost::match_results<> class."); + boost::throw_exception(e); + } + + + vector_type m_subs; // subexpressions + BidiIterator m_base; // where the search started from + sub_match<BidiIterator> m_null; // a null match + boost::shared_ptr<named_sub_type> m_named_subs; // Shared copy of named subs in the regex object + int m_last_closed_paren; // Last ) to be seen - used for formatting + bool m_is_singular; // True if our stored iterators are singular }; template <class BidiIterator, class Allocator> void BOOST_REGEX_CALL match_results<BidiIterator, Allocator>::maybe_assign(const match_results<BidiIterator, Allocator>& m) { + if(m_is_singular) + { + *this = m; + return; + } const_iterator p1, p2; p1 = begin(); p2 = m.begin(); diff --git a/3rdParty/Boost/src/boost/regex/v4/perl_matcher.hpp b/3rdParty/Boost/src/boost/regex/v4/perl_matcher.hpp index 33afe6e..52e0bce 100644 --- a/3rdParty/Boost/src/boost/regex/v4/perl_matcher.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/perl_matcher.hpp @@ -61,7 +61,7 @@ inline bool can_start(unsigned short c, const unsigned char* map, unsigned char { return ((c >= (1 << CHAR_BIT)) ? true : map[c] & mask); } -#if !defined(__hpux) // WCHAR_MIN not usable in pp-directives. +#if !defined(__hpux) && !defined(__WINSCW__)// WCHAR_MIN not usable in pp-directives. #if defined(WCHAR_MIN) && (WCHAR_MIN == 0) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) inline bool can_start(wchar_t c, const unsigned char* map, unsigned char mask) { @@ -277,15 +277,21 @@ public: else { repeater_count* p = next; - while(p->state_id != state_id) + while(p && (p->state_id != state_id)) p = p->next; - count = p->count; - start_pos = p->start_pos; + if(p) + { + count = p->count; + start_pos = p->start_pos; + } + else + count = 0; } } ~repeater_count() { - *stack = next; + if(next) + *stack = next; } std::size_t get_count() { return count; } int get_id() { return state_id; } @@ -325,6 +331,17 @@ enum saved_state_type saved_state_count = 14 }; +template <class Results> +struct recursion_info +{ + typedef typename Results::value_type value_type; + typedef typename value_type::iterator iterator; + int id; + const re_syntax_base* preturn_address; + Results results; + repeater_count<iterator>* repeater_stack; +}; + #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable : 4251 4231 4660) @@ -340,6 +357,7 @@ public: typedef std::size_t traits_size_type; typedef typename is_byte<char_type>::width_type width_type; typedef typename regex_iterator_traits<BidiIterator>::difference_type difference_type; + typedef match_results<BidiIterator, Allocator> results_type; perl_matcher(BidiIterator first, BidiIterator end, match_results<BidiIterator, Allocator>& what, @@ -348,7 +366,7 @@ public: BidiIterator l_base) : m_result(what), base(first), last(end), position(first), backstop(l_base), re(e), traits_inst(e.get_traits()), - m_independent(false), next_count(&rep_obj), rep_obj(&next_count) + m_independent(false), next_count(&rep_obj), rep_obj(&next_count), recursion_stack_position(0) { construct_init(e, f); } @@ -403,12 +421,17 @@ private: bool match_char_repeat(); bool match_dot_repeat_fast(); bool match_dot_repeat_slow(); + bool match_dot_repeat_dispatch() + { + return ::boost::is_random_access_iterator<BidiIterator>::value ? match_dot_repeat_fast() : match_dot_repeat_slow(); + } bool match_backstep(); bool match_assert_backref(); bool match_toggle_case(); #ifdef BOOST_REGEX_RECURSIVE bool backtrack_till_match(std::size_t count); #endif + bool match_recursion(); // find procs stored in s_find_vtable: bool find_restart_any(); @@ -464,6 +487,9 @@ private: typename traits::char_class_type m_word_mask; // the bitmask to use when determining whether a match_any matches a newline or not: unsigned char match_any_mask; + // recursion information: + recursion_info<results_type> recursion_stack[50]; + unsigned recursion_stack_position; #ifdef BOOST_REGEX_NON_RECURSIVE // @@ -487,6 +513,8 @@ private: bool unwind_short_set_repeat(bool); bool unwind_long_set_repeat(bool); bool unwind_non_greedy_repeat(bool); + bool unwind_recursion(bool); + bool unwind_recursion_pop(bool); void destroy_single_repeat(); void push_matched_paren(int index, const sub_match<BidiIterator>& sub); void push_recursion_stopper(); @@ -495,7 +523,8 @@ private: void push_repeater_count(int i, repeater_count<BidiIterator>** s); void push_single_repeat(std::size_t c, const re_repeat* r, BidiIterator last_position, int state_id); void push_non_greedy_repeat(const re_syntax_base* ps); - + void push_recursion(int id, const re_syntax_base* p, results_type* presults); + void push_recursion_pop(); // pointer to base of stack: saved_state* m_stack_base; diff --git a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_common.hpp b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_common.hpp index 399caa3..fd439f8 100644 --- a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_common.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_common.hpp @@ -200,12 +200,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_imp() m_match_flags |= regex_constants::match_all; m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last); m_presult->set_base(base); + m_presult->set_named_subs(re_detail::convert_to_named_subs<typename match_results<BidiIterator>::char_type>(this->re.get_named_subs())); if(m_match_flags & match_posix) m_result = *m_presult; verify_options(re.flags(), m_match_flags); if(0 == match_prefix()) return false; - return m_result[0].second == last; + return (m_result[0].second == last) && (m_result[0].first == base); #if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_NO_EXCEPTIONS) } @@ -261,6 +262,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_imp() pstate = re.get_first_state(); m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), base, last); m_presult->set_base(base); + m_presult->set_named_subs(re_detail::convert_to_named_subs<typename match_results<BidiIterator>::char_type>(this->re.get_named_subs())); m_match_flags |= regex_constants::match_init; } else @@ -344,25 +346,6 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_prefix() } template <class BidiIterator, class Allocator, class traits> -bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark() -{ - int index = static_cast<const re_brace*>(pstate)->index; - if(index > 0) - { - if((m_match_flags & match_nosubs) == 0) - m_presult->set_second(position, index); - } - else if((index < 0) && (index != -4)) - { - // matched forward lookahead: - pstate = 0; - return true; - } - pstate = pstate->next.p; - return true; -} - -template <class BidiIterator, class Allocator, class traits> bool perl_matcher<BidiIterator, Allocator, traits>::match_literal() { unsigned int len = static_cast<const re_literal*>(pstate)->length; @@ -463,35 +446,6 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_wild() } template <class BidiIterator, class Allocator, class traits> -bool perl_matcher<BidiIterator, Allocator, traits>::match_match() -{ - if((m_match_flags & match_not_null) && (position == (*m_presult)[0].first)) - return false; - if((m_match_flags & match_all) && (position != last)) - return false; - if((m_match_flags & regex_constants::match_not_initial_null) && (position == search_base)) - return false; - m_presult->set_second(position); - pstate = 0; - m_has_found_match = true; - if((m_match_flags & match_posix) == match_posix) - { - m_result.maybe_assign(*m_presult); - if((m_match_flags & match_any) == 0) - return false; - } -#ifdef BOOST_REGEX_MATCH_EXTRA - if(match_extra & m_match_flags) - { - for(unsigned i = 0; i < m_presult->size(); ++i) - if((*m_presult)[i].matched) - ((*m_presult)[i]).get_captures().push_back((*m_presult)[i]); - } -#endif - return true; -} - -template <class BidiIterator, class Allocator, class traits> bool perl_matcher<BidiIterator, Allocator, traits>::match_word_boundary() { bool b; // indcates whether next character is a word character @@ -758,8 +712,32 @@ template <class BidiIterator, class Allocator, class traits> inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref() { // return true if marked sub-expression N has been matched: - bool result = (*m_presult)[static_cast<const re_brace*>(pstate)->index].matched; - pstate = pstate->next.p; + int index = static_cast<const re_brace*>(pstate)->index; + bool result; + if(index == 9999) + { + // Magic value for a (DEFINE) block: + return false; + } + else if(index > 0) + { + // Check if index is a hash value: + if(index >= 10000) + index = re.get_data().get_id(index); + // Have we matched subexpression "index"? + result = (*m_presult)[index].matched; + pstate = pstate->next.p; + } + else + { + // Have we recursed into subexpression "index"? + // If index == 0 then check for any recursion at all, otherwise for recursion to -index-1. + int id = -index-1; + if(id >= 10000) + id = re.get_data().get_id(id); + result = recursion_stack_position && ((recursion_stack[recursion_stack_position-1].id == id) || (index == 0)); + pstate = pstate->next.p; + } return result; } diff --git a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp index 10e0347..0fcd454 100644 --- a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -127,10 +127,21 @@ struct saved_single_repeat : public saved_state : saved_state(arg_id), count(c), rep(r), last_position(lp){} }; +template <class Results> +struct saved_recursion : public saved_state +{ + saved_recursion(int id, const re_syntax_base* p, Results* pr) + : saved_state(14), recursion_id(id), preturn_address(p), results(*pr) + {} + int recursion_id; + const re_syntax_base* preturn_address; + Results results; +}; + template <class BidiIterator, class Allocator, class traits> bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states() { - static matcher_proc_type const s_match_vtable[29] = + static matcher_proc_type const s_match_vtable[30] = { (&perl_matcher<BidiIterator, Allocator, traits>::match_startmark), &perl_matcher<BidiIterator, Allocator, traits>::match_endmark, @@ -154,13 +165,18 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states() &perl_matcher<BidiIterator, Allocator, traits>::match_combining, &perl_matcher<BidiIterator, Allocator, traits>::match_soft_buffer_end, &perl_matcher<BidiIterator, Allocator, traits>::match_restart_continue, - (::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow), + // Although this next line *should* be evaluated at compile time, in practice + // some compilers (VC++) emit run-time initialisation which breaks thread + // safety, so use a dispatch function instead: + //(::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow), + &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_dispatch, &perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat, &perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat, &perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat, &perl_matcher<BidiIterator, Allocator, traits>::match_backstep, &perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref, &perl_matcher<BidiIterator, Allocator, traits>::match_toggle_case, + &perl_matcher<BidiIterator, Allocator, traits>::match_recursion, }; push_recursion_stopper(); @@ -172,7 +188,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states() if(!(this->*proc)()) { if(state_count > max_state_count) - raise_error(traits_inst, regex_constants::error_space); + raise_error(traits_inst, regex_constants::error_complexity); if((m_match_flags & match_partial) && (position == last) && (position != search_base)) m_has_partial_match = true; bool successful_unwind = unwind(false); @@ -203,13 +219,13 @@ void perl_matcher<BidiIterator, Allocator, traits>::extend_stack() m_backup_state = block; } else - raise_error(traits_inst, regex_constants::error_size); + raise_error(traits_inst, regex_constants::error_stack); } template <class BidiIterator, class Allocator, class traits> inline void perl_matcher<BidiIterator, Allocator, traits>::push_matched_paren(int index, const sub_match<BidiIterator>& sub) { - BOOST_ASSERT(index); + //BOOST_ASSERT(index); saved_matched_paren<BidiIterator>* pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state); --pmp; if(pmp < m_stack_base) @@ -313,9 +329,25 @@ inline void perl_matcher<BidiIterator, Allocator, traits>::push_single_repeat(st } template <class BidiIterator, class Allocator, class traits> +inline void perl_matcher<BidiIterator, Allocator, traits>::push_recursion(int id, const re_syntax_base* p, results_type* presults) +{ + saved_recursion<results_type>* pmp = static_cast<saved_recursion<results_type>*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast<saved_recursion<results_type>*>(m_backup_state); + --pmp; + } + (void) new (pmp)saved_recursion<results_type>(id, p, presults); + m_backup_state = pmp; +} + +template <class BidiIterator, class Allocator, class traits> bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark() { int index = static_cast<const re_brace*>(pstate)->index; + icase = static_cast<const re_brace*>(pstate)->icase; switch(index) { case 0: @@ -400,6 +432,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark() break; } } + case -5: + { + push_matched_paren(0, (*m_presult)[0]); + m_presult->set_first(position, 0, true); + pstate = pstate->next.p; + break; + } default: { BOOST_ASSERT(index > 0); @@ -848,6 +887,105 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat() #endif } +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion() +{ + BOOST_ASSERT(pstate->type == syntax_element_recurse); + // + // Backup call stack: + // + push_recursion_pop(); + // + // Set new call stack: + // + if(recursion_stack_position >= static_cast<int>(sizeof(recursion_stack)/sizeof(recursion_stack[0]))) + { + return false; + } + recursion_stack[recursion_stack_position].preturn_address = pstate->next.p; + recursion_stack[recursion_stack_position].results = *m_presult; + if(static_cast<const re_recurse*>(pstate)->state_id > 0) + { + push_repeater_count(static_cast<const re_recurse*>(pstate)->state_id, &next_count); + } + pstate = static_cast<const re_jump*>(pstate)->alt.p; + recursion_stack[recursion_stack_position].id = static_cast<const re_brace*>(pstate)->index; + ++recursion_stack_position; + //BOOST_ASSERT(recursion_stack[recursion_stack_position-1].id); + + return true; +} + +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark() +{ + int index = static_cast<const re_brace*>(pstate)->index; + icase = static_cast<const re_brace*>(pstate)->icase; + if(index > 0) + { + if((m_match_flags & match_nosubs) == 0) + { + m_presult->set_second(position, index); + } + if(recursion_stack_position) + { + if(index == recursion_stack[recursion_stack_position-1].id) + { + --recursion_stack_position; + pstate = recursion_stack[recursion_stack_position].preturn_address; + *m_presult = recursion_stack[recursion_stack_position].results; + push_recursion(recursion_stack[recursion_stack_position].id, recursion_stack[recursion_stack_position].preturn_address, &recursion_stack[recursion_stack_position].results); + } + } + } + else if((index < 0) && (index != -4)) + { + // matched forward lookahead: + pstate = 0; + return true; + } + pstate = pstate->next.p; + return true; +} + +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::match_match() +{ + if(recursion_stack_position) + { + BOOST_ASSERT(0 == recursion_stack[recursion_stack_position-1].id); + --recursion_stack_position; + pstate = recursion_stack[recursion_stack_position].preturn_address; + *m_presult = recursion_stack[recursion_stack_position].results; + push_recursion(recursion_stack[recursion_stack_position].id, recursion_stack[recursion_stack_position].preturn_address, &recursion_stack[recursion_stack_position].results); + return true; + } + if((m_match_flags & match_not_null) && (position == (*m_presult)[0].first)) + return false; + if((m_match_flags & match_all) && (position != last)) + return false; + if((m_match_flags & regex_constants::match_not_initial_null) && (position == search_base)) + return false; + m_presult->set_second(position); + pstate = 0; + m_has_found_match = true; + if((m_match_flags & match_posix) == match_posix) + { + m_result.maybe_assign(*m_presult); + if((m_match_flags & match_any) == 0) + return false; + } +#ifdef BOOST_REGEX_MATCH_EXTRA + if(match_extra & m_match_flags) + { + for(unsigned i = 0; i < m_presult->size(); ++i) + if((*m_presult)[i].matched) + ((*m_presult)[i]).get_captures().push_back((*m_presult)[i]); + } +#endif + return true; +} + /**************************************************************************** Unwind and associated proceedures follow, these perform what normal stack @@ -858,7 +996,7 @@ unwinding does in the recursive implementation. template <class BidiIterator, class Allocator, class traits> bool perl_matcher<BidiIterator, Allocator, traits>::unwind(bool have_match) { - static unwind_proc_type const s_unwind_table[14] = + static unwind_proc_type const s_unwind_table[18] = { &perl_matcher<BidiIterator, Allocator, traits>::unwind_end, &perl_matcher<BidiIterator, Allocator, traits>::unwind_paren, @@ -874,6 +1012,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind(bool have_match) &perl_matcher<BidiIterator, Allocator, traits>::unwind_short_set_repeat, &perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat, &perl_matcher<BidiIterator, Allocator, traits>::unwind_non_greedy_repeat, + &perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion, + &perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_pop, }; m_recursive_result = have_match; @@ -907,8 +1047,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_paren(bool have_match // restore previous values if no match was found: if(have_match == false) { - m_presult->set_first(pmp->sub.first, pmp->index); - m_presult->set_second(pmp->sub.second, pmp->index, pmp->sub.matched); + m_presult->set_first(pmp->sub.first, pmp->index, pmp->index == 0); + m_presult->set_second(pmp->sub.second, pmp->index, pmp->sub.matched, pmp->index == 0); } #ifdef BOOST_REGEX_MATCH_EXTRA // @@ -1377,6 +1517,106 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_non_greedy_repeat(boo return r; } +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion(bool r) +{ + saved_recursion<results_type>* pmp = static_cast<saved_recursion<results_type>*>(m_backup_state); + if(!r) + { + recursion_stack[recursion_stack_position].id = pmp->recursion_id; + recursion_stack[recursion_stack_position].preturn_address = pmp->preturn_address; + recursion_stack[recursion_stack_position].results = pmp->results; + ++recursion_stack_position; + } + boost::re_detail::inplace_destroy(pmp++); + m_backup_state = pmp; + return true; +} + +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_pop(bool r) +{ + saved_state* pmp = static_cast<saved_state*>(m_backup_state); + if(!r) + { + --recursion_stack_position; + } + boost::re_detail::inplace_destroy(pmp++); + m_backup_state = pmp; + return true; +} + +template <class BidiIterator, class Allocator, class traits> +void perl_matcher<BidiIterator, Allocator, traits>::push_recursion_pop() +{ + saved_state* pmp = static_cast<saved_state*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast<saved_state*>(m_backup_state); + --pmp; + } + (void) new (pmp)saved_state(15); + m_backup_state = pmp; +} +/* +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_pop(bool r) +{ + saved_state* pmp = static_cast<saved_state*>(m_backup_state); + if(!r) + { + --parenthesis_stack_position; + } + boost::re_detail::inplace_destroy(pmp++); + m_backup_state = pmp; + return true; +} + +template <class BidiIterator, class Allocator, class traits> +void perl_matcher<BidiIterator, Allocator, traits>::push_parenthesis_pop() +{ + saved_state* pmp = static_cast<saved_state*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast<saved_state*>(m_backup_state); + --pmp; + } + (void) new (pmp)saved_state(16); + m_backup_state = pmp; +} + +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_push(bool r) +{ + saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state); + if(!r) + { + parenthesis_stack[parenthesis_stack_position++] = pmp->position; + } + boost::re_detail::inplace_destroy(pmp++); + m_backup_state = pmp; + return true; +} + +template <class BidiIterator, class Allocator, class traits> +inline void perl_matcher<BidiIterator, Allocator, traits>::push_parenthesis_push(BidiIterator p) +{ + saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state); + --pmp; + if(pmp < m_stack_base) + { + extend_stack(); + pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state); + --pmp; + } + (void) new (pmp)saved_position<BidiIterator>(0, p, 17); + m_backup_state = pmp; +} +*/ } // namespace re_detail } // namespace boost diff --git a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_recursive.hpp b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_recursive.hpp index 68e1aac..d0de802 100644 --- a/3rdParty/Boost/src/boost/regex/v4/perl_matcher_recursive.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/perl_matcher_recursive.hpp @@ -51,8 +51,8 @@ public: template <class A> void restore(match_results<BidiIterator, A>& w) { - w.set_first(sub.first, index); - w.set_second(sub.second, index, sub.matched); + w.set_first(sub.first, index, index == 0); + w.set_second(sub.second, index, sub.matched, index == 0); } const sub_match<BidiIterator>& get() { return sub; } }; @@ -60,7 +60,7 @@ public: template <class BidiIterator, class Allocator, class traits> bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states() { - static matcher_proc_type const s_match_vtable[29] = + static matcher_proc_type const s_match_vtable[30] = { (&perl_matcher<BidiIterator, Allocator, traits>::match_startmark), &perl_matcher<BidiIterator, Allocator, traits>::match_endmark, @@ -84,17 +84,22 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states() &perl_matcher<BidiIterator, Allocator, traits>::match_combining, &perl_matcher<BidiIterator, Allocator, traits>::match_soft_buffer_end, &perl_matcher<BidiIterator, Allocator, traits>::match_restart_continue, - (::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow), + // Although this next line *should* be evaluated at compile time, in practice + // some compilers (VC++) emit run-time initialisation which breaks thread + // safety, so use a dispatch function instead: + //(::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow), + &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_dispatch, &perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat, &perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat, &perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat, &perl_matcher<BidiIterator, Allocator, traits>::match_backstep, &perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref, &perl_matcher<BidiIterator, Allocator, traits>::match_toggle_case, + &perl_matcher<BidiIterator, Allocator, traits>::match_recursion, }; if(state_count > max_state_count) - raise_error(traits_inst, regex_constants::error_space); + raise_error(traits_inst, regex_constants::error_complexity); while(pstate) { matcher_proc_type proc = s_match_vtable[pstate->type]; @@ -113,6 +118,7 @@ template <class BidiIterator, class Allocator, class traits> bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark() { int index = static_cast<const re_brace*>(pstate)->index; + icase = static_cast<const re_brace*>(pstate)->icase; bool r = true; switch(index) { @@ -205,6 +211,17 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark() break; } } + case -5: + { + // Reset start of $0, since we have a \K escape + backup_subex<BidiIterator> sub(*m_presult, 0); + m_presult->set_first(position, 0, true); + pstate = pstate->next.p; + r = match_all_states(); + if(r == false) + sub.restore(*m_presult); + break; + } default: { BOOST_ASSERT(index > 0); @@ -833,6 +850,127 @@ bool perl_matcher<BidiIterator, Allocator, traits>::backtrack_till_match(std::si #endif } +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion() +{ + BOOST_ASSERT(pstate->type == syntax_element_recurse); + // + // Set new call stack: + // + if(recursion_stack_position >= static_cast<int>(sizeof(recursion_stack)/sizeof(recursion_stack[0]))) + { + return false; + } + recursion_stack[recursion_stack_position].preturn_address = pstate->next.p; + recursion_stack[recursion_stack_position].results = *m_presult; + recursion_stack[recursion_stack_position].repeater_stack = next_count; + pstate = static_cast<const re_jump*>(pstate)->alt.p; + recursion_stack[recursion_stack_position].id = static_cast<const re_brace*>(pstate)->index; + ++recursion_stack_position; + + repeater_count<BidiIterator>* saved = next_count; + repeater_count<BidiIterator> r(&next_count); // resets all repeat counts since we're recursing and starting fresh on those + next_count = &r; + bool result = match_all_states(); + next_count = saved; + + if(!result) + { + --recursion_stack_position; + next_count = recursion_stack[recursion_stack_position].repeater_stack; + *m_presult = recursion_stack[recursion_stack_position].results; + return false; + } + return true; +} + +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark() +{ + int index = static_cast<const re_brace*>(pstate)->index; + icase = static_cast<const re_brace*>(pstate)->icase; + if(index > 0) + { + if((m_match_flags & match_nosubs) == 0) + { + m_presult->set_second(position, index); + } + if(recursion_stack_position) + { + if(index == recursion_stack[recursion_stack_position-1].id) + { + --recursion_stack_position; + recursion_info<results_type> saved = recursion_stack[recursion_stack_position]; + const re_syntax_base* saved_state = pstate = saved.preturn_address; + repeater_count<BidiIterator>* saved_count = next_count; + next_count = saved.repeater_stack; + *m_presult = saved.results; + if(!match_all_states()) + { + recursion_stack[recursion_stack_position] = saved; + ++recursion_stack_position; + next_count = saved_count; + return false; + } + } + } + } + else if((index < 0) && (index != -4)) + { + // matched forward lookahead: + pstate = 0; + return true; + } + pstate = pstate ? pstate->next.p : 0; + return true; +} + +template <class BidiIterator, class Allocator, class traits> +bool perl_matcher<BidiIterator, Allocator, traits>::match_match() +{ + if(recursion_stack_position) + { + BOOST_ASSERT(0 == recursion_stack[recursion_stack_position-1].id); + --recursion_stack_position; + const re_syntax_base* saved_state = pstate = recursion_stack[recursion_stack_position].preturn_address; + *m_presult = recursion_stack[recursion_stack_position].results; + if(!match_all_states()) + { + recursion_stack[recursion_stack_position].preturn_address = saved_state; + recursion_stack[recursion_stack_position].results = *m_presult; + ++recursion_stack_position; + return false; + } + return true; + } + if((m_match_flags & match_not_null) && (position == (*m_presult)[0].first)) + return false; + if((m_match_flags & match_all) && (position != last)) + return false; + if((m_match_flags & regex_constants::match_not_initial_null) && (position == search_base)) + return false; + m_presult->set_second(position); + pstate = 0; + m_has_found_match = true; + if((m_match_flags & match_posix) == match_posix) + { + m_result.maybe_assign(*m_presult); + if((m_match_flags & match_any) == 0) + return false; + } +#ifdef BOOST_REGEX_MATCH_EXTRA + if(match_extra & m_match_flags) + { + for(unsigned i = 0; i < m_presult->size(); ++i) + if((*m_presult)[i].matched) + ((*m_presult)[i]).get_captures().push_back((*m_presult)[i]); + } +#endif + return true; +} + + + } // namespace re_detail } // namespace boost #ifdef BOOST_MSVC diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp index d114c2e..0ca9baa 100644 --- a/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp @@ -1,7 +1,7 @@ /* * - * Copyright (c) 1998-2002 - * John Maddock + * Copyright (c) 1998-2009 John Maddock + * Copyright 2008 Eric Niebler. * * Use, modification and distribution are subject to the * Boost Software License, Version 1.0. (See accompanying file @@ -21,6 +21,19 @@ #ifndef BOOST_REGEX_FORMAT_HPP #define BOOST_REGEX_FORMAT_HPP +#include <boost/type_traits/is_pointer.hpp> +#include <boost/type_traits/is_function.hpp> +#include <boost/type_traits/is_class.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/type_traits/is_convertible.hpp> +#include <boost/type_traits/remove_pointer.hpp> +#include <boost/type_traits/remove_cv.hpp> +#include <boost/mpl/if.hpp> +#include <boost/mpl/and.hpp> +#include <boost/mpl/not.hpp> +#ifndef BOOST_NO_SFINAE +#include <boost/mpl/has_xxx.hpp> +#endif namespace boost{ @@ -76,15 +89,15 @@ struct trivial_format_traits } }; -template <class OutputIterator, class Results, class traits> +template <class OutputIterator, class Results, class traits, class ForwardIter> class basic_regex_formatter { public: typedef typename traits::char_type char_type; basic_regex_formatter(OutputIterator o, const Results& r, const traits& t) : m_traits(t), m_results(r), m_out(o), m_state(output_copy), m_restore_state(output_copy), m_have_conditional(false) {} - OutputIterator format(const char_type* p1, const char_type* p2, match_flag_type f); - OutputIterator format(const char_type* p1, match_flag_type f) + OutputIterator format(ForwardIter p1, ForwardIter p2, match_flag_type f); + OutputIterator format(ForwardIter p1, match_flag_type f) { return format(p1, p1 + m_traits.length(p1), f); } @@ -107,23 +120,77 @@ private: void format_escape(); void format_conditional(); void format_until_scope_end(); + bool handle_perl_verb(bool have_brace); - const traits& m_traits; // the traits class for localised formatting operations - const Results& m_results; // the match_results being used. - OutputIterator m_out; // where to send output. - const char_type* m_position; // format string, current position - const char_type* m_end; // format string end - match_flag_type m_flags; // format flags to use - output_state m_state; // what to do with the next character - output_state m_restore_state; // what state to restore to. - bool m_have_conditional; // we are parsing a conditional + inline typename Results::value_type const& get_named_sub(ForwardIter i, ForwardIter j, const mpl::false_&) + { + std::vector<char_type> v(i, j); + return (i != j) ? this->m_results.named_subexpression(&v[0], &v[0] + v.size()) + : this->m_results.named_subexpression(static_cast<const char_type*>(0), static_cast<const char_type*>(0)); + } + inline typename Results::value_type const& get_named_sub(ForwardIter i, ForwardIter j, const mpl::true_&) + { + return this->m_results.named_subexpression(i, j); + } + inline typename Results::value_type const& get_named_sub(ForwardIter i, ForwardIter j) + { + typedef typename boost::is_convertible<ForwardIter, const char_type*>::type tag_type; + return get_named_sub(i, j, tag_type()); + } + inline int get_named_sub_index(ForwardIter i, ForwardIter j, const mpl::false_&) + { + std::vector<char_type> v(i, j); + return (i != j) ? this->m_results.named_subexpression_index(&v[0], &v[0] + v.size()) + : this->m_results.named_subexpression_index(static_cast<const char_type*>(0), static_cast<const char_type*>(0)); + } + inline int get_named_sub_index(ForwardIter i, ForwardIter j, const mpl::true_&) + { + return this->m_results.named_subexpression_index(i, j); + } + inline int get_named_sub_index(ForwardIter i, ForwardIter j) + { + typedef typename boost::is_convertible<ForwardIter, const char_type*>::type tag_type; + return get_named_sub_index(i, j, tag_type()); + } + inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::false_&) + { + if(i != j) + { + std::vector<char_type> v(i, j); + const char_type* start = &v[0]; + const char_type* pos = start; + int r = m_traits.toi(pos, &v[0] + v.size(), base); + std::advance(i, pos - start); + return r; + } + return -1; + } + inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::true_&) + { + return m_traits.toi(i, j, base); + } + inline int toi(ForwardIter& i, ForwardIter j, int base) + { + typedef typename boost::is_convertible<ForwardIter, const char_type*&>::type tag_type; + return toi(i, j, base, tag_type()); + } + + const traits& m_traits; // the traits class for localised formatting operations + const Results& m_results; // the match_results being used. + OutputIterator m_out; // where to send output. + ForwardIter m_position; // format string, current position + ForwardIter m_end; // format string end + match_flag_type m_flags; // format flags to use + output_state m_state; // what to do with the next character + output_state m_restore_state; // what state to restore to. + bool m_have_conditional; // we are parsing a conditional private: basic_regex_formatter(const basic_regex_formatter&); basic_regex_formatter& operator=(const basic_regex_formatter&); }; -template <class OutputIterator, class Results, class traits> -OutputIterator basic_regex_formatter<OutputIterator, Results, traits>::format(const char_type* p1, const char_type* p2, match_flag_type f) +template <class OutputIterator, class Results, class traits, class ForwardIter> +OutputIterator basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format(ForwardIter p1, ForwardIter p2, match_flag_type f) { m_position = p1; m_end = p2; @@ -132,8 +199,8 @@ OutputIterator basic_regex_formatter<OutputIterator, Results, traits>::format(co return m_out; } -template <class OutputIterator, class Results, class traits> -void basic_regex_formatter<OutputIterator, Results, traits>::format_all() +template <class OutputIterator, class Results, class traits, class ForwardIter> +void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format_all() { // over and over: while(m_position != m_end) @@ -210,8 +277,8 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_all() } } -template <class OutputIterator, class Results, class traits> -void basic_regex_formatter<OutputIterator, Results, traits>::format_perl() +template <class OutputIterator, class Results, class traits, class ForwardIter> +void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format_perl() { // // On entry *m_position points to a '$' character @@ -232,7 +299,7 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_perl() // OK find out what kind it is: // bool have_brace = false; - const char_type* save_position = m_position; + ForwardIter save_position = m_position; switch(*m_position) { case '&': @@ -250,6 +317,25 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_perl() case '$': put(*m_position++); break; + case '+': + if((++m_position != m_end) && (*m_position == '{')) + { + ForwardIter base = ++m_position; + while((m_position != m_end) && (*m_position != '}')) ++m_position; + if(m_position != m_end) + { + // Named sub-expression: + put(get_named_sub(base, m_position)); + ++m_position; + break; + } + else + { + m_position = --base; + } + } + put((this->m_results)[this->m_results.size() > 1 ? this->m_results.size() - 1 : 1]); + break; case '{': have_brace = true; ++m_position; @@ -258,14 +344,18 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_perl() // see if we have a number: { std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); - len = (std::min)(static_cast<std::ptrdiff_t>(2), len); - int v = m_traits.toi(m_position, m_position + len, 10); + //len = (std::min)(static_cast<std::ptrdiff_t>(2), len); + int v = this->toi(m_position, m_position + len, 10); if((v < 0) || (have_brace && ((m_position == m_end) || (*m_position != '}')))) { - // leave the $ as is, and carry on: - m_position = --save_position; - put(*m_position); - ++m_position; + // Look for a Perl-5.10 verb: + if(!handle_perl_verb(have_brace)) + { + // leave the $ as is, and carry on: + m_position = --save_position; + put(*m_position); + ++m_position; + } break; } // otherwise output sub v: @@ -276,8 +366,127 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_perl() } } -template <class OutputIterator, class Results, class traits> -void basic_regex_formatter<OutputIterator, Results, traits>::format_escape() +template <class OutputIterator, class Results, class traits, class ForwardIter> +bool basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::handle_perl_verb(bool have_brace) +{ + // + // We may have a capitalised string containing a Perl action: + // + static const char_type MATCH[] = { 'M', 'A', 'T', 'C', 'H' }; + static const char_type PREMATCH[] = { 'P', 'R', 'E', 'M', 'A', 'T', 'C', 'H' }; + static const char_type POSTMATCH[] = { 'P', 'O', 'S', 'T', 'M', 'A', 'T', 'C', 'H' }; + static const char_type LAST_PAREN_MATCH[] = { 'L', 'A', 'S', 'T', '_', 'P', 'A', 'R', 'E', 'N', '_', 'M', 'A', 'T', 'C', 'H' }; + static const char_type LAST_SUBMATCH_RESULT[] = { 'L', 'A', 'S', 'T', '_', 'S', 'U', 'B', 'M', 'A', 'T', 'C', 'H', '_', 'R', 'E', 'S', 'U', 'L', 'T' }; + static const char_type LAST_SUBMATCH_RESULT_ALT[] = { '^', 'N' }; + + if(m_position == m_end) + return false; + if(have_brace && (*m_position == '^')) + ++m_position; + + int max_len = m_end - m_position; + + if((max_len >= 5) && std::equal(m_position, m_position + 5, MATCH)) + { + m_position += 5; + if(have_brace) + { + if((m_position != m_end) && (*m_position == '}')) + ++m_position; + else + { + m_position -= 5; + return false; + } + } + put(this->m_results[0]); + return true; + } + if((max_len >= 8) && std::equal(m_position, m_position + 8, PREMATCH)) + { + m_position += 8; + if(have_brace) + { + if((m_position != m_end) && (*m_position == '}')) + ++m_position; + else + { + m_position -= 8; + return false; + } + } + put(this->m_results.prefix()); + return true; + } + if((max_len >= 9) && std::equal(m_position, m_position + 9, POSTMATCH)) + { + m_position += 9; + if(have_brace) + { + if((m_position != m_end) && (*m_position == '}')) + ++m_position; + else + { + m_position -= 9; + return false; + } + } + put(this->m_results.suffix()); + return true; + } + if((max_len >= 16) && std::equal(m_position, m_position + 16, LAST_PAREN_MATCH)) + { + m_position += 16; + if(have_brace) + { + if((m_position != m_end) && (*m_position == '}')) + ++m_position; + else + { + m_position -= 16; + return false; + } + } + put((this->m_results)[this->m_results.size() > 1 ? this->m_results.size() - 1 : 1]); + return true; + } + if((max_len >= 20) && std::equal(m_position, m_position + 20, LAST_SUBMATCH_RESULT)) + { + m_position += 20; + if(have_brace) + { + if((m_position != m_end) && (*m_position == '}')) + ++m_position; + else + { + m_position -= 20; + return false; + } + } + put(this->m_results.get_last_closed_paren()); + return true; + } + if((max_len >= 2) && std::equal(m_position, m_position + 2, LAST_SUBMATCH_RESULT_ALT)) + { + m_position += 2; + if(have_brace) + { + if((m_position != m_end) && (*m_position == '}')) + ++m_position; + else + { + m_position -= 2; + return false; + } + } + put(this->m_results.get_last_closed_paren()); + return true; + } + return false; +} + +template <class OutputIterator, class Results, class traits, class ForwardIter> +void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format_escape() { // skip the escape and check for trailing escape: if(++m_position == m_end) @@ -322,7 +531,7 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_escape() if(*m_position == static_cast<char_type>('{')) { ++m_position; - int val = m_traits.toi(m_position, m_end, 16); + int val = this->toi(m_position, m_end, 16); if(val < 0) { // invalid value treat everything as literals: @@ -330,8 +539,9 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_escape() put(static_cast<char_type>('{')); return; } - if(*m_position != static_cast<char_type>('}')) + if((m_position == m_end) || (*m_position != static_cast<char_type>('}'))) { + --m_position; while(*m_position != static_cast<char_type>('\\')) --m_position; ++m_position; @@ -346,7 +556,7 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_escape() { std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); len = (std::min)(static_cast<std::ptrdiff_t>(2), len); - int val = m_traits.toi(m_position, m_position + len, 16); + int val = this->toi(m_position, m_position + len, 16); if(val < 0) { --m_position; @@ -408,7 +618,9 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_escape() break; } // see if we have a \n sed style backreference: - int v = m_traits.toi(m_position, m_position+1, 10); + std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); + len = (std::min)(static_cast<std::ptrdiff_t>(1), len); + int v = this->toi(m_position, m_position+len, 10); if((v > 0) || ((v == 0) && (m_flags & ::boost::regex_constants::format_sed))) { put(m_results[v]); @@ -418,9 +630,9 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_escape() { // octal ecape sequence: --m_position; - std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); + len = ::boost::re_detail::distance(m_position, m_end); len = (std::min)(static_cast<std::ptrdiff_t>(4), len); - v = m_traits.toi(m_position, m_position + len, 8); + v = this->toi(m_position, m_position + len, 8); BOOST_ASSERT(v >= 0); put(static_cast<char_type>(v)); break; @@ -431,8 +643,8 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_escape() } } -template <class OutputIterator, class Results, class traits> -void basic_regex_formatter<OutputIterator, Results, traits>::format_conditional() +template <class OutputIterator, class Results, class traits, class ForwardIter> +void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format_conditional() { if(m_position == m_end) { @@ -440,9 +652,35 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_conditional( put(static_cast<char_type>('?')); return; } - std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); - len = (std::min)(static_cast<std::ptrdiff_t>(2), len); - int v = m_traits.toi(m_position, m_position + len, 10); + int v; + if(*m_position == '{') + { + ForwardIter base = m_position; + ++m_position; + v = this->toi(m_position, m_end, 10); + if(v < 0) + { + // Try a named subexpression: + while((m_position != m_end) && (*m_position != '}')) + ++m_position; + v = this->get_named_sub_index(base + 1, m_position); + } + if((v < 0) || (*m_position != '}')) + { + m_position = base; + // oops trailing '?': + put(static_cast<char_type>('?')); + return; + } + // Skip trailing '}': + ++m_position; + } + else + { + std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end); + len = (std::min)(static_cast<std::ptrdiff_t>(2), len); + v = this->toi(m_position, m_position + len, 10); + } if(v < 0) { // oops not a number: @@ -490,8 +728,8 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_conditional( } } -template <class OutputIterator, class Results, class traits> -void basic_regex_formatter<OutputIterator, Results, traits>::format_until_scope_end() +template <class OutputIterator, class Results, class traits, class ForwardIter> +void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format_until_scope_end() { do { @@ -502,8 +740,8 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_until_scope_ }while(m_position != m_end); } -template <class OutputIterator, class Results, class traits> -void basic_regex_formatter<OutputIterator, Results, traits>::put(char_type c) +template <class OutputIterator, class Results, class traits, class ForwardIter> +void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::put(char_type c) { // write a single character to output // according to which case translation mode we are in: @@ -532,8 +770,8 @@ void basic_regex_formatter<OutputIterator, Results, traits>::put(char_type c) ++m_out; } -template <class OutputIterator, class Results, class traits> -void basic_regex_formatter<OutputIterator, Results, traits>::put(const sub_match_type& sub) +template <class OutputIterator, class Results, class traits, class ForwardIter> +void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::put(const sub_match_type& sub) { typedef typename sub_match_type::iterator iterator_type; iterator_type i = sub.first; @@ -571,10 +809,10 @@ public: #endif }; -template <class OutputIterator, class Iterator, class Alloc, class charT, class traits> +template <class OutputIterator, class Iterator, class Alloc, class ForwardIter, class traits> OutputIterator regex_format_imp(OutputIterator out, const match_results<Iterator, Alloc>& m, - const charT* p1, const charT* p2, + ForwardIter p1, ForwardIter p2, match_flag_type flags, const traits& t ) @@ -587,57 +825,289 @@ OutputIterator regex_format_imp(OutputIterator out, re_detail::basic_regex_formatter< OutputIterator, match_results<Iterator, Alloc>, - traits > f(out, m, t); + traits, ForwardIter> f(out, m, t); return f.format(p1, p2, flags); } +#ifndef BOOST_NO_SFINAE -} // namespace re_detail +BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator) -template <class OutputIterator, class Iterator, class charT> -OutputIterator regex_format(OutputIterator out, - const match_results<Iterator>& m, - const charT* fmt, - match_flag_type flags = format_all - ) +struct any_type { any_type(...); }; +typedef char no_type; +typedef char (&unary_type)[2]; +typedef char (&binary_type)[3]; +typedef char (&ternary_type)[4]; + +no_type check_is_formatter(unary_type, binary_type, ternary_type); +template<typename T> +unary_type check_is_formatter(T const &, binary_type, ternary_type); +template<typename T> +binary_type check_is_formatter(unary_type, T const &, ternary_type); +template<typename T, typename U> +binary_type check_is_formatter(T const &, U const &, ternary_type); +template<typename T> +ternary_type check_is_formatter(unary_type, binary_type, T const &); +template<typename T, typename U> +ternary_type check_is_formatter(T const &, binary_type, U const &); +template<typename T, typename U> +ternary_type check_is_formatter(unary_type, T const &, U const &); +template<typename T, typename U, typename V> +ternary_type check_is_formatter(T const &, U const &, V const &); + +struct unary_binary_ternary { - re_detail::trivial_format_traits<charT> traits; - return re_detail::regex_format_imp(out, m, fmt, fmt + traits.length(fmt), flags, traits); -} + typedef unary_type (*unary_fun)(any_type); + typedef binary_type (*binary_fun)(any_type, any_type); + typedef ternary_type (*ternary_fun)(any_type, any_type, any_type); + operator unary_fun(); + operator binary_fun(); + operator ternary_fun(); +}; -template <class OutputIterator, class Iterator, class charT> -OutputIterator regex_format(OutputIterator out, - const match_results<Iterator>& m, - const std::basic_string<charT>& fmt, - match_flag_type flags = format_all - ) +template<typename Formatter, bool IsFunction = boost::is_function<Formatter>::value> +struct formatter_wrapper + : Formatter + , unary_binary_ternary { - re_detail::trivial_format_traits<charT> traits; - return re_detail::regex_format_imp(out, m, fmt.data(), fmt.data() + fmt.size(), flags, traits); -} + formatter_wrapper(){} +}; -template <class Iterator, class charT> -std::basic_string<charT> regex_format(const match_results<Iterator>& m, - const charT* fmt, - match_flag_type flags = format_all) +template<typename Formatter> +struct formatter_wrapper<Formatter, true> + : unary_binary_ternary +{ + operator Formatter *(); +}; + +template<typename Formatter> +struct formatter_wrapper<Formatter *, false> + : unary_binary_ternary +{ + operator Formatter *(); +}; + +template <class F, class M, class O> +struct format_traits_imp +{ +private: + // + // F must be a pointer, a function, or a class with a function call operator: + // + BOOST_STATIC_ASSERT((::boost::is_pointer<F>::value || ::boost::is_function<F>::value || ::boost::is_class<F>::value)); + static formatter_wrapper<F> f; + static M m; + static O out; + static boost::regex_constants::match_flag_type flags; +public: + BOOST_STATIC_CONSTANT(int, value = sizeof(check_is_formatter(f(m), f(m, out), f(m, out, flags)))); +}; + +template <class F, class M, class O> +struct format_traits +{ +public: + // + // Type is mpl::int_<N> where N is one of: + // + // 0 : F is a pointer to a presumably null-terminated string. + // 1 : F is a character-container such as a std::string. + // 2 : F is a Unary Functor. + // 3 : F is a Binary Functor. + // 4 : F is a Ternary Functor. + // + typedef typename boost::mpl::if_< + boost::mpl::and_<boost::is_pointer<F>, boost::mpl::not_<boost::is_function<typename boost::remove_pointer<F>::type> > >, + boost::mpl::int_<0>, + typename boost::mpl::if_< + has_const_iterator<F>, + boost::mpl::int_<1>, + boost::mpl::int_<format_traits_imp<F, M, O>::value> + >::type + >::type type; + // + // This static assertion will fail if the functor passed does not accept + // the same type of arguments passed. + // + BOOST_STATIC_ASSERT( boost::is_class<F>::value && !has_const_iterator<F>::value ? (type::value > 1) : true); +}; + +#else // BOOST_NO_SFINAE + +template <class F, class M, class O> +struct format_traits +{ +public: + // + // Type is mpl::int_<N> where N is one of: + // + // 0 : F is a pointer to a presumably null-terminated string. + // 1 : F is a character-container such as a std::string. + // + // Other options such as F being a Functor are not supported without + // SFINAE support. + // + typedef typename boost::mpl::if_< + boost::is_pointer<F>, + boost::mpl::int_<0>, + boost::mpl::int_<1> + >::type type; +}; + +#endif // BOOST_NO_SFINAE + +template <class Base, class Match> +struct format_functor3 +{ + format_functor3(Base b) : func(b) {} + template <class OutputIter> + OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f) + { + return func(m, i, f); + } + template <class OutputIter, class Traits> + OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&) + { + return (*this)(m, i, f); + } +private: + Base func; + format_functor3(const format_functor3&); + format_functor3& operator=(const format_functor3&); +}; + +template <class Base, class Match> +struct format_functor2 +{ + format_functor2(Base b) : func(b) {} + template <class OutputIter> + OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type /*f*/) + { + return func(m, i); + } + template <class OutputIter, class Traits> + OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&) + { + return (*this)(m, i, f); + } +private: + Base func; + format_functor2(const format_functor2&); + format_functor2& operator=(const format_functor2&); +}; + +template <class Base, class Match> +struct format_functor1 +{ + format_functor1(Base b) : func(b) {} + + template <class S, class OutputIter> + OutputIter do_format_string(const S& s, OutputIter i) + { + return re_detail::copy(s.begin(), s.end(), i); + } + template <class S, class OutputIter> + inline OutputIter do_format_string(const S* s, OutputIter i) + { + while(s && *s) + { + *i = *s; + ++i; + ++s; + } + return i; + } + template <class OutputIter> + OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type /*f*/) + { + return do_format_string(func(m), i); + } + template <class OutputIter, class Traits> + OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&) + { + return (*this)(m, i, f); + } +private: + Base func; + format_functor1(const format_functor1&); + format_functor1& operator=(const format_functor1&); +}; + +template <class charT, class Match, class Traits> +struct format_functor_c_string +{ + format_functor_c_string(const charT* ps) : func(ps) {} + + template <class OutputIter> + OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits& t = Traits()) + { + typedef typename Match::char_type char_type; + const charT* end = func; + while(*end) ++end; + return regex_format_imp(i, m, func, end, f, t); + } +private: + const charT* func; + format_functor_c_string(const format_functor_c_string&); + format_functor_c_string& operator=(const format_functor_c_string&); +}; + +template <class Container, class Match, class Traits> +struct format_functor_container +{ + format_functor_container(const Container& c) : func(c) {} + + template <class OutputIter> + OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits& t = Traits()) + { + typedef typename Match::char_type char_type; + return re_detail::regex_format_imp(i, m, func.begin(), func.end(), f, t); + } +private: + const Container& func; + format_functor_container(const format_functor_container&); + format_functor_container& operator=(const format_functor_container&); +}; + +template <class Func, class Match, class OutputIterator, class Traits = re_detail::trivial_format_traits<typename Match::char_type> > +struct compute_functor_type +{ + typedef typename format_traits<Func, Match, OutputIterator>::type tag; + typedef typename boost::remove_cv< typename boost::remove_pointer<Func>::type>::type maybe_char_type; + + typedef typename mpl::if_< + ::boost::is_same<tag, mpl::int_<0> >, format_functor_c_string<maybe_char_type, Match, Traits>, + typename mpl::if_< + ::boost::is_same<tag, mpl::int_<1> >, format_functor_container<Func, Match, Traits>, + typename mpl::if_< + ::boost::is_same<tag, mpl::int_<2> >, format_functor1<Func, Match>, + typename mpl::if_< + ::boost::is_same<tag, mpl::int_<3> >, format_functor2<Func, Match>, + format_functor3<Func, Match> + >::type + >::type + >::type + >::type type; +}; + +} // namespace re_detail + +template <class OutputIterator, class Iterator, class Allocator, class Functor> +inline OutputIterator regex_format(OutputIterator out, + const match_results<Iterator, Allocator>& m, + Functor fmt, + match_flag_type flags = format_all + ) { - std::basic_string<charT> result; - re_detail::string_out_iterator<std::basic_string<charT> > i(result); - re_detail::trivial_format_traits<charT> traits; - re_detail::regex_format_imp(i, m, fmt, fmt + traits.length(fmt), flags, traits); - return result; + return m.format(out, fmt, flags); } -template <class Iterator, class charT> -std::basic_string<charT> regex_format(const match_results<Iterator>& m, - const std::basic_string<charT>& fmt, +template <class Iterator, class Allocator, class Functor> +inline std::basic_string<typename match_results<Iterator, Allocator>::char_type> regex_format(const match_results<Iterator, Allocator>& m, + Functor fmt, match_flag_type flags = format_all) { - std::basic_string<charT> result; - re_detail::string_out_iterator<std::basic_string<charT> > i(result); - re_detail::trivial_format_traits<charT> traits; - re_detail::regex_format_imp(i, m, fmt.data(), fmt.data() + fmt.size(), flags, traits); - return result; + return m.format(fmt, flags); } #ifdef BOOST_MSVC diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_replace.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_replace.hpp index c4544c0..ac8e3c8 100644 --- a/3rdParty/Boost/src/boost/regex/v4/regex_replace.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/regex_replace.hpp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 1998-2002 + * Copyright (c) 1998-2009 * John Maddock * * Use, modification and distribution are subject to the @@ -35,12 +35,12 @@ namespace boost{ #pragma warning(pop) #endif -template <class OutputIterator, class BidirectionalIterator, class traits, class charT> +template <class OutputIterator, class BidirectionalIterator, class traits, class charT, class Formatter> OutputIterator regex_replace(OutputIterator out, BidirectionalIterator first, BidirectionalIterator last, const basic_regex<charT, traits>& e, - const charT* fmt, + Formatter fmt, match_flag_type flags = match_default) { regex_iterator<BidirectionalIterator, charT, traits> i(first, last, e, flags); @@ -69,21 +69,10 @@ OutputIterator regex_replace(OutputIterator out, return out; } -template <class OutputIterator, class Iterator, class traits, class charT> -inline OutputIterator regex_replace(OutputIterator out, - Iterator first, - Iterator last, - const basic_regex<charT, traits>& e, - const std::basic_string<charT>& fmt, - match_flag_type flags = match_default) -{ - return regex_replace(out, first, last, e, fmt.c_str(), flags); -} - -template <class traits, class charT> +template <class traits, class charT, class Formatter> std::basic_string<charT> regex_replace(const std::basic_string<charT>& s, const basic_regex<charT, traits>& e, - const charT* fmt, + Formatter fmt, match_flag_type flags = match_default) { std::basic_string<charT> result; @@ -92,18 +81,6 @@ std::basic_string<charT> regex_replace(const std::basic_string<charT>& s, return result; } -template <class traits, class charT> -std::basic_string<charT> regex_replace(const std::basic_string<charT>& s, - const basic_regex<charT, traits>& e, - const std::basic_string<charT>& fmt, - match_flag_type flags = match_default) -{ - std::basic_string<charT> result; - re_detail::string_out_iterator<std::basic_string<charT> > i(result); - regex_replace(i, s.begin(), s.end(), e, fmt.c_str(), flags); - return result; -} - #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_traits_defaults.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_traits_defaults.hpp index 42428dd..ca13f19 100644 --- a/3rdParty/Boost/src/boost/regex/v4/regex_traits_defaults.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/regex_traits_defaults.hpp @@ -84,7 +84,7 @@ inline bool is_combining<unsigned char>(unsigned char) { return false; } -#ifndef __hpux // can't use WCHAR_MAX/MIN in pp-directives +#if !defined(__hpux) && !defined(__WINSCW__) // can't use WCHAR_MAX/MIN in pp-directives #ifdef _MSC_VER template<> inline bool is_combining<wchar_t>(wchar_t c) @@ -159,7 +159,7 @@ struct character_pointer_range template <class charT> int get_default_class_id(const charT* p1, const charT* p2) { - static const charT data[72] = { + static const charT data[73] = { 'a', 'l', 'n', 'u', 'm', 'a', 'l', 'p', 'h', 'a', 'b', 'l', 'a', 'n', 'k', @@ -172,11 +172,12 @@ int get_default_class_id(const charT* p1, const charT* p2) 's', 'p', 'a', 'c', 'e', 'u', 'n', 'i', 'c', 'o', 'd', 'e', 'u', 'p', 'p', 'e', 'r', + 'v', 'w', 'o', 'r', 'd', 'x', 'd', 'i', 'g', 'i', 't', }; - static const character_pointer_range<charT> ranges[19] = + static const character_pointer_range<charT> ranges[21] = { {data+0, data+5,}, // alnum {data+5, data+10,}, // alpha @@ -185,6 +186,7 @@ int get_default_class_id(const charT* p1, const charT* p2) {data+20, data+21,}, // d {data+20, data+25,}, // digit {data+25, data+30,}, // graph + {data+29, data+30,}, // h {data+30, data+31,}, // l {data+30, data+35,}, // lower {data+35, data+40,}, // print @@ -194,9 +196,10 @@ int get_default_class_id(const charT* p1, const charT* p2) {data+57, data+58,}, // u {data+50, data+57,}, // unicode {data+57, data+62,}, // upper - {data+62, data+63,}, // w - {data+62, data+66,}, // word - {data+66, data+72,}, // xdigit + {data+62, data+63,}, // v + {data+63, data+64,}, // w + {data+63, data+67,}, // word + {data+67, data+73,}, // xdigit }; static const character_pointer_range<charT>* ranges_begin = ranges; static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0])); @@ -314,6 +317,43 @@ int global_toi(const charT*& p1, const charT* p2, int radix, const traits& t) return result; } +template <class charT> +inline const charT* get_escape_R_string() +{ +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable:4309 4245) +#endif + static const charT e1[] = { '(', '?', '>', '\x0D', '\x0A', '?', + '|', '[', '\x0A', '\x0B', '\x0C', '\x85', '\\', 'x', '{', '2', '0', '2', '8', '}', + '\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' }; + static const charT e2[] = { '(', '?', '>', '\x0D', '\x0A', '?', + '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' }; + + charT c = static_cast<charT>(0x2029u); + bool b = (static_cast<unsigned>(c) == 0x2029u); + + return (b ? e1 : e2); +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif +} + +template <> +inline const char* get_escape_R_string<char>() +{ +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable:4309) +#endif + static const char e2[] = { '(', '?', '>', '\x0D', '\x0A', '?', + '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' }; + return e2; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif +} + } // re_detail } // boost diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_workaround.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_workaround.hpp index fc3c212..06527f1 100644 --- a/3rdParty/Boost/src/boost/regex/v4/regex_workaround.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/regex_workaround.hpp @@ -124,7 +124,7 @@ inline void pointer_construct(T* p, const T& t) #ifdef __cplusplus namespace boost{ namespace re_detail{ -#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) +#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && BOOST_WORKAROUND(BOOST_MSVC, <1600) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) // // MSVC 8 will either emit warnings or else refuse to compile // code that makes perfectly legitimate use of std::copy, when diff --git a/3rdParty/Boost/src/boost/regex/v4/states.hpp b/3rdParty/Boost/src/boost/regex/v4/states.hpp index 44dd2b4..38690b2 100644 --- a/3rdParty/Boost/src/boost/regex/v4/states.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/states.hpp @@ -118,7 +118,9 @@ enum syntax_element_type syntax_element_backstep = syntax_element_long_set_rep + 1, // an assertion that a mark was matched: syntax_element_assert_backref = syntax_element_backstep + 1, - syntax_element_toggle_case = syntax_element_assert_backref + 1 + syntax_element_toggle_case = syntax_element_assert_backref + 1, + // a recursive expression: + syntax_element_recurse = syntax_element_toggle_case + 1 }; #ifdef BOOST_REGEX_DEBUG @@ -156,6 +158,7 @@ struct re_brace : public re_syntax_base // The index to match, can be zero (don't mark the sub-expression) // or negative (for perl style (?...) extentions): int index; + bool icase; }; /*** struct re_dot ************************************************** @@ -245,6 +248,14 @@ struct re_repeat : public re_alt bool greedy; // True if this is a greedy repeat }; +/*** struct re_recurse ************************************************ +Recurse to a particular subexpression. +**********************************************************************/ +struct re_recurse : public re_jump +{ + int state_id; // identifier of first nested repeat within the recursion. +}; + /*** enum re_jump_size_type ******************************************* Provides compiled size of re_jump structure (allowing for trailing alignment). We provide this so we know how manybytes to insert when constructing the machine diff --git a/3rdParty/Boost/src/boost/regex/v4/syntax_type.hpp b/3rdParty/Boost/src/boost/regex/v4/syntax_type.hpp index 92c00d4..3efdf0b 100644 --- a/3rdParty/Boost/src/boost/regex/v4/syntax_type.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/syntax_type.hpp @@ -92,8 +92,11 @@ static const escape_syntax_type escape_type_G = 52; / static const escape_syntax_type escape_type_property = 54; // for \p static const escape_syntax_type escape_type_not_property = 55; // for \P static const escape_syntax_type escape_type_named_char = 56; // for \N +static const escape_syntax_type escape_type_extended_backref = 57; // for \g +static const escape_syntax_type escape_type_reset_start_mark = 58; // for \K +static const escape_syntax_type escape_type_line_ending = 59; // for \R -static const escape_syntax_type syntax_max = 57; +static const escape_syntax_type syntax_max = 60; } } diff --git a/3rdParty/Boost/src/boost/regex/v4/u32regex_iterator.hpp b/3rdParty/Boost/src/boost/regex/v4/u32regex_iterator.hpp index 7e893e6..65ebd7f 100644 --- a/3rdParty/Boost/src/boost/regex/v4/u32regex_iterator.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/u32regex_iterator.hpp @@ -178,7 +178,7 @@ inline u32regex_iterator<typename std::basic_string<charT, Traits, Alloc>::const typedef typename std::basic_string<charT, Traits, Alloc>::const_iterator iter_type; return u32regex_iterator<iter_type>(p.begin(), p.end(), e, m); } -inline u32regex_iterator<const UChar*> make_u32regex_iterator(const UnicodeString& s, const u32regex& e, regex_constants::match_flag_type m = regex_constants::match_default) +inline u32regex_iterator<const UChar*> make_u32regex_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, regex_constants::match_flag_type m = regex_constants::match_default) { return u32regex_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, m); } diff --git a/3rdParty/Boost/src/boost/regex/v4/u32regex_token_iterator.hpp b/3rdParty/Boost/src/boost/regex/v4/u32regex_token_iterator.hpp index 2726d48..c47a219 100644 --- a/3rdParty/Boost/src/boost/regex/v4/u32regex_token_iterator.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/u32regex_token_iterator.hpp @@ -294,7 +294,7 @@ inline u32regex_token_iterator<typename std::basic_string<charT, Traits, Alloc>: typedef typename std::basic_string<charT, Traits, Alloc>::const_iterator iter_type; return u32regex_token_iterator<iter_type>(p.begin(), p.end(), e, m); } -inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const UnicodeString& s, const u32regex& e, int submatch = 0, regex_constants::match_flag_type m = regex_constants::match_default) +inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, int submatch = 0, regex_constants::match_flag_type m = regex_constants::match_default) { return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m); } @@ -327,7 +327,7 @@ inline u32regex_token_iterator<typename std::basic_string<charT, Traits, Alloc>: return u32regex_token_iterator<iter_type>(p.begin(), p.end(), e, m); } template <std::size_t N> -inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const UnicodeString& s, const u32regex& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default) +inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default) { return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m); } @@ -356,7 +356,7 @@ inline u32regex_token_iterator<typename std::basic_string<charT, Traits, Alloc>: typedef typename std::basic_string<charT, Traits, Alloc>::const_iterator iter_type; return u32regex_token_iterator<iter_type>(p.begin(), p.end(), e, m); } -inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const UnicodeString& s, const u32regex& e, const std::vector<int>& submatch, regex_constants::match_flag_type m = regex_constants::match_default) +inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, const std::vector<int>& submatch, regex_constants::match_flag_type m = regex_constants::match_default) { return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m); } diff --git a/3rdParty/Boost/src/boost/regex/v4/w32_regex_traits.hpp b/3rdParty/Boost/src/boost/regex/v4/w32_regex_traits.hpp index 21a9694..d556207 100644 --- a/3rdParty/Boost/src/boost/regex/v4/w32_regex_traits.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/w32_regex_traits.hpp @@ -294,6 +294,8 @@ public: typedef typename w32_regex_traits<charT>::char_class_type char_class_type; BOOST_STATIC_CONSTANT(char_class_type, mask_word = 0x0400); // must be C1_DEFINED << 1 BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 0x0800); // must be C1_DEFINED << 2 + BOOST_STATIC_CONSTANT(char_class_type, mask_horizontal = 0x1000); // must be C1_DEFINED << 3 + BOOST_STATIC_CONSTANT(char_class_type, mask_vertical = 0x2000); // must be C1_DEFINED << 4 BOOST_STATIC_CONSTANT(char_class_type, mask_base = 0x3ff); // all the masks used by the CT_CTYPE1 group typedef std::basic_string<charT> string_type; @@ -510,7 +512,7 @@ template <class charT> typename w32_regex_traits_implementation<charT>::char_class_type w32_regex_traits_implementation<charT>::lookup_classname_imp(const charT* p1, const charT* p2) const { - static const char_class_type masks[20] = + static const char_class_type masks[22] = { 0, 0x0104u, // C1_ALPHA | C1_DIGIT @@ -520,6 +522,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type 0x0004u, // C1_DIGIT 0x0004u, // C1_DIGIT (~(0x0020u|0x0008u|0x0040) & 0x01ffu) | 0x0400u, // not C1_CNTRL or C1_SPACE or C1_BLANK + w32_regex_traits_implementation<charT>::mask_horizontal, 0x0002u, // C1_LOWER 0x0002u, // C1_LOWER (~0x0020u & 0x01ffu) | 0x0400, // not C1_CNTRL @@ -529,6 +532,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type 0x0001u, // C1_UPPER w32_regex_traits_implementation<charT>::mask_unicode, 0x0001u, // C1_UPPER + w32_regex_traits_implementation<charT>::mask_vertical, 0x0104u | w32_regex_traits_implementation<charT>::mask_word, 0x0104u | w32_regex_traits_implementation<charT>::mask_word, 0x0080u, // C1_XDIGIT @@ -628,6 +632,12 @@ public: return true; else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_word) && (c == '_')) return true; + else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_vertical) + && (::boost::re_detail::is_separator(c) || (c == '\v'))) + return true; + else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_horizontal) + && this->isctype(c, 0x0008u) && !this->isctype(c, re_detail::w32_regex_traits_implementation<charT>::mask_vertical)) + return true; return false; } int toi(const charT*& p1, const charT* p2, int radix)const diff --git a/3rdParty/Boost/src/boost/signals/detail/named_slot_map.hpp b/3rdParty/Boost/src/boost/signals/detail/named_slot_map.hpp index e31d380..0528c61 100644 --- a/3rdParty/Boost/src/boost/signals/detail/named_slot_map.hpp +++ b/3rdParty/Boost/src/boost/signals/detail/named_slot_map.hpp @@ -127,7 +127,7 @@ public: || slot_ == other.slot_)); } -#if BOOST_WORKAROUND(_MSC_VER, <= 1500) +#if BOOST_WORKAROUND(_MSC_VER, <= 1600) void decrement(); void advance(difference_type); #endif diff --git a/3rdParty/Boost/src/boost/signals/signal1.hpp b/3rdParty/Boost/src/boost/signals/signal1.hpp index 8363494..645f7ab 100644 --- a/3rdParty/Boost/src/boost/signals/signal1.hpp +++ b/3rdParty/Boost/src/boost/signals/signal1.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1; #define BOOST_SIGNALS_COPY_PARMS T1 ia1 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/signals/signal10.hpp b/3rdParty/Boost/src/boost/signals/signal10.hpp index 0718549..e043563 100644 --- a/3rdParty/Boost/src/boost/signals/signal10.hpp +++ b/3rdParty/Boost/src/boost/signals/signal10.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9;T10 a10; #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9, T10 ia10 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9), a10(ia10) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type; typedef T10 arg11_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; typedef T8 arg8_type; typedef T9 arg9_type; typedef T10 arg10_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/signals/signal2.hpp b/3rdParty/Boost/src/boost/signals/signal2.hpp index 361014e..e75f5e7 100644 --- a/3rdParty/Boost/src/boost/signals/signal2.hpp +++ b/3rdParty/Boost/src/boost/signals/signal2.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2; #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/signals/signal3.hpp b/3rdParty/Boost/src/boost/signals/signal3.hpp index 542a56e..0a695c5 100644 --- a/3rdParty/Boost/src/boost/signals/signal3.hpp +++ b/3rdParty/Boost/src/boost/signals/signal3.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3; #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/signals/signal4.hpp b/3rdParty/Boost/src/boost/signals/signal4.hpp index 695f70f..56ba360 100644 --- a/3rdParty/Boost/src/boost/signals/signal4.hpp +++ b/3rdParty/Boost/src/boost/signals/signal4.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4; #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/signals/signal5.hpp b/3rdParty/Boost/src/boost/signals/signal5.hpp index ba2f3c2..027cda9 100644 --- a/3rdParty/Boost/src/boost/signals/signal5.hpp +++ b/3rdParty/Boost/src/boost/signals/signal5.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5; #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/signals/signal6.hpp b/3rdParty/Boost/src/boost/signals/signal6.hpp index b46afce..3955318 100644 --- a/3rdParty/Boost/src/boost/signals/signal6.hpp +++ b/3rdParty/Boost/src/boost/signals/signal6.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6; #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/signals/signal7.hpp b/3rdParty/Boost/src/boost/signals/signal7.hpp index 86f1142..d4530ec 100644 --- a/3rdParty/Boost/src/boost/signals/signal7.hpp +++ b/3rdParty/Boost/src/boost/signals/signal7.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7; #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/signals/signal8.hpp b/3rdParty/Boost/src/boost/signals/signal8.hpp index e2b86ce..094cd97 100644 --- a/3rdParty/Boost/src/boost/signals/signal8.hpp +++ b/3rdParty/Boost/src/boost/signals/signal8.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8; #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; typedef T8 arg8_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/signals/signal9.hpp b/3rdParty/Boost/src/boost/signals/signal9.hpp index bb6a57a..a551c16 100644 --- a/3rdParty/Boost/src/boost/signals/signal9.hpp +++ b/3rdParty/Boost/src/boost/signals/signal9.hpp @@ -19,7 +19,7 @@ #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9; #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9) -#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type; +#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; typedef T8 arg8_type; typedef T9 arg9_type; #include <boost/signals/signal_template.hpp> diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/lwm_pthreads.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/lwm_pthreads.hpp index fc20dbb..8eda518 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/lwm_pthreads.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/lwm_pthreads.hpp @@ -17,6 +17,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // +#include <boost/assert.hpp> #include <pthread.h> namespace boost @@ -42,15 +43,15 @@ public: // HPUX 10.20 / DCE has a nonstandard pthread_mutex_init #if defined(__hpux) && defined(_DECTHREADS_) - pthread_mutex_init(&m_, pthread_mutexattr_default); + BOOST_VERIFY( pthread_mutex_init( &m_, pthread_mutexattr_default ) == 0 ); #else - pthread_mutex_init(&m_, 0); + BOOST_VERIFY( pthread_mutex_init( &m_, 0 ) == 0 ); #endif } ~lightweight_mutex() { - pthread_mutex_destroy(&m_); + BOOST_VERIFY( pthread_mutex_destroy( &m_ ) == 0 ); } class scoped_lock; @@ -69,12 +70,12 @@ public: scoped_lock(lightweight_mutex & m): m_(m.m_) { - pthread_mutex_lock(&m_); + BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); } ~scoped_lock() { - pthread_mutex_unlock(&m_); + BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); } }; }; diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/quick_allocator.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/quick_allocator.hpp index 6d136f8..159bd5e 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/quick_allocator.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/quick_allocator.hpp @@ -74,8 +74,9 @@ template<unsigned size, unsigned align_> struct allocator_impl static lightweight_mutex & mutex() { - static lightweight_mutex m; - return m; + static freeblock< sizeof( lightweight_mutex ), boost::alignment_of< lightweight_mutex >::value > fbm; + static lightweight_mutex * pm = new( &fbm ) lightweight_mutex; + return *pm; } static lightweight_mutex * mutex_init; diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/shared_count.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/shared_count.hpp index b968bba..4943e37 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/shared_count.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/shared_count.hpp @@ -333,6 +333,20 @@ public: if(pi_ != 0) pi_->weak_add_ref(); } +// Move support + +#if defined( BOOST_HAS_RVALUE_REFS ) + + weak_count(weak_count && r): pi_(r.pi_) // nothrow +#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) + , id_(weak_count_id) +#endif + { + r.pi_ = 0; + } + +#endif + ~weak_count() // nothrow { if(pi_ != 0) pi_->weak_release(); diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_convertible.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_convertible.hpp index 7d9502d..b7f0ea8 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_convertible.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_convertible.hpp @@ -25,7 +25,7 @@ # define BOOST_SP_NO_SP_CONVERTIBLE #endif -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x610 ) +#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x620 ) # define BOOST_SP_NO_SP_CONVERTIBLE #endif @@ -45,7 +45,7 @@ template< class Y, class T > struct sp_convertible static yes f( T* ); static no f( ... ); - enum _vt { value = sizeof( f( (Y*)0 ) ) == sizeof(yes) }; + enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) }; }; struct sp_empty diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp index 8af6f0a..21fa59d 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp @@ -30,9 +30,9 @@ namespace detail inline int32_t compare_and_swap( int32_t * dest_, int32_t compare_, int32_t swap_ ) { - __asm__ __volatile__( "cas %0, %2, %1" - : "+m" (*dest_), "+r" (swap_) - : "r" (compare_) + __asm__ __volatile__( "cas [%1], %2, %0" + : "+r" (swap_) + : "r" (dest_), "r" (compare_) : "memory" ); return swap_; diff --git a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_has_sync.hpp b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_has_sync.hpp index cb0282d..7fcd09e 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/detail/sp_has_sync.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/detail/sp_has_sync.hpp @@ -40,7 +40,7 @@ #undef BOOST_SP_HAS_SYNC #endif -#if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) +#if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) && ( __INTEL_COMPILER < 1100 ) #undef BOOST_SP_HAS_SYNC #endif diff --git a/3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp b/3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp index d3bd02b..e72eb21 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp @@ -77,7 +77,7 @@ public: template<class U> #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - intrusive_ptr( intrusive_ptr<U> const & rhs, typename detail::sp_enable_if_convertible<U,T>::type = detail::sp_empty() ) + intrusive_ptr( intrusive_ptr<U> const & rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty() ) #else @@ -111,6 +111,23 @@ public: #endif +// Move support + +#if defined( BOOST_HAS_RVALUE_REFS ) + + intrusive_ptr(intrusive_ptr && rhs): px( rhs.px ) + { + rhs.px = 0; + } + + intrusive_ptr & operator=(intrusive_ptr && rhs) + { + this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this); + return *this; + } + +#endif + intrusive_ptr & operator=(intrusive_ptr const & rhs) { this_type(rhs).swap(*this); diff --git a/3rdParty/Boost/src/boost/smart_ptr/shared_ptr.hpp b/3rdParty/Boost/src/boost/smart_ptr/shared_ptr.hpp index 7f46c35..609cce9 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/shared_ptr.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/shared_ptr.hpp @@ -61,6 +61,7 @@ namespace boost template<class T> class shared_ptr; template<class T> class weak_ptr; template<class T> class enable_shared_from_this; +template<class T> class enable_shared_from_this2; namespace detail { @@ -109,6 +110,14 @@ template< class X, class Y, class T > inline void sp_enable_shared_from_this( bo } } +template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::shared_ptr<X> * ppx, Y const * py, boost::enable_shared_from_this2< T > const * pe ) +{ + if( pe != 0 ) + { + pe->_internal_accept_owner( ppx, const_cast< Y* >( py ) ); + } +} + #ifdef _MANAGED // Avoid C4793, ... causes native code generation @@ -219,7 +228,7 @@ public: template<class Y> #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr<Y> const & r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() ) + shared_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) #else @@ -344,7 +353,7 @@ public: template<class Y> #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr<Y> && r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() ) + shared_ptr( shared_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) #else @@ -439,7 +448,7 @@ public: return pn < rhs.pn; } - void * _internal_get_deleter( detail::sp_typeinfo const & ti ) const + void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const { return pn.get_deleter( ti ); } diff --git a/3rdParty/Boost/src/boost/smart_ptr/weak_ptr.hpp b/3rdParty/Boost/src/boost/smart_ptr/weak_ptr.hpp index bf5296a..d314b0d 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/weak_ptr.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/weak_ptr.hpp @@ -63,22 +63,54 @@ public: template<class Y> #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( weak_ptr<Y> const & r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() ) + weak_ptr( weak_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) #else weak_ptr( weak_ptr<Y> const & r ) #endif - : pn(r.pn) // never throws + : px(r.lock().get()), pn(r.pn) // never throws { - px = r.lock().get(); } +#if defined( BOOST_HAS_RVALUE_REFS ) + + template<class Y> +#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) + + weak_ptr( weak_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) + +#else + + weak_ptr( weak_ptr<Y> && r ) + +#endif + : px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) // never throws + { + r.px = 0; + } + + // for better efficiency in the T == Y case + weak_ptr( weak_ptr && r ): px( r.px ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) // never throws + { + r.px = 0; + } + + // for better efficiency in the T == Y case + weak_ptr & operator=( weak_ptr && r ) // never throws + { + this_type( static_cast< weak_ptr && >( r ) ).swap( *this ); + return *this; + } + + +#endif + template<class Y> #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( shared_ptr<Y> const & r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() ) + weak_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() ) #else @@ -99,6 +131,17 @@ public: return *this; } +#if defined( BOOST_HAS_RVALUE_REFS ) + + template<class Y> + weak_ptr & operator=( weak_ptr<Y> && r ) + { + this_type( static_cast< weak_ptr<Y> && >( r ) ).swap( *this ); + return *this; + } + +#endif + template<class Y> weak_ptr & operator=(shared_ptr<Y> const & r) // never throws { @@ -124,6 +167,11 @@ public: return pn.use_count() == 0; } + bool _empty() const // extension, not in std::weak_ptr + { + return pn.empty(); + } + void reset() // never throws in 1.30+ { this_type().swap(*this); diff --git a/3rdParty/Boost/src/boost/system/error_code.hpp b/3rdParty/Boost/src/boost/system/error_code.hpp index 8f795d7..d0eb6c5 100644 --- a/3rdParty/Boost/src/boost/system/error_code.hpp +++ b/3rdParty/Boost/src/boost/system/error_code.hpp @@ -129,7 +129,7 @@ namespace boost too_many_files_open_in_system = ENFILE, too_many_files_open = EMFILE, too_many_links = EMLINK, - too_many_synbolic_link_levels = ELOOP, + too_many_symbolic_link_levels = ELOOP, value_too_large = EOVERFLOW, wrong_protocol_type = EPROTOTYPE }; @@ -183,11 +183,14 @@ namespace boost { public: virtual ~error_category(){} - virtual inline const char * name() const; // see implementation note below - virtual inline std::string message( int ev ) const; // see implementation note below - virtual inline error_condition default_error_condition( int ev ) const; - virtual inline bool equivalent( int code, const error_condition & condition ) const; - virtual inline bool equivalent( const error_code & code, int condition ) const; + + virtual const char * name() const = 0; + virtual std::string message( int ev ) const = 0; + virtual error_condition default_error_condition( int ev ) const; + virtual bool equivalent( int code, + const error_condition & condition ) const; + virtual bool equivalent( const error_code & code, + int condition ) const; bool operator==(const error_category & rhs) const { return this == &rhs; } bool operator!=(const error_category & rhs) const { return this != &rhs; } @@ -384,8 +387,30 @@ namespace boost }; // predefined error_code object used as "throw on error" tag +# ifndef BOOST_SYSTEM_NO_DEPRECATED BOOST_SYSTEM_DECL extern error_code throws; +# endif + + // Moving from a "throws" object to a "throws" function without breaking + // existing code is a bit of a problem. The workaround is to place the + // "throws" function in namespace boost rather than namespace boost::system. + } // namespace system + + namespace detail { inline system::error_code * throws() { return 0; } } + // Misuse of the error_code object is turned into a noisy failure by + // poisoning the reference. This particular implementation doesn't + // produce warnings or errors from popular compilers, is very efficient + // (as determined by inspecting generated code), and does not suffer + // from order of initialization problems. In practice, it also seems + // cause user function error handling implementation errors to be detected + // very early in the development cycle. + + inline system::error_code & throws() + { return *detail::throws(); } + + namespace system + { // non-member functions ------------------------------------------------// inline bool operator!=( const error_code & lhs, @@ -474,19 +499,6 @@ namespace boost return *this == code.category() && code.value() == condition; } - // error_category implementation note: VC++ 8.0 objects to name() and - // message() being pure virtual functions. Thus these implementations. - inline const char * error_category::name() const - { - return "error: should never be called"; - } - - inline std::string error_category::message( int ) const - { - static std::string s("error: should never be called"); - return s; - } - } // namespace system } // namespace boost diff --git a/3rdParty/Boost/src/boost/thread.hpp b/3rdParty/Boost/src/boost/thread.hpp index f0a39c3..892bbb8 100644 --- a/3rdParty/Boost/src/boost/thread.hpp +++ b/3rdParty/Boost/src/boost/thread.hpp @@ -1,6 +1,6 @@ // Copyright (C) 2001-2003 // William E. Kempf -// (C) Copyright 2008 Anthony Williams +// (C) Copyright 2008-9 Anthony Williams // // 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) @@ -21,5 +21,6 @@ #include <boost/thread/locks.hpp> #include <boost/thread/shared_mutex.hpp> #include <boost/thread/barrier.hpp> +#include <boost/thread/future.hpp> #endif diff --git a/3rdParty/Boost/src/boost/thread/detail/move.hpp b/3rdParty/Boost/src/boost/thread/detail/move.hpp index 044ecda..eb21107 100644 --- a/3rdParty/Boost/src/boost/thread/detail/move.hpp +++ b/3rdParty/Boost/src/boost/thread/detail/move.hpp @@ -41,9 +41,9 @@ namespace boost #ifndef BOOST_NO_SFINAE template<typename T> - typename enable_if<boost::is_convertible<T&,detail::thread_move_t<T> >, T >::type move(T& t) + typename enable_if<boost::is_convertible<T&,detail::thread_move_t<T> >, detail::thread_move_t<T> >::type move(T& t) { - return T(detail::thread_move_t<T>(t)); + return detail::thread_move_t<T>(t); } #endif diff --git a/3rdParty/Boost/src/boost/thread/detail/thread.hpp b/3rdParty/Boost/src/boost/thread/detail/thread.hpp index fbb895d..170801b 100644 --- a/3rdParty/Boost/src/boost/thread/detail/thread.hpp +++ b/3rdParty/Boost/src/boost/thread/detail/thread.hpp @@ -144,6 +144,9 @@ namespace boost struct dummy; #endif public: +#ifdef __SUNPRO_CC + thread(const volatile thread&); +#endif thread(); ~thread(); @@ -201,14 +204,21 @@ namespace boost thread_info=x->thread_info; x->thread_info.reset(); } - + +#ifdef __SUNPRO_CC + thread& operator=(thread x) + { + swap(x); + return *this; + } +#else thread& operator=(detail::thread_move_t<thread> x) { thread new_thread(x); swap(new_thread); return *this; } - +#endif operator detail::thread_move_t<thread>() { return move(); @@ -339,35 +349,14 @@ namespace boost return t; } #else - inline thread move(detail::thread_move_t<thread> t) + inline detail::thread_move_t<thread> move(detail::thread_move_t<thread> t) { - return thread(t); + return t; } #endif namespace this_thread { - class BOOST_THREAD_DECL disable_interruption - { - disable_interruption(const disable_interruption&); - disable_interruption& operator=(const disable_interruption&); - - bool interruption_was_enabled; - friend class restore_interruption; - public: - disable_interruption(); - ~disable_interruption(); - }; - - class BOOST_THREAD_DECL restore_interruption - { - restore_interruption(const restore_interruption&); - restore_interruption& operator=(const restore_interruption&); - public: - explicit restore_interruption(disable_interruption& d); - ~restore_interruption(); - }; - thread::id BOOST_THREAD_DECL get_id(); void BOOST_THREAD_DECL interruption_point(); @@ -487,83 +476,6 @@ namespace boost detail::add_thread_exit_function(thread_exit_func); } } - - class thread_group: - private noncopyable - { - public: - ~thread_group() - { - for(std::list<thread*>::iterator it=threads.begin(),end=threads.end(); - it!=end; - ++it) - { - delete *it; - } - } - - template<typename F> - thread* create_thread(F threadfunc) - { - boost::lock_guard<mutex> guard(m); - std::auto_ptr<thread> new_thread(new thread(threadfunc)); - threads.push_back(new_thread.get()); - return new_thread.release(); - } - - void add_thread(thread* thrd) - { - if(thrd) - { - boost::lock_guard<mutex> guard(m); - threads.push_back(thrd); - } - } - - void remove_thread(thread* thrd) - { - boost::lock_guard<mutex> guard(m); - std::list<thread*>::iterator const it=std::find(threads.begin(),threads.end(),thrd); - if(it!=threads.end()) - { - threads.erase(it); - } - } - - void join_all() - { - boost::lock_guard<mutex> guard(m); - - for(std::list<thread*>::iterator it=threads.begin(),end=threads.end(); - it!=end; - ++it) - { - (*it)->join(); - } - } - - void interrupt_all() - { - boost::lock_guard<mutex> guard(m); - - for(std::list<thread*>::iterator it=threads.begin(),end=threads.end(); - it!=end; - ++it) - { - (*it)->interrupt(); - } - } - - size_t size() const - { - boost::lock_guard<mutex> guard(m); - return threads.size(); - } - - private: - std::list<thread*> threads; - mutable mutex m; - }; } #ifdef BOOST_MSVC diff --git a/3rdParty/Boost/src/boost/thread/detail/thread_group.hpp b/3rdParty/Boost/src/boost/thread/detail/thread_group.hpp new file mode 100644 index 0000000..823b92e --- /dev/null +++ b/3rdParty/Boost/src/boost/thread/detail/thread_group.hpp @@ -0,0 +1,105 @@ +#ifndef BOOST_THREAD_DETAIL_THREAD_GROUP_HPP +#define BOOST_THREAD_DETAIL_THREAD_GROUP_HPP +// 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) +// (C) Copyright 2007-9 Anthony Williams + +#include <list> +#include <boost/thread/shared_mutex.hpp> +#include <boost/thread/mutex.hpp> + +#include <boost/config/abi_prefix.hpp> + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4251) +#endif + +namespace boost +{ + class thread_group: + private noncopyable + { + public: + ~thread_group() + { + for(std::list<thread*>::iterator it=threads.begin(),end=threads.end(); + it!=end; + ++it) + { + delete *it; + } + } + + template<typename F> + thread* create_thread(F threadfunc) + { + boost::lock_guard<shared_mutex> guard(m); + std::auto_ptr<thread> new_thread(new thread(threadfunc)); + threads.push_back(new_thread.get()); + return new_thread.release(); + } + + void add_thread(thread* thrd) + { + if(thrd) + { + boost::lock_guard<shared_mutex> guard(m); + threads.push_back(thrd); + } + } + + void remove_thread(thread* thrd) + { + boost::lock_guard<shared_mutex> guard(m); + std::list<thread*>::iterator const it=std::find(threads.begin(),threads.end(),thrd); + if(it!=threads.end()) + { + threads.erase(it); + } + } + + void join_all() + { + boost::shared_lock<shared_mutex> guard(m); + + for(std::list<thread*>::iterator it=threads.begin(),end=threads.end(); + it!=end; + ++it) + { + (*it)->join(); + } + } + + void interrupt_all() + { + boost::shared_lock<shared_mutex> guard(m); + + for(std::list<thread*>::iterator it=threads.begin(),end=threads.end(); + it!=end; + ++it) + { + (*it)->interrupt(); + } + } + + size_t size() const + { + boost::shared_lock<shared_mutex> guard(m); + return threads.size(); + } + + private: + std::list<thread*> threads; + mutable shared_mutex m; + }; +} + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include <boost/config/abi_suffix.hpp> + +#endif diff --git a/3rdParty/Boost/src/boost/thread/detail/thread_interruption.hpp b/3rdParty/Boost/src/boost/thread/detail/thread_interruption.hpp new file mode 100644 index 0000000..60c0e65 --- /dev/null +++ b/3rdParty/Boost/src/boost/thread/detail/thread_interruption.hpp @@ -0,0 +1,35 @@ +#ifndef BOOST_THREAD_DETAIL_THREAD_INTERRUPTION_HPP +#define BOOST_THREAD_DETAIL_THREAD_INTERRUPTION_HPP +// 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) +// (C) Copyright 2007-9 Anthony Williams + +namespace boost +{ + namespace this_thread + { + class BOOST_THREAD_DECL disable_interruption + { + disable_interruption(const disable_interruption&); + disable_interruption& operator=(const disable_interruption&); + + bool interruption_was_enabled; + friend class restore_interruption; + public: + disable_interruption(); + ~disable_interruption(); + }; + + class BOOST_THREAD_DECL restore_interruption + { + restore_interruption(const restore_interruption&); + restore_interruption& operator=(const restore_interruption&); + public: + explicit restore_interruption(disable_interruption& d); + ~restore_interruption(); + }; + } +} + +#endif diff --git a/3rdParty/Boost/src/boost/thread/exceptions.hpp b/3rdParty/Boost/src/boost/thread/exceptions.hpp index 49e244f..2a05b50 100644 --- a/3rdParty/Boost/src/boost/thread/exceptions.hpp +++ b/3rdParty/Boost/src/boost/thread/exceptions.hpp @@ -1,6 +1,6 @@ // Copyright (C) 2001-2003 // William E. Kempf -// Copyright (C) 2007-8 Anthony Williams +// Copyright (C) 2007-9 Anthony Williams // // 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) @@ -24,23 +24,36 @@ namespace boost { - class BOOST_THREAD_DECL thread_interrupted + class thread_interrupted {}; -class BOOST_THREAD_DECL thread_exception : public std::exception -{ -protected: - thread_exception(); - thread_exception(int sys_err_code); + class thread_exception: + public std::exception + { + protected: + thread_exception(): + m_sys_err(0) + {} + + thread_exception(int sys_err_code): + m_sys_err(sys_err_code) + {} + -public: - ~thread_exception() throw(); + public: + ~thread_exception() throw() + {} + - int native_error() const; + int native_error() const + { + return m_sys_err; + } + -private: - int m_sys_err; -}; + private: + int m_sys_err; + }; class condition_error: public std::exception @@ -53,62 +66,117 @@ private: }; -class BOOST_THREAD_DECL lock_error : public thread_exception -{ -public: - lock_error(); - lock_error(int sys_err_code); - ~lock_error() throw(); + class lock_error: + public thread_exception + { + public: + lock_error() + {} + + lock_error(int sys_err_code): + thread_exception(sys_err_code) + {} + + ~lock_error() throw() + {} + - virtual const char* what() const throw(); -}; + virtual const char* what() const throw() + { + return "boost::lock_error"; + } + }; -class BOOST_THREAD_DECL thread_resource_error : public thread_exception -{ -public: - thread_resource_error(); - thread_resource_error(int sys_err_code); - ~thread_resource_error() throw(); + class thread_resource_error: + public thread_exception + { + public: + thread_resource_error() + {} + + thread_resource_error(int sys_err_code): + thread_exception(sys_err_code) + {} + + ~thread_resource_error() throw() + {} + - virtual const char* what() const throw(); -}; + virtual const char* what() const throw() + { + return "boost::thread_resource_error"; + } + + }; -class BOOST_THREAD_DECL unsupported_thread_option : public thread_exception -{ -public: - unsupported_thread_option(); - unsupported_thread_option(int sys_err_code); - ~unsupported_thread_option() throw(); + class unsupported_thread_option: + public thread_exception + { + public: + unsupported_thread_option() + {} + + unsupported_thread_option(int sys_err_code): + thread_exception(sys_err_code) + {} + + ~unsupported_thread_option() throw() + {} + - virtual const char* what() const throw(); -}; + virtual const char* what() const throw() + { + return "boost::unsupported_thread_option"; + } + + }; -class BOOST_THREAD_DECL invalid_thread_argument : public thread_exception -{ -public: - invalid_thread_argument(); - invalid_thread_argument(int sys_err_code); - ~invalid_thread_argument() throw(); + class invalid_thread_argument: + public thread_exception + { + public: + invalid_thread_argument() + {} + + invalid_thread_argument(int sys_err_code): + thread_exception(sys_err_code) + {} + + ~invalid_thread_argument() throw() + {} + - virtual const char* what() const throw(); -}; + virtual const char* what() const throw() + { + return "boost::invalid_thread_argument"; + } + + }; -class BOOST_THREAD_DECL thread_permission_error : public thread_exception -{ -public: - thread_permission_error(); - thread_permission_error(int sys_err_code); - ~thread_permission_error() throw(); + class thread_permission_error: + public thread_exception + { + public: + thread_permission_error() + {} + + thread_permission_error(int sys_err_code): + thread_exception(sys_err_code) + {} + + ~thread_permission_error() throw() + {} + - virtual const char* what() const throw(); -}; + virtual const char* what() const throw() + { + return "boost::thread_permission_error"; + } + + }; } // namespace boost #include <boost/config/abi_suffix.hpp> -#endif // BOOST_THREAD_CONFIG_PDM070801_H - -// Change log: -// 3 Jan 03 WEKEMPF Modified for DLL implementation. - +#endif diff --git a/3rdParty/Boost/src/boost/thread/future.hpp b/3rdParty/Boost/src/boost/thread/future.hpp new file mode 100644 index 0000000..3d694eb --- /dev/null +++ b/3rdParty/Boost/src/boost/thread/future.hpp @@ -0,0 +1,1364 @@ +// (C) Copyright 2008-9 Anthony Williams +// +// 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_THREAD_FUTURE_HPP +#define BOOST_THREAD_FUTURE_HPP +#include <stdexcept> +#include <boost/thread/detail/move.hpp> +#include <boost/thread/thread_time.hpp> +#include <boost/exception_ptr.hpp> +#include <boost/shared_ptr.hpp> +#include <boost/scoped_ptr.hpp> +#include <boost/type_traits/is_fundamental.hpp> +#include <boost/type_traits/is_convertible.hpp> +#include <boost/mpl/if.hpp> +#include <boost/config.hpp> +#include <algorithm> +#include <boost/function.hpp> +#include <boost/bind.hpp> +#include <boost/ref.hpp> +#include <boost/scoped_array.hpp> +#include <boost/utility/enable_if.hpp> +#include <list> +#include <boost/next_prior.hpp> +#include <vector> + +namespace boost +{ + class future_uninitialized: + public std::logic_error + { + public: + future_uninitialized(): + std::logic_error("Future Uninitialized") + {} + }; + class broken_promise: + public std::logic_error + { + public: + broken_promise(): + std::logic_error("Broken promise") + {} + }; + class future_already_retrieved: + public std::logic_error + { + public: + future_already_retrieved(): + std::logic_error("Future already retrieved") + {} + }; + class promise_already_satisfied: + public std::logic_error + { + public: + promise_already_satisfied(): + std::logic_error("Promise already satisfied") + {} + }; + + class task_already_started: + public std::logic_error + { + public: + task_already_started(): + std::logic_error("Task already started") + {} + }; + + class task_moved: + public std::logic_error + { + public: + task_moved(): + std::logic_error("Task moved") + {} + }; + + namespace future_state + { + enum state { uninitialized, waiting, ready, moved }; + } + + namespace detail + { + struct future_object_base + { + boost::exception_ptr exception; + bool done; + boost::mutex mutex; + boost::condition_variable waiters; + typedef std::list<boost::condition_variable_any*> waiter_list; + waiter_list external_waiters; + boost::function<void()> callback; + + future_object_base(): + done(false) + {} + virtual ~future_object_base() + {} + + waiter_list::iterator register_external_waiter(boost::condition_variable_any& cv) + { + boost::unique_lock<boost::mutex> lock(mutex); + do_callback(lock); + return external_waiters.insert(external_waiters.end(),&cv); + } + + void remove_external_waiter(waiter_list::iterator it) + { + boost::lock_guard<boost::mutex> lock(mutex); + external_waiters.erase(it); + } + + void mark_finished_internal() + { + done=true; + waiters.notify_all(); + for(waiter_list::const_iterator it=external_waiters.begin(), + end=external_waiters.end();it!=end;++it) + { + (*it)->notify_all(); + } + } + + struct relocker + { + boost::unique_lock<boost::mutex>& lock; + + relocker(boost::unique_lock<boost::mutex>& lock_): + lock(lock_) + { + lock.unlock(); + } + ~relocker() + { + lock.lock(); + } + }; + + void do_callback(boost::unique_lock<boost::mutex>& lock) + { + if(callback && !done) + { + boost::function<void()> local_callback=callback; + relocker relock(lock); + local_callback(); + } + } + + + void wait(bool rethrow=true) + { + boost::unique_lock<boost::mutex> lock(mutex); + do_callback(lock); + while(!done) + { + waiters.wait(lock); + } + if(rethrow && exception) + { + boost::rethrow_exception(exception); + } + } + + bool timed_wait_until(boost::system_time const& target_time) + { + boost::unique_lock<boost::mutex> lock(mutex); + do_callback(lock); + while(!done) + { + bool const success=waiters.timed_wait(lock,target_time); + if(!success && !done) + { + return false; + } + } + return true; + } + + void mark_exceptional_finish_internal(boost::exception_ptr const& e) + { + exception=e; + mark_finished_internal(); + } + void mark_exceptional_finish() + { + boost::lock_guard<boost::mutex> lock(mutex); + mark_exceptional_finish_internal(boost::current_exception()); + } + + bool has_value() + { + boost::lock_guard<boost::mutex> lock(mutex); + return done && !exception; + } + bool has_exception() + { + boost::lock_guard<boost::mutex> lock(mutex); + return done && exception; + } + + template<typename F,typename U> + void set_wait_callback(F f,U* u) + { + callback=boost::bind(f,boost::ref(*u)); + } + + private: + future_object_base(future_object_base const&); + future_object_base& operator=(future_object_base const&); + }; + + template<typename T> + struct future_traits + { + typedef boost::scoped_ptr<T> storage_type; +#ifdef BOOST_HAS_RVALUE_REFS + typedef T const& source_reference_type; + struct dummy; + typedef typename boost::mpl::if_<boost::is_fundamental<T>,dummy&,T&&>::type rvalue_source_type; + typedef typename boost::mpl::if_<boost::is_fundamental<T>,T,T&&>::type move_dest_type; +#else + typedef T& source_reference_type; + typedef typename boost::mpl::if_<boost::is_convertible<T&,boost::detail::thread_move_t<T> >,boost::detail::thread_move_t<T>,T const&>::type rvalue_source_type; + typedef typename boost::mpl::if_<boost::is_convertible<T&,boost::detail::thread_move_t<T> >,boost::detail::thread_move_t<T>,T>::type move_dest_type; +#endif + + static void init(storage_type& storage,source_reference_type t) + { + storage.reset(new T(t)); + } + + static void init(storage_type& storage,rvalue_source_type t) + { + storage.reset(new T(static_cast<rvalue_source_type>(t))); + } + + static void cleanup(storage_type& storage) + { + storage.reset(); + } + }; + + template<typename T> + struct future_traits<T&> + { + typedef T* storage_type; + typedef T& source_reference_type; + struct rvalue_source_type + {}; + typedef T& move_dest_type; + + static void init(storage_type& storage,T& t) + { + storage=&t; + } + + static void cleanup(storage_type& storage) + { + storage=0; + } + }; + + template<> + struct future_traits<void> + { + typedef bool storage_type; + typedef void move_dest_type; + + static void init(storage_type& storage) + { + storage=true; + } + + static void cleanup(storage_type& storage) + { + storage=false; + } + + }; + + template<typename T> + struct future_object: + detail::future_object_base + { + typedef typename future_traits<T>::storage_type storage_type; + typedef typename future_traits<T>::source_reference_type source_reference_type; + typedef typename future_traits<T>::rvalue_source_type rvalue_source_type; + typedef typename future_traits<T>::move_dest_type move_dest_type; + + storage_type result; + + future_object(): + result(0) + {} + + void mark_finished_with_result_internal(source_reference_type result_) + { + future_traits<T>::init(result,result_); + mark_finished_internal(); + } + void mark_finished_with_result_internal(rvalue_source_type result_) + { + future_traits<T>::init(result,static_cast<rvalue_source_type>(result_)); + mark_finished_internal(); + } + + void mark_finished_with_result(source_reference_type result_) + { + boost::lock_guard<boost::mutex> lock(mutex); + mark_finished_with_result_internal(result_); + } + void mark_finished_with_result(rvalue_source_type result_) + { + boost::lock_guard<boost::mutex> lock(mutex); + mark_finished_with_result_internal(result_); + } + + move_dest_type get() + { + wait(); + return *result; + } + + future_state::state get_state() + { + boost::lock_guard<boost::mutex> guard(mutex); + if(!done) + { + return future_state::waiting; + } + else + { + return future_state::ready; + } + } + + private: + future_object(future_object const&); + future_object& operator=(future_object const&); + }; + + template<> + struct future_object<void>: + detail::future_object_base + { + future_object() + {} + + void mark_finished_with_result_internal() + { + mark_finished_internal(); + } + + void mark_finished_with_result() + { + boost::lock_guard<boost::mutex> lock(mutex); + mark_finished_with_result_internal(); + } + + void get() + { + wait(); + } + + future_state::state get_state() + { + boost::lock_guard<boost::mutex> guard(mutex); + if(!done) + { + return future_state::waiting; + } + else + { + return future_state::ready; + } + } + + private: + future_object(future_object const&); + future_object& operator=(future_object const&); + }; + + class future_waiter + { + struct registered_waiter + { + boost::shared_ptr<detail::future_object_base> future; + detail::future_object_base::waiter_list::iterator wait_iterator; + unsigned index; + + registered_waiter(boost::shared_ptr<detail::future_object_base> const& future_, + detail::future_object_base::waiter_list::iterator wait_iterator_, + unsigned index_): + future(future_),wait_iterator(wait_iterator_),index(index_) + {} + + }; + + struct all_futures_lock + { + unsigned count; + boost::scoped_array<boost::unique_lock<boost::mutex> > locks; + + all_futures_lock(std::vector<registered_waiter>& futures): + count(futures.size()),locks(new boost::unique_lock<boost::mutex>[count]) + { + for(unsigned i=0;i<count;++i) + { + locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex); + } + } + + void lock() + { + boost::lock(locks.get(),locks.get()+count); + } + + void unlock() + { + for(unsigned i=0;i<count;++i) + { + locks[i].unlock(); + } + } + }; + + boost::condition_variable_any cv; + std::vector<registered_waiter> futures; + unsigned future_count; + + public: + future_waiter(): + future_count(0) + {} + + template<typename F> + void add(F& f) + { + if(f.future) + { + futures.push_back(registered_waiter(f.future,f.future->register_external_waiter(cv),future_count)); + } + ++future_count; + } + + unsigned wait() + { + all_futures_lock lk(futures); + for(;;) + { + for(unsigned i=0;i<futures.size();++i) + { + if(futures[i].future->done) + { + return futures[i].index; + } + } + cv.wait(lk); + } + } + + ~future_waiter() + { + for(unsigned i=0;i<futures.size();++i) + { + futures[i].future->remove_external_waiter(futures[i].wait_iterator); + } + } + + }; + + } + + template <typename R> + class unique_future; + + template <typename R> + class shared_future; + + template<typename T> + struct is_future_type + { + BOOST_STATIC_CONSTANT(bool, value=false); + }; + + template<typename T> + struct is_future_type<unique_future<T> > + { + BOOST_STATIC_CONSTANT(bool, value=true); + }; + + template<typename T> + struct is_future_type<shared_future<T> > + { + BOOST_STATIC_CONSTANT(bool, value=true); + }; + + template<typename Iterator> + typename boost::disable_if<is_future_type<Iterator>,void>::type wait_for_all(Iterator begin,Iterator end) + { + for(Iterator current=begin;current!=end;++current) + { + current->wait(); + } + } + + template<typename F1,typename F2> + typename boost::enable_if<is_future_type<F1>,void>::type wait_for_all(F1& f1,F2& f2) + { + f1.wait(); + f2.wait(); + } + + template<typename F1,typename F2,typename F3> + void wait_for_all(F1& f1,F2& f2,F3& f3) + { + f1.wait(); + f2.wait(); + f3.wait(); + } + + template<typename F1,typename F2,typename F3,typename F4> + void wait_for_all(F1& f1,F2& f2,F3& f3,F4& f4) + { + f1.wait(); + f2.wait(); + f3.wait(); + f4.wait(); + } + + template<typename F1,typename F2,typename F3,typename F4,typename F5> + void wait_for_all(F1& f1,F2& f2,F3& f3,F4& f4,F5& f5) + { + f1.wait(); + f2.wait(); + f3.wait(); + f4.wait(); + f5.wait(); + } + + template<typename Iterator> + typename boost::disable_if<is_future_type<Iterator>,Iterator>::type wait_for_any(Iterator begin,Iterator end) + { + detail::future_waiter waiter; + for(Iterator current=begin;current!=end;++current) + { + waiter.add(*current); + } + return boost::next(begin,waiter.wait()); + } + + template<typename F1,typename F2> + typename boost::enable_if<is_future_type<F1>,unsigned>::type wait_for_any(F1& f1,F2& f2) + { + detail::future_waiter waiter; + waiter.add(f1); + waiter.add(f2); + return waiter.wait(); + } + + template<typename F1,typename F2,typename F3> + unsigned wait_for_any(F1& f1,F2& f2,F3& f3) + { + detail::future_waiter waiter; + waiter.add(f1); + waiter.add(f2); + waiter.add(f3); + return waiter.wait(); + } + + template<typename F1,typename F2,typename F3,typename F4> + unsigned wait_for_any(F1& f1,F2& f2,F3& f3,F4& f4) + { + detail::future_waiter waiter; + waiter.add(f1); + waiter.add(f2); + waiter.add(f3); + waiter.add(f4); + return waiter.wait(); + } + + template<typename F1,typename F2,typename F3,typename F4,typename F5> + unsigned wait_for_any(F1& f1,F2& f2,F3& f3,F4& f4,F5& f5) + { + detail::future_waiter waiter; + waiter.add(f1); + waiter.add(f2); + waiter.add(f3); + waiter.add(f4); + waiter.add(f5); + return waiter.wait(); + } + + template <typename R> + class promise; + + template <typename R> + class packaged_task; + + template <typename R> + class unique_future + { + unique_future(unique_future & rhs);// = delete; + unique_future& operator=(unique_future& rhs);// = delete; + + typedef boost::shared_ptr<detail::future_object<R> > future_ptr; + + future_ptr future; + + friend class shared_future<R>; + friend class promise<R>; + friend class packaged_task<R>; + friend class detail::future_waiter; + + typedef typename detail::future_traits<R>::move_dest_type move_dest_type; + + unique_future(future_ptr future_): + future(future_) + {} + + public: + typedef future_state::state state; + + unique_future() + {} + + ~unique_future() + {} + +#ifdef BOOST_HAS_RVALUE_REFS + unique_future(unique_future && other) + { + future.swap(other.future); + } + unique_future& operator=(unique_future && other) + { + future=other.future; + other.future.reset(); + return *this; + } +#else + unique_future(boost::detail::thread_move_t<unique_future> other): + future(other->future) + { + other->future.reset(); + } + + unique_future& operator=(boost::detail::thread_move_t<unique_future> other) + { + future=other->future; + other->future.reset(); + return *this; + } + + operator boost::detail::thread_move_t<unique_future>() + { + return boost::detail::thread_move_t<unique_future>(*this); + } +#endif + + void swap(unique_future& other) + { + future.swap(other.future); + } + + // retrieving the value + move_dest_type get() + { + if(!future) + { + throw future_uninitialized(); + } + + return future->get(); + } + + // functions to check state, and wait for ready + state get_state() const + { + if(!future) + { + return future_state::uninitialized; + } + return future->get_state(); + } + + + bool is_ready() const + { + return get_state()==future_state::ready; + } + + bool has_exception() const + { + return future && future->has_exception(); + } + + bool has_value() const + { + return future && future->has_value(); + } + + void wait() const + { + if(!future) + { + throw future_uninitialized(); + } + future->wait(false); + } + + template<typename Duration> + bool timed_wait(Duration const& rel_time) const + { + return timed_wait_until(boost::get_system_time()+rel_time); + } + + bool timed_wait_until(boost::system_time const& abs_time) const + { + if(!future) + { + throw future_uninitialized(); + } + return future->timed_wait_until(abs_time); + } + + }; + + template <typename R> + class shared_future + { + typedef boost::shared_ptr<detail::future_object<R> > future_ptr; + + future_ptr future; + +// shared_future(const unique_future<R>& other); +// shared_future& operator=(const unique_future<R>& other); + + friend class detail::future_waiter; + friend class promise<R>; + friend class packaged_task<R>; + + shared_future(future_ptr future_): + future(future_) + {} + + public: + shared_future(shared_future const& other): + future(other.future) + {} + + typedef future_state::state state; + + shared_future() + {} + + ~shared_future() + {} + + shared_future& operator=(shared_future const& other) + { + future=other.future; + return *this; + } +#ifdef BOOST_HAS_RVALUE_REFS + shared_future(shared_future && other) + { + future.swap(other.future); + } + shared_future(unique_future<R> && other) + { + future.swap(other.future); + } + shared_future& operator=(shared_future && other) + { + future.swap(other.future); + other.future.reset(); + return *this; + } + shared_future& operator=(unique_future<R> && other) + { + future.swap(other.future); + other.future.reset(); + return *this; + } +#else + shared_future(boost::detail::thread_move_t<shared_future> other): + future(other->future) + { + other->future.reset(); + } +// shared_future(const unique_future<R> &) = delete; + shared_future(boost::detail::thread_move_t<unique_future<R> > other): + future(other->future) + { + other->future.reset(); + } + shared_future& operator=(boost::detail::thread_move_t<shared_future> other) + { + future.swap(other->future); + other->future.reset(); + return *this; + } + shared_future& operator=(boost::detail::thread_move_t<unique_future<R> > other) + { + future.swap(other->future); + other->future.reset(); + return *this; + } + + operator boost::detail::thread_move_t<shared_future>() + { + return boost::detail::thread_move_t<shared_future>(*this); + } + +#endif + + void swap(shared_future& other) + { + future.swap(other.future); + } + + // retrieving the value + R get() + { + if(!future) + { + throw future_uninitialized(); + } + + return future->get(); + } + + // functions to check state, and wait for ready + state get_state() const + { + if(!future) + { + return future_state::uninitialized; + } + return future->get_state(); + } + + + bool is_ready() const + { + return get_state()==future_state::ready; + } + + bool has_exception() const + { + return future && future->has_exception(); + } + + bool has_value() const + { + return future && future->has_value(); + } + + void wait() const + { + if(!future) + { + throw future_uninitialized(); + } + future->wait(false); + } + + template<typename Duration> + bool timed_wait(Duration const& rel_time) const + { + return timed_wait_until(boost::get_system_time()+rel_time); + } + + bool timed_wait_until(boost::system_time const& abs_time) const + { + if(!future) + { + throw future_uninitialized(); + } + return future->timed_wait_until(abs_time); + } + + }; + + template <typename R> + class promise + { + typedef boost::shared_ptr<detail::future_object<R> > future_ptr; + + future_ptr future; + bool future_obtained; + + promise(promise & rhs);// = delete; + promise & operator=(promise & rhs);// = delete; + + void lazy_init() + { + if(!future) + { + future_obtained=false; + future.reset(new detail::future_object<R>); + } + } + + public: +// template <class Allocator> explicit promise(Allocator a); + + promise(): + future(),future_obtained(false) + {} + + ~promise() + { + if(future) + { + boost::lock_guard<boost::mutex> lock(future->mutex); + + if(!future->done) + { + future->mark_exceptional_finish_internal(boost::copy_exception(broken_promise())); + } + } + } + + // Assignment +#ifdef BOOST_HAS_RVALUE_REFS + promise(promise && rhs): + future_obtained(rhs.future_obtained) + { + future.swap(rhs.future); + } + promise & operator=(promise&& rhs) + { + future.swap(rhs.future); + future_obtained=rhs.future_obtained; + rhs.future.reset(); + return *this; + } +#else + promise(boost::detail::thread_move_t<promise> rhs): + future(rhs->future),future_obtained(rhs->future_obtained) + { + rhs->future.reset(); + } + promise & operator=(boost::detail::thread_move_t<promise> rhs) + { + future=rhs->future; + future_obtained=rhs->future_obtained; + rhs->future.reset(); + return *this; + } + + operator boost::detail::thread_move_t<promise>() + { + return boost::detail::thread_move_t<promise>(*this); + } +#endif + + void swap(promise& other) + { + future.swap(other.future); + std::swap(future_obtained,other.future_obtained); + } + + // Result retrieval + unique_future<R> get_future() + { + lazy_init(); + if(future_obtained) + { + throw future_already_retrieved(); + } + future_obtained=true; + return unique_future<R>(future); + } + + void set_value(typename detail::future_traits<R>::source_reference_type r) + { + lazy_init(); + boost::lock_guard<boost::mutex> lock(future->mutex); + if(future->done) + { + throw promise_already_satisfied(); + } + future->mark_finished_with_result_internal(r); + } + +// void set_value(R && r); + void set_value(typename detail::future_traits<R>::rvalue_source_type r) + { + lazy_init(); + boost::lock_guard<boost::mutex> lock(future->mutex); + if(future->done) + { + throw promise_already_satisfied(); + } + future->mark_finished_with_result_internal(static_cast<typename detail::future_traits<R>::rvalue_source_type>(r)); + } + + void set_exception(boost::exception_ptr p) + { + lazy_init(); + boost::lock_guard<boost::mutex> lock(future->mutex); + if(future->done) + { + throw promise_already_satisfied(); + } + future->mark_exceptional_finish_internal(p); + } + + template<typename F> + void set_wait_callback(F f) + { + lazy_init(); + future->set_wait_callback(f,this); + } + + }; + + template <> + class promise<void> + { + typedef boost::shared_ptr<detail::future_object<void> > future_ptr; + + future_ptr future; + bool future_obtained; + + promise(promise & rhs);// = delete; + promise & operator=(promise & rhs);// = delete; + + void lazy_init() + { + if(!future) + { + future_obtained=false; + future.reset(new detail::future_object<void>); + } + } + public: +// template <class Allocator> explicit promise(Allocator a); + + promise(): + future(),future_obtained(false) + {} + + ~promise() + { + if(future) + { + boost::lock_guard<boost::mutex> lock(future->mutex); + + if(!future->done) + { + future->mark_exceptional_finish_internal(boost::copy_exception(broken_promise())); + } + } + } + + // Assignment +#ifdef BOOST_HAS_RVALUE_REFS + promise(promise && rhs): + future_obtained(rhs.future_obtained) + { + future.swap(rhs.future); + } + promise & operator=(promise&& rhs) + { + future.swap(rhs.future); + future_obtained=rhs.future_obtained; + rhs.future.reset(); + return *this; + } +#else + promise(boost::detail::thread_move_t<promise> rhs): + future(rhs->future),future_obtained(rhs->future_obtained) + { + rhs->future.reset(); + } + promise & operator=(boost::detail::thread_move_t<promise> rhs) + { + future=rhs->future; + future_obtained=rhs->future_obtained; + rhs->future.reset(); + return *this; + } + + operator boost::detail::thread_move_t<promise>() + { + return boost::detail::thread_move_t<promise>(*this); + } +#endif + + void swap(promise& other) + { + future.swap(other.future); + std::swap(future_obtained,other.future_obtained); + } + + // Result retrieval + unique_future<void> get_future() + { + lazy_init(); + + if(future_obtained) + { + throw future_already_retrieved(); + } + future_obtained=true; + return unique_future<void>(future); + } + + void set_value() + { + lazy_init(); + boost::lock_guard<boost::mutex> lock(future->mutex); + if(future->done) + { + throw promise_already_satisfied(); + } + future->mark_finished_with_result_internal(); + } + + void set_exception(boost::exception_ptr p) + { + lazy_init(); + boost::lock_guard<boost::mutex> lock(future->mutex); + if(future->done) + { + throw promise_already_satisfied(); + } + future->mark_exceptional_finish_internal(p); + } + + template<typename F> + void set_wait_callback(F f) + { + lazy_init(); + future->set_wait_callback(f,this); + } + + }; + + namespace detail + { + template<typename R> + struct task_base: + detail::future_object<R> + { + bool started; + + task_base(): + started(false) + {} + + void run() + { + { + boost::lock_guard<boost::mutex> lk(this->mutex); + if(started) + { + throw task_already_started(); + } + started=true; + } + do_run(); + } + + void owner_destroyed() + { + boost::lock_guard<boost::mutex> lk(this->mutex); + if(!started) + { + started=true; + this->mark_exceptional_finish_internal(boost::copy_exception(boost::broken_promise())); + } + } + + + virtual void do_run()=0; + }; + + + template<typename R,typename F> + struct task_object: + task_base<R> + { + F f; + task_object(F const& f_): + f(f_) + {} + task_object(boost::detail::thread_move_t<F> f_): + f(f_) + {} + + void do_run() + { + try + { + this->mark_finished_with_result(f()); + } + catch(...) + { + this->mark_exceptional_finish(); + } + } + }; + + template<typename F> + struct task_object<void,F>: + task_base<void> + { + F f; + task_object(F const& f_): + f(f_) + {} + task_object(boost::detail::thread_move_t<F> f_): + f(f_) + {} + + void do_run() + { + try + { + f(); + this->mark_finished_with_result(); + } + catch(...) + { + this->mark_exceptional_finish(); + } + } + }; + + } + + + template<typename R> + class packaged_task + { + boost::shared_ptr<detail::task_base<R> > task; + bool future_obtained; + + packaged_task(packaged_task&);// = delete; + packaged_task& operator=(packaged_task&);// = delete; + + public: + packaged_task(): + future_obtained(false) + {} + + // construction and destruction + template <class F> + explicit packaged_task(F const& f): + task(new detail::task_object<R,F>(f)),future_obtained(false) + {} + explicit packaged_task(R(*f)()): + task(new detail::task_object<R,R(*)()>(f)),future_obtained(false) + {} + + template <class F> + explicit packaged_task(boost::detail::thread_move_t<F> f): + task(new detail::task_object<R,F>(f)),future_obtained(false) + {} + +// template <class F, class Allocator> +// explicit packaged_task(F const& f, Allocator a); +// template <class F, class Allocator> +// explicit packaged_task(F&& f, Allocator a); + + + ~packaged_task() + { + if(task) + { + task->owner_destroyed(); + } + } + + // assignment +#ifdef BOOST_HAS_RVALUE_REFS + packaged_task(packaged_task&& other): + future_obtained(other.future_obtained) + { + task.swap(other.task); + other.future_obtained=false; + } + packaged_task& operator=(packaged_task&& other) + { + packaged_task temp(static_cast<packaged_task&&>(other)); + swap(temp); + return *this; + } +#else + packaged_task(boost::detail::thread_move_t<packaged_task> other): + future_obtained(other->future_obtained) + { + task.swap(other->task); + other->future_obtained=false; + } + packaged_task& operator=(boost::detail::thread_move_t<packaged_task> other) + { + packaged_task temp(other); + swap(temp); + return *this; + } + operator boost::detail::thread_move_t<packaged_task>() + { + return boost::detail::thread_move_t<packaged_task>(*this); + } +#endif + + void swap(packaged_task& other) + { + task.swap(other.task); + std::swap(future_obtained,other.future_obtained); + } + + // result retrieval + unique_future<R> get_future() + { + if(!task) + { + throw task_moved(); + } + else if(!future_obtained) + { + future_obtained=true; + return unique_future<R>(task); + } + else + { + throw future_already_retrieved(); + } + } + + + // execution + void operator()() + { + if(!task) + { + throw task_moved(); + } + task->run(); + } + + template<typename F> + void set_wait_callback(F f) + { + task->set_wait_callback(f,this); + } + + }; + +} + + +#endif diff --git a/3rdParty/Boost/src/boost/thread/locks.hpp b/3rdParty/Boost/src/boost/thread/locks.hpp index abbfd75..82394a5 100644 --- a/3rdParty/Boost/src/boost/thread/locks.hpp +++ b/3rdParty/Boost/src/boost/thread/locks.hpp @@ -214,6 +214,9 @@ namespace boost unique_lock& operator=(unique_lock&); unique_lock& operator=(upgrade_lock<Mutex>& other); public: +#ifdef __SUNPRO_CC + unique_lock(const volatile unique_lock&); +#endif unique_lock(): m(0),is_locked(false) {} @@ -260,16 +263,16 @@ namespace boost } - unique_lock& operator=(unique_lock<Mutex>&& other) + unique_lock& operator=(unique_lock&& other) { - unique_lock temp(other); + unique_lock temp(other.move()); swap(temp); return *this; } unique_lock& operator=(upgrade_lock<Mutex>&& other) { - unique_lock temp(other); + unique_lock temp(other.move()); swap(temp); return *this; } @@ -297,12 +300,20 @@ namespace boost return detail::thread_move_t<unique_lock<Mutex> >(*this); } +#ifdef __SUNPRO_CC + unique_lock& operator=(unique_lock<Mutex> other) + { + swap(other); + return *this; + } +#else unique_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other) { unique_lock temp(other); swap(temp); return *this; } +#endif unique_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other) { @@ -772,7 +783,7 @@ namespace boost other.is_locked=false; if(is_locked) { - m.unlock_upgrade_and_lock(); + m->unlock_upgrade_and_lock(); } } #else @@ -864,6 +875,28 @@ namespace boost try_lock_wrapper(Mutex& m_,try_to_lock_t): base(m_,try_to_lock) {} +#ifdef BOOST_HAS_RVALUE_REFS + try_lock_wrapper(try_lock_wrapper&& other): + base(other.move()) + {} + + try_lock_wrapper&& move() + { + return static_cast<try_lock_wrapper&&>(*this); + } + + try_lock_wrapper& operator=(try_lock_wrapper<Mutex>&& other) + { + try_lock_wrapper temp(other.move()); + swap(temp); + return *this; + } + + void swap(try_lock_wrapper&& other) + { + base::swap(other); + } +#else try_lock_wrapper(detail::thread_move_t<try_lock_wrapper<Mutex> > other): base(detail::thread_move_t<base>(*other)) {} @@ -885,12 +918,6 @@ namespace boost return *this; } -#ifdef BOOST_HAS_RVALUE_REFS - void swap(try_lock_wrapper&& other) - { - base::swap(other); - } -#else void swap(try_lock_wrapper& other) { base::swap(other); @@ -900,7 +927,6 @@ namespace boost base::swap(*other); } #endif - void lock() { base::lock(); diff --git a/3rdParty/Boost/src/boost/thread/pthread/shared_mutex.hpp b/3rdParty/Boost/src/boost/thread/pthread/shared_mutex.hpp index 3ce4e23..30440eb 100644 --- a/3rdParty/Boost/src/boost/thread/pthread/shared_mutex.hpp +++ b/3rdParty/Boost/src/boost/thread/pthread/shared_mutex.hpp @@ -10,8 +10,8 @@ #include <boost/assert.hpp> #include <boost/static_assert.hpp> #include <boost/thread/mutex.hpp> -#include <boost/thread/thread.hpp> #include <boost/thread/condition_variable.hpp> +#include <boost/thread/detail/thread_interruption.hpp> #include <boost/config/abi_prefix.hpp> diff --git a/3rdParty/Boost/src/boost/thread/pthread/thread_data.hpp b/3rdParty/Boost/src/boost/thread/pthread/thread_data.hpp index 244035b..730c77c 100644 --- a/3rdParty/Boost/src/boost/thread/pthread/thread_data.hpp +++ b/3rdParty/Boost/src/boost/thread/pthread/thread_data.hpp @@ -13,6 +13,7 @@ #include <boost/optional.hpp> #include <pthread.h> #include "condition_variable_fwd.hpp" +#include <map> #include <boost/config/abi_prefix.hpp> @@ -22,8 +23,18 @@ namespace boost namespace detail { + struct tss_cleanup_function; struct thread_exit_callback_node; - struct tss_data_node; + struct tss_data_node + { + boost::shared_ptr<boost::detail::tss_cleanup_function> func; + void* value; + + tss_data_node(boost::shared_ptr<boost::detail::tss_cleanup_function> func_, + void* value_): + func(func_),value(value_) + {} + }; struct thread_data_base; typedef boost::shared_ptr<thread_data_base> thread_data_ptr; @@ -41,14 +52,14 @@ namespace boost bool join_started; bool joined; boost::detail::thread_exit_callback_node* thread_exit_callbacks; - boost::detail::tss_data_node* tss_data; + std::map<void const*,boost::detail::tss_data_node> tss_data; bool interrupt_enabled; bool interrupt_requested; pthread_cond_t* current_cond; thread_data_base(): done(false),join_started(false),joined(false), - thread_exit_callbacks(0),tss_data(0), + thread_exit_callbacks(0), interrupt_enabled(true), interrupt_requested(false), current_cond(0) diff --git a/3rdParty/Boost/src/boost/thread/thread.hpp b/3rdParty/Boost/src/boost/thread/thread.hpp index 6146132..fdfdadc 100644 --- a/3rdParty/Boost/src/boost/thread/thread.hpp +++ b/3rdParty/Boost/src/boost/thread/thread.hpp @@ -20,6 +20,8 @@ #endif #include <boost/thread/detail/thread.hpp> +#include <boost/thread/detail/thread_interruption.hpp> +#include <boost/thread/detail/thread_group.hpp> #endif diff --git a/3rdParty/Boost/src/boost/thread/tss.hpp b/3rdParty/Boost/src/boost/thread/tss.hpp index 76380aa..e38e3e9 100644 --- a/3rdParty/Boost/src/boost/thread/tss.hpp +++ b/3rdParty/Boost/src/boost/thread/tss.hpp @@ -74,7 +74,7 @@ namespace boost } ~thread_specific_ptr() { - reset(); + detail::set_tss_data(this,boost::shared_ptr<detail::tss_cleanup_function>(),0,true); } T* get() const diff --git a/3rdParty/Boost/src/boost/throw_exception.hpp b/3rdParty/Boost/src/boost/throw_exception.hpp index da14339..656b8de 100644 --- a/3rdParty/Boost/src/boost/throw_exception.hpp +++ b/3rdParty/Boost/src/boost/throw_exception.hpp @@ -20,8 +20,9 @@ // http://www.boost.org/libs/utility/throw_exception.html // -#include <boost/config.hpp> +#include <boost/exception/detail/attribute_noreturn.hpp> #include <boost/detail/workaround.hpp> +#include <boost/config.hpp> #include <exception> #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) ) @@ -38,7 +39,7 @@ # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\ ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ ::boost::throw_file(__FILE__) <<\ - ::boost::throw_line((int)__LINE__)) + ::boost::throw_line(__LINE__)) #else # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x) #endif @@ -54,9 +55,9 @@ void throw_exception( std::exception const & e ); // user defined inline void throw_exception_assert_compatibility( std::exception const & ) { } -template<class E> inline void throw_exception( E const & e ) +template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e ) { - //All boost exceptions are required to derive std::exception, + //All boost exceptions are required to derive from std::exception, //to ensure compatibility with BOOST_NO_EXCEPTIONS. throw_exception_assert_compatibility(e); diff --git a/3rdParty/Boost/src/boost/type_traits/alignment_of.hpp b/3rdParty/Boost/src/boost/type_traits/alignment_of.hpp index 564d3bb..51357ce 100644 --- a/3rdParty/Boost/src/boost/type_traits/alignment_of.hpp +++ b/3rdParty/Boost/src/boost/type_traits/alignment_of.hpp @@ -57,11 +57,11 @@ template< typename T > struct alignment_of_impl { #if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400) - // - // With MSVC both the native __alignof operator - // and our own logic gets things wrong from time to time :-( - // Using a combination of the two seems to make the most of a bad job: - // + // + // With MSVC both the native __alignof operator + // and our own logic gets things wrong from time to time :-( + // Using a combination of the two seems to make the most of a bad job: + // BOOST_STATIC_CONSTANT(std::size_t, value = (::boost::detail::alignment_logic< sizeof(::boost::detail::alignment_of_hack<T>) - sizeof(T), diff --git a/3rdParty/Boost/src/boost/type_traits/intrinsics.hpp b/3rdParty/Boost/src/boost/type_traits/intrinsics.hpp index 91ee88b..8f88036 100644 --- a/3rdParty/Boost/src/boost/type_traits/intrinsics.hpp +++ b/3rdParty/Boost/src/boost/type_traits/intrinsics.hpp @@ -82,7 +82,7 @@ # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif -#if defined(BOOST_MSVC) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER >=140050215) +#if defined(BOOST_MSVC) && defined(BOOST_MSVC_FULL_VER) && (BOOST_MSVC_FULL_VER >=140050215) # include <boost/type_traits/is_same.hpp> # define BOOST_IS_UNION(T) __is_union(T) @@ -149,7 +149,7 @@ # define BOOST_IS_CLASS(T) __is_class(T) # define BOOST_IS_ENUM(T) __is_enum(T) # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T) -# if !defined(unix) || defined(__LP64__) +# if (!defined(unix) && !defined(__unix__)) || defined(__LP64__) // GCC sometimes lies about alignment requirements // of type double on 32-bit unix platforms, use the // old implementation instead in that case: diff --git a/3rdParty/Boost/src/boost/type_traits/is_abstract.hpp b/3rdParty/Boost/src/boost/type_traits/is_abstract.hpp index a11718d..09fdf33 100644 --- a/3rdParty/Boost/src/boost/type_traits/is_abstract.hpp +++ b/3rdParty/Boost/src/boost/type_traits/is_abstract.hpp @@ -94,12 +94,12 @@ struct is_abstract_imp2 #ifdef __GNUC__ BOOST_STATIC_CONSTANT(std::size_t, s1 = sizeof(is_abstract_imp2<T>::template check_sig<T>(0))); #else -#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) +#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(push) #pragma warning(disable:6334) #endif BOOST_STATIC_CONSTANT(std::size_t, s1 = sizeof(check_sig<T>(0))); -#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) +#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(pop) #endif #endif diff --git a/3rdParty/Boost/src/boost/type_traits/is_base_and_derived.hpp b/3rdParty/Boost/src/boost/type_traits/is_base_and_derived.hpp index 8367b76..d6a9991 100644 --- a/3rdParty/Boost/src/boost/type_traits/is_base_and_derived.hpp +++ b/3rdParty/Boost/src/boost/type_traits/is_base_and_derived.hpp @@ -15,10 +15,10 @@ #include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/detail/ice_and.hpp> -#include <boost/type_traits/remove_cv.hpp> #include <boost/config.hpp> #include <boost/static_assert.hpp> #endif +#include <boost/type_traits/remove_cv.hpp> // should be the last #include #include <boost/type_traits/detail/bool_trait_def.hpp> @@ -133,7 +133,7 @@ struct bd_helper template<typename B, typename D> struct is_base_and_derived_impl2 { -#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) +#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(push) #pragma warning(disable:6334) #endif @@ -156,7 +156,7 @@ struct is_base_and_derived_impl2 BOOST_STATIC_CONSTANT(bool, value = sizeof(bd_helper<B,D>::check_sig(Host(), 0)) == sizeof(type_traits::yes_type)); -#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) +#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(pop) #endif }; @@ -212,7 +212,7 @@ struct is_base_and_derived_impl typedef is_base_and_derived_select< ::boost::is_class<B>::value, ::boost::is_class<D>::value, - ::boost::is_same<B,D>::value> selector; + ::boost::is_same<ncvB,ncvD>::value> selector; typedef typename selector::template rebind<ncvB,ncvD> binder; typedef typename binder::type bound_type; @@ -222,7 +222,10 @@ struct is_base_and_derived_impl template <typename B, typename D> struct is_base_and_derived_impl { - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_BASE_OF(B,D)); + typedef typename remove_cv<B>::type ncvB; + typedef typename remove_cv<D>::type ncvD; + + BOOST_STATIC_CONSTANT(bool, value = (BOOST_IS_BASE_OF(B,D) && ! ::boost::is_same<ncvB,ncvD>::value)); }; #endif } // namespace detail diff --git a/3rdParty/Boost/src/boost/type_traits/is_base_of.hpp b/3rdParty/Boost/src/boost/type_traits/is_base_of.hpp index bf46da3..0cc7a32 100644 --- a/3rdParty/Boost/src/boost/type_traits/is_base_of.hpp +++ b/3rdParty/Boost/src/boost/type_traits/is_base_of.hpp @@ -11,21 +11,32 @@ #include <boost/type_traits/is_base_and_derived.hpp> #include <boost/type_traits/is_same.hpp> +#include <boost/type_traits/is_class.hpp> #include <boost/type_traits/detail/ice_or.hpp> +#include <boost/type_traits/detail/ice_and.hpp> // should be the last #include #include <boost/type_traits/detail/bool_trait_def.hpp> namespace boost { + namespace detail{ + template <class B, class D> + struct is_base_of_imp + { + typedef typename remove_cv<B>::type ncvB; + typedef typename remove_cv<D>::type ncvD; + BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or< + (::boost::detail::is_base_and_derived_impl<ncvB,ncvD>::value), + (::boost::type_traits::ice_and< ::boost::is_same<ncvB,ncvD>::value, ::boost::is_class<ncvB>::value>::value)>::value)); + }; + } + BOOST_TT_AUX_BOOL_TRAIT_DEF2( is_base_of , Base , Derived - , (::boost::type_traits::ice_or< - (::boost::detail::is_base_and_derived_impl<Base,Derived>::value), - (::boost::is_same<Base,Derived>::value)>::value) - ) + , (::boost::detail::is_base_of_imp<Base, Derived>::value)) #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived,false) diff --git a/3rdParty/Boost/src/boost/type_traits/is_convertible.hpp b/3rdParty/Boost/src/boost/type_traits/is_convertible.hpp index ce522a0..a31a930 100644 --- a/3rdParty/Boost/src/boost/type_traits/is_convertible.hpp +++ b/3rdParty/Boost/src/boost/type_traits/is_convertible.hpp @@ -256,7 +256,7 @@ struct is_convertible_basic_impl #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4244) -#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) +#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(disable:6334) #endif #endif diff --git a/3rdParty/Boost/src/boost/type_traits/is_function.hpp b/3rdParty/Boost/src/boost/type_traits/is_function.hpp index 1fba1bd..95dba0d 100644 --- a/3rdParty/Boost/src/boost/type_traits/is_function.hpp +++ b/3rdParty/Boost/src/boost/type_traits/is_function.hpp @@ -65,7 +65,7 @@ struct is_function_impl template <typename T> struct is_function_impl { -#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) +#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(push) #pragma warning(disable:6334) #endif @@ -74,7 +74,7 @@ struct is_function_impl bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t)) == sizeof(::boost::type_traits::yes_type) ); -#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) +#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(pop) #endif }; diff --git a/3rdParty/Boost/src/boost/type_traits/is_member_function_pointer.hpp b/3rdParty/Boost/src/boost/type_traits/is_member_function_pointer.hpp index 3fff063..81f1eac 100644 --- a/3rdParty/Boost/src/boost/type_traits/is_member_function_pointer.hpp +++ b/3rdParty/Boost/src/boost/type_traits/is_member_function_pointer.hpp @@ -64,7 +64,7 @@ struct is_mem_fun_pointer_select<false> { template <typename T> struct result_ { -#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) +#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(push) #pragma warning(disable:6334) #endif @@ -75,7 +75,7 @@ struct is_mem_fun_pointer_select<false> bool, value = ( 1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t)) )); -#if BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000) +#if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(pop) #endif }; diff --git a/3rdParty/Boost/src/boost/type_traits/is_member_pointer.hpp b/3rdParty/Boost/src/boost/type_traits/is_member_pointer.hpp index cdf3d6a..ba02b89 100644 --- a/3rdParty/Boost/src/boost/type_traits/is_member_pointer.hpp +++ b/3rdParty/Boost/src/boost/type_traits/is_member_pointer.hpp @@ -50,7 +50,7 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer, BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer<T>::value) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true) -#if !BOOST_WORKAROUND(__MWERKS__,<=0x3003) +#if !BOOST_WORKAROUND(__MWERKS__,<=0x3003) && !BOOST_WORKAROUND(__IBMCPP__, <=600) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const,true) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*volatile,true) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const volatile,true) diff --git a/3rdParty/Boost/src/boost/type_traits/is_signed.hpp b/3rdParty/Boost/src/boost/type_traits/is_signed.hpp index 73389a1..bf7bbfd 100644 --- a/3rdParty/Boost/src/boost/type_traits/is_signed.hpp +++ b/3rdParty/Boost/src/boost/type_traits/is_signed.hpp @@ -27,10 +27,18 @@ namespace detail{ #if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) template <class T> +struct is_signed_values +{ + typedef typename remove_cv<T>::type no_cv_t; + BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast<no_cv_t>(-1))); + BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast<no_cv_t>(0))); +}; + +template <class T> struct is_signed_helper { typedef typename remove_cv<T>::type no_cv_t; - BOOST_STATIC_CONSTANT(bool, value = (static_cast<no_cv_t>(-1) < 0)); + BOOST_STATIC_CONSTANT(bool, value = (!(::boost::detail::is_signed_values<T>::minus_one > boost::detail::is_signed_values<T>::zero))); }; template <bool integral_type> diff --git a/3rdParty/Boost/src/boost/type_traits/is_unsigned.hpp b/3rdParty/Boost/src/boost/type_traits/is_unsigned.hpp index 4866486..98baf4e 100644 --- a/3rdParty/Boost/src/boost/type_traits/is_unsigned.hpp +++ b/3rdParty/Boost/src/boost/type_traits/is_unsigned.hpp @@ -27,10 +27,17 @@ namespace detail{ #if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) template <class T> -struct is_ununsigned_helper +struct is_unsigned_values { typedef typename remove_cv<T>::type no_cv_t; - BOOST_STATIC_CONSTANT(bool, value = (static_cast<no_cv_t>(-1) > 0)); + BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast<no_cv_t>(-1))); + BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast<no_cv_t>(0))); +}; + +template <class T> +struct is_ununsigned_helper +{ + BOOST_STATIC_CONSTANT(bool, value = (::boost::detail::is_unsigned_values<T>::minus_one > ::boost::detail::is_unsigned_values<T>::zero)); }; template <bool integral_type> diff --git a/3rdParty/Boost/src/boost/utility/addressof.hpp b/3rdParty/Boost/src/boost/utility/addressof.hpp index ac42a51..95cd92f 100644 --- a/3rdParty/Boost/src/boost/utility/addressof.hpp +++ b/3rdParty/Boost/src/boost/utility/addressof.hpp @@ -27,6 +27,9 @@ template<class T> struct addr_impl_ref inline addr_impl_ref( T & v ): v_( v ) {} inline operator T& () const { return v_; } + +private: + addr_impl_ref & operator=(const addr_impl_ref &); }; template<class T> struct addressof_impl diff --git a/3rdParty/Boost/src/boost/utility/value_init.hpp b/3rdParty/Boost/src/boost/utility/value_init.hpp index aa7ecb4..5aefac9 100644 --- a/3rdParty/Boost/src/boost/utility/value_init.hpp +++ b/3rdParty/Boost/src/boost/utility/value_init.hpp @@ -8,6 +8,7 @@ // 24 Dec 2007 (Refactored and worked around various compiler bugs) Fernando Cacciola, Niels Dekker // 23 May 2008 (Fixed operator= const issue, added initialized_value) Niels Dekker, Fernando Cacciola // 21 Ago 2008 (Added swap) Niels Dekker, Fernando Cacciola +// 20 Feb 2009 (Fixed logical const-ness issues) Niels Dekker, Fernando Cacciola // #ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP #define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP @@ -90,7 +91,12 @@ class value_initialized wrapper_address()->wrapper::~wrapper(); } - T& data() const + T const & data() const + { + return wrapper_address()->data; + } + + T& data() { return wrapper_address()->data; } @@ -100,7 +106,9 @@ class value_initialized ::boost::swap( this->data(), arg.data() ); } - operator T&() const { return this->data(); } + operator T const &() const { return this->data(); } + + operator T&() { return this->data(); } } ; diff --git a/3rdParty/Boost/src/boost/version.hpp b/3rdParty/Boost/src/boost/version.hpp index 8269beb..e95ff85 100644 --- a/3rdParty/Boost/src/boost/version.hpp +++ b/3rdParty/Boost/src/boost/version.hpp @@ -19,7 +19,7 @@ // BOOST_VERSION / 100 % 1000 is the minor version // BOOST_VERSION / 100000 is the major version -#define BOOST_VERSION 103900 +#define BOOST_VERSION 104200 // // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION @@ -27,7 +27,7 @@ // number, y is the minor version number, and z is the patch level if not 0. // This is used by <config/auto_link.hpp> to select which library version to link to. -#define BOOST_LIB_VERSION "1_39" +#define BOOST_LIB_VERSION "1_42" #endif diff --git a/3rdParty/Boost/src/libs/detail/utf8_codecvt_facet.cpp b/3rdParty/Boost/src/libs/detail/utf8_codecvt_facet.cpp index 658ab6a..7ea5eeb 100644 --- a/3rdParty/Boost/src/libs/detail/utf8_codecvt_facet.cpp +++ b/3rdParty/Boost/src/libs/detail/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; @@ -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,22 @@ 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 <boost/detail/utf8_codecvt_facet.hpp> as we do + // should be enough to get WCHAR_MAX defined. +#if !defined(WCHAR_MAX) +# error WCHAR_MAX not defined! +#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; } if (word < 0x200000) { @@ -252,6 +264,10 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){ return 4; } return 5; + +#else + return 2; +#endif } } // namespace anonymous diff --git a/3rdParty/Boost/src/libs/filesystem/src/operations.cpp b/3rdParty/Boost/src/libs/filesystem/src/operations.cpp index 0c74504..d0655b9 100644 --- a/3rdParty/Boost/src/libs/filesystem/src/operations.cpp +++ b/3rdParty/Boost/src/libs/filesystem/src/operations.cpp @@ -54,14 +54,7 @@ using boost::system::system_category; # if defined(BOOST_WINDOWS_API) # include <windows.h> -# if defined(__BORLANDC__) || defined(__MWERKS__) -# if defined(__BORLANDC__) - using std::time_t; -# endif -# include <utime.h> -# else -# include <sys/utime.h> -# endif +# include <ctime> // for time_t # else // BOOST_POSIX_API # include <sys/types.h> @@ -706,9 +699,9 @@ namespace boost } BOOST_FILESYSTEM_DECL error_code - copy_file_api( const std::wstring & from, const std::wstring & to ) + copy_file_api( const std::wstring & from, const std::wstring & to, bool fail_if_exists ) { - return error_code( ::CopyFileW( from.c_str(), to.c_str(), /*fail_if_exists=*/true ) + return error_code( ::CopyFileW( from.c_str(), to.c_str(), fail_if_exists ) ? 0 : ::GetLastError(), system_category ); } @@ -886,9 +879,9 @@ namespace boost } BOOST_FILESYSTEM_DECL error_code - copy_file_api( const std::string & from, const std::string & to ) + copy_file_api( const std::string & from, const std::string & to, bool fail_if_exists ) { - return error_code( ::CopyFileA( from.c_str(), to.c_str(), /*fail_if_exists=*/true ) + return error_code( ::CopyFileA( from.c_str(), to.c_str(), fail_if_exists ) ? 0 : ::GetLastError(), system_category ); } @@ -1203,22 +1196,30 @@ namespace boost BOOST_FILESYSTEM_DECL error_code copy_file_api( const std::string & from_file_ph, - const std::string & to_file_ph ) + const std::string & to_file_ph, bool fail_if_exists ) { const std::size_t buf_sz = 32768; boost::scoped_array<char> buf( new char [buf_sz] ); int infile=-1, outfile=-1; // -1 means not open + + // bug fixed: code previously did a stat() on the from_file first, but that + // introduced a gratuitous race condition; the stat() is now done after the open() + + if ( (infile = ::open( from_file_ph.c_str(), O_RDONLY )) < 0 ) + { return error_code( errno, system_category ); } + struct stat from_stat; + if ( ::stat( from_file_ph.c_str(), &from_stat ) != 0 ) + { return error_code( errno, system_category ); } - if ( ::stat( from_file_ph.c_str(), &from_stat ) != 0 - || (infile = ::open( from_file_ph.c_str(), - O_RDONLY )) < 0 - || (outfile = ::open( to_file_ph.c_str(), - O_WRONLY | O_CREAT | O_EXCL, - from_stat.st_mode )) < 0 ) + int oflag = O_CREAT | O_WRONLY; + if ( fail_if_exists ) oflag |= O_EXCL; + if ( (outfile = ::open( to_file_ph.c_str(), oflag, from_stat.st_mode )) < 0 ) { - if ( infile >= 0 ) ::close( infile ); - return error_code( errno, system_category ); + int open_errno = errno; + BOOST_ASSERT( infile >= 0 ); + ::close( infile ); + return error_code( open_errno, system_category ); } ssize_t sz, sz_read=1, sz_write; @@ -1281,7 +1282,7 @@ namespace boost target = std::string( "." ); // string was static but caused trouble // when iteration called from dtor, after // static had already been destroyed - std::size_t path_size; + std::size_t path_size (0); // initialization quiets gcc warning error_code ec = path_max( path_size ); if ( ec ) return ec; dirent de; diff --git a/3rdParty/Boost/src/libs/regex/src/c_regex_traits.cpp b/3rdParty/Boost/src/libs/regex/src/c_regex_traits.cpp index da960eb..6466bc4 100644 --- a/3rdParty/Boost/src/libs/regex/src/c_regex_traits.cpp +++ b/3rdParty/Boost/src/libs/regex/src/c_regex_traits.cpp @@ -122,7 +122,9 @@ enum char_class_graph=char_class_alnum|char_class_punct, char_class_blank=1<<9, char_class_word=1<<10, - char_class_unicode=1<<11 + char_class_unicode=1<<11, + char_class_horizontal=1<<12, + char_class_vertical=1<<13 }; c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::lookup_classname(const char* p1, const char* p2) @@ -137,6 +139,7 @@ c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::loo char_class_digit, char_class_digit, char_class_graph, + char_class_horizontal, char_class_lower, char_class_lower, char_class_print, @@ -146,6 +149,7 @@ c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::loo char_class_upper, char_class_unicode, char_class_upper, + char_class_vertical, char_class_alnum | char_class_word, char_class_alnum | char_class_word, char_class_xdigit, @@ -176,7 +180,9 @@ bool BOOST_REGEX_CALL c_regex_traits<char>::isctype(char c, char_class_type mask || ((mask & char_class_punct) && (std::ispunct)(static_cast<unsigned char>(c))) || ((mask & char_class_xdigit) && (std::isxdigit)(static_cast<unsigned char>(c))) || ((mask & char_class_blank) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::re_detail::is_separator(c)) - || ((mask & char_class_word) && (c == '_')); + || ((mask & char_class_word) && (c == '_')) + || ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == '\v'))) + || ((mask & char_class_horizontal) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::re_detail::is_separator(c) && (c != '\v')); } c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::lookup_collatename(const char* p1, const char* p2) diff --git a/3rdParty/Boost/src/libs/regex/src/cpp_regex_traits.cpp b/3rdParty/Boost/src/libs/regex/src/cpp_regex_traits.cpp index 9ed66be..1d24cc1 100644 --- a/3rdParty/Boost/src/libs/regex/src/cpp_regex_traits.cpp +++ b/3rdParty/Boost/src/libs/regex/src/cpp_regex_traits.cpp @@ -42,7 +42,7 @@ void cpp_regex_traits_char_layer<char>::init() std::messages<char>::catalog cat = reinterpret_cast<std::messages<char>::catalog>(-1); #endif std::string cat_name(cpp_regex_traits<char>::get_catalog_name()); - if(cat_name.size()) + if(cat_name.size() && (m_pmessages != 0)) { cat = this->m_pmessages->open( cat_name, diff --git a/3rdParty/Boost/src/libs/regex/src/cregex.cpp b/3rdParty/Boost/src/libs/regex/src/cregex.cpp index fb12373..f67d371 100644 --- a/3rdParty/Boost/src/libs/regex/src/cregex.cpp +++ b/3rdParty/Boost/src/libs/regex/src/cregex.cpp @@ -563,11 +563,7 @@ std::string RegEx::What(int i)const return result; } -#ifdef BOOST_HAS_LONG_LONG -const std::size_t RegEx::npos = static_cast<std::size_t>(~0ULL); -#else -const std::size_t RegEx::npos = static_cast<std::size_t>(~0UL); -#endif +const std::size_t RegEx::npos = ~static_cast<std::size_t>(0); } // namespace boost diff --git a/3rdParty/Boost/src/libs/regex/src/fileiter.cpp b/3rdParty/Boost/src/libs/regex/src/fileiter.cpp index 7d9c7f8..ff1d111 100644 --- a/3rdParty/Boost/src/libs/regex/src/fileiter.cpp +++ b/3rdParty/Boost/src/libs/regex/src/fileiter.cpp @@ -258,11 +258,22 @@ void mapfile::lock(pointer* node)const *p = 0; *(reinterpret_cast<int*>(*node)) = 1; } - std::fseek(hfile, (node - _first) * buf_size, SEEK_SET); - if(node == _last - 1) - std::fread(*node + sizeof(int), _size % buf_size, 1, hfile); - else - std::fread(*node + sizeof(int), buf_size, 1, hfile); + + std::size_t read_size = 0; + int read_pos = std::fseek(hfile, (node - _first) * buf_size, SEEK_SET); + + if(0 == read_pos && node == _last - 1) + read_size = std::fread(*node + sizeof(int), _size % buf_size, 1, hfile); + else + read_size = std::fread(*node + sizeof(int), buf_size, 1, hfile); +#ifndef BOOST_NO_EXCEPTIONS + if((read_size == 0) || (std::ferror(hfile))) + { + throw std::runtime_error("Unable to read file."); + } +#else + BOOST_REGEX_NOEH_ASSERT((0 == std::ferror(hfile)) && (read_size != 0)); +#endif } else { diff --git a/3rdParty/Boost/src/libs/regex/src/icu.cpp b/3rdParty/Boost/src/libs/regex/src/icu.cpp index e06c317..a815e91 100644 --- a/3rdParty/Boost/src/libs/regex/src/icu.cpp +++ b/3rdParty/Boost/src/libs/regex/src/icu.cpp @@ -101,6 +101,8 @@ const icu_regex_traits::char_class_type icu_regex_traits::mask_underscore = icu_ const icu_regex_traits::char_class_type icu_regex_traits::mask_unicode = icu_regex_traits::char_class_type(1) << offset_unicode; const icu_regex_traits::char_class_type icu_regex_traits::mask_any = icu_regex_traits::char_class_type(1) << offset_any; const icu_regex_traits::char_class_type icu_regex_traits::mask_ascii = icu_regex_traits::char_class_type(1) << offset_ascii; +const icu_regex_traits::char_class_type icu_regex_traits::mask_horizontal = icu_regex_traits::char_class_type(1) << offset_horizontal; +const icu_regex_traits::char_class_type icu_regex_traits::mask_vertical = icu_regex_traits::char_class_type(1) << offset_vertical; icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2) { @@ -370,6 +372,7 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_ U_GC_ND_MASK, U_GC_ND_MASK, (0x3FFFFFFFu) & ~(U_GC_CC_MASK | U_GC_CF_MASK | U_GC_CS_MASK | U_GC_CN_MASK | U_GC_Z_MASK), + mask_horizontal, U_GC_LL_MASK, U_GC_LL_MASK, ~(U_GC_C_MASK), @@ -379,6 +382,7 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_ U_GC_LU_MASK, mask_unicode, U_GC_LU_MASK, + mask_vertical, char_class_type(U_GC_L_MASK | U_GC_ND_MASK | U_GC_MN_MASK) | mask_underscore, char_class_type(U_GC_L_MASK | U_GC_ND_MASK | U_GC_MN_MASK) | mask_underscore, char_class_type(U_GC_ND_MASK) | mask_xdigit, @@ -487,6 +491,10 @@ bool icu_regex_traits::isctype(char_type c, char_class_type f) const return true; if(((f & mask_ascii) != 0) && (c <= 0x7F)) return true; + if(((f & mask_vertical) != 0) && (::boost::re_detail::is_separator(c) || (c == static_cast<char_type>('\v')) || (m == U_GC_ZL_MASK) || (m == U_GC_ZP_MASK))) + return true; + if(((f & mask_horizontal) != 0) && !::boost::re_detail::is_separator(c) && u_isspace(c) && (c != static_cast<char_type>('\v'))) + return true; return false; } diff --git a/3rdParty/Boost/src/libs/regex/src/posix_api.cpp b/3rdParty/Boost/src/libs/regex/src/posix_api.cpp index 1564ced..37ed422 100644 --- a/3rdParty/Boost/src/libs/regex/src/posix_api.cpp +++ b/3rdParty/Boost/src/libs/regex/src/posix_api.cpp @@ -58,6 +58,7 @@ const char* names[] = { "REG_EMPTY", "REG_ECOMPLEXITY", "REG_ESTACK", + "REG_E_PERL", "REG_E_UNKNOWN", }; } // namespace diff --git a/3rdParty/Boost/src/libs/regex/src/regex_traits_defaults.cpp b/3rdParty/Boost/src/libs/regex/src/regex_traits_defaults.cpp index 8f76c09..31b7918 100644 --- a/3rdParty/Boost/src/libs/regex/src/regex_traits_defaults.cpp +++ b/3rdParty/Boost/src/libs/regex/src/regex_traits_defaults.cpp @@ -100,6 +100,9 @@ BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_syntax(regex_constants "p", "P", "N", + "g", + "K", + "R", }; return ((n >= (sizeof(messages) / sizeof(messages[1]))) ? "" : messages[n]); @@ -108,30 +111,31 @@ BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_syntax(regex_constants BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_error_string(regex_constants::error_type n) { static const char* const s_default_error_messages[] = { - "Success", /* REG_NOERROR */ - "No match", /* REG_NOMATCH */ - "Invalid regular expression", /* REG_BADPAT */ - "Invalid collation character", /* REG_ECOLLATE */ - "Invalid character class name", /* REG_ECTYPE */ - "Invalid or trailing backslash", /* REG_EESCAPE */ - "Invalid back reference", /* REG_ESUBREG */ - "Unmatched [ or [^", /* REG_EBRACK */ - "Unmatched ( or \\(", /* REG_EPAREN */ - "Unmatched { or \\{", /* REG_EBRACE */ - "Invalid content of repeat range", /* REG_BADBR */ - "Invalid range end", /* REG_ERANGE */ - "Memory exhausted", /* REG_ESPACE */ - "Invalid preceding regular expression", /* REG_BADRPT */ - "Premature end of regular expression", /* REG_EEND */ - "Regular expression too big", /* REG_ESIZE */ - "Unmatched ) or \\)", /* REG_ERPAREN */ - "Empty expression", /* REG_EMPTY */ - "Complexity requirements exceeded", /* REG_ECOMPLEXITY */ - "Out of stack space", /* REG_ESTACK */ - "Unknown error", /* REG_E_UNKNOWN */ - "", - "", - "", + "Success", /* REG_NOERROR 0 error_ok */ + "No match", /* REG_NOMATCH 1 error_no_match */ + "Invalid regular expression.", /* REG_BADPAT 2 error_bad_pattern */ + "Invalid collation character.", /* REG_ECOLLATE 3 error_collate */ + "Invalid character class name, collating name, or character range.", /* REG_ECTYPE 4 error_ctype */ + "Invalid or unterminated escape sequence.", /* REG_EESCAPE 5 error_escape */ + "Invalid back reference: specified capturing group does not exist.", /* REG_ESUBREG 6 error_backref */ + "Unmatched [ or [^ in character class declaration.", /* REG_EBRACK 7 error_brack */ + "Unmatched marking parenthesis ( or \\(.", /* REG_EPAREN 8 error_paren */ + "Unmatched quantified repeat operator { or \\{.", /* REG_EBRACE 9 error_brace */ + "Invalid content of repeat range.", /* REG_BADBR 10 error_badbrace */ + "Invalid range end in character class", /* REG_ERANGE 11 error_range */ + "Out of memory.", /* REG_ESPACE 12 error_space NOT USED */ + "Invalid preceding regular expression prior to repetition operator.", /* REG_BADRPT 13 error_badrepeat */ + "Premature end of regular expression", /* REG_EEND 14 error_end NOT USED */ + "Regular expression is too large.", /* REG_ESIZE 15 error_size NOT USED */ + "Unmatched ) or \\)", /* REG_ERPAREN 16 error_right_paren NOT USED */ + "Empty regular expression.", /* REG_EMPTY 17 error_empty */ + "The complexity of matching the regular expression exceeded predefined bounds. " + "Try refactoring the regular expression to make each choice made by the state machine unambiguous. " + "This exception is thrown to prevent \"eternal\" matches that take an " + "indefinite period time to locate.", /* REG_ECOMPLEXITY 18 error_complexity */ + "Ran out of stack space trying to match the regular expression.", /* REG_ESTACK 19 error_stack */ + "Invalid or unterminated Perl (?...) sequence.", /* REG_E_PERL 20 error_perl */ + "Unknown error.", /* REG_E_UNKNOWN 21 error_unknown */ }; return (n > ::boost::regex_constants::error_unknown) ? s_default_error_messages[ ::boost::regex_constants::error_unknown] : s_default_error_messages[n]; @@ -375,14 +379,14 @@ BOOST_REGEX_DECL regex_constants::escape_syntax_type BOOST_REGEX_CALL get_defaul regex_constants::escape_type_not_class, /*H*/ regex_constants::escape_type_not_class, /*I*/ regex_constants::escape_type_not_class, /*J*/ - regex_constants::escape_type_not_class, /*K*/ + regex_constants::escape_type_reset_start_mark, /*K*/ regex_constants::escape_type_not_class, /*L*/ regex_constants::escape_type_not_class, /*M*/ regex_constants::escape_type_named_char, /*N*/ regex_constants::escape_type_not_class, /*O*/ regex_constants::escape_type_not_property, /*P*/ regex_constants::escape_type_Q, /*Q*/ - regex_constants::escape_type_not_class, /*R*/ + regex_constants::escape_type_line_ending, /*R*/ regex_constants::escape_type_not_class, /*S*/ regex_constants::escape_type_not_class, /*T*/ regex_constants::escape_type_not_class, /*U*/ @@ -403,11 +407,11 @@ BOOST_REGEX_DECL regex_constants::escape_syntax_type BOOST_REGEX_CALL get_defaul regex_constants::escape_type_class, /*d*/ regex_constants::escape_type_e, /*e*/ regex_constants::escape_type_control_f, /*f*/ - regex_constants::escape_type_class, /*g*/ + regex_constants::escape_type_extended_backref, /*g*/ regex_constants::escape_type_class, /*h*/ regex_constants::escape_type_class, /*i*/ regex_constants::escape_type_class, /*j*/ - regex_constants::escape_type_class, /*k*/ + regex_constants::escape_type_extended_backref, /*k*/ regex_constants::escape_type_class, /*l*/ regex_constants::escape_type_class, /*m*/ regex_constants::escape_type_control_n, /*n*/ @@ -534,7 +538,7 @@ BOOST_REGEX_DECL regex_constants::syntax_type BOOST_REGEX_CALL get_default_synta regex_constants::syntax_dollar, /*$*/ regex_constants::syntax_char, /*%*/ regex_constants::syntax_char, /*&*/ - regex_constants::syntax_char, /*'*/ + regex_constants::escape_type_end_buffer, /*'*/ regex_constants::syntax_open_mark, /*(*/ regex_constants::syntax_close_mark, /*)*/ regex_constants::syntax_star, /***/ diff --git a/3rdParty/Boost/src/libs/regex/src/static_mutex.cpp b/3rdParty/Boost/src/libs/regex/src/static_mutex.cpp index cef7678..d14feb1 100644 --- a/3rdParty/Boost/src/libs/regex/src/static_mutex.cpp +++ b/3rdParty/Boost/src/libs/regex/src/static_mutex.cpp @@ -124,7 +124,7 @@ void scoped_static_mutex_lock::unlock() boost::recursive_mutex* static_mutex::m_pmutex = 0; boost::once_flag static_mutex::m_once = BOOST_ONCE_INIT; -extern "C" BOOST_REGEX_DECL void free_static_mutex() +extern "C" BOOST_REGEX_DECL void boost_regex_free_static_mutex() { delete static_mutex::m_pmutex; static_mutex::m_pmutex = 0; @@ -133,7 +133,7 @@ extern "C" BOOST_REGEX_DECL void free_static_mutex() void static_mutex::init() { m_pmutex = new boost::recursive_mutex(); - int r = atexit(free_static_mutex); + int r = atexit(boost_regex_free_static_mutex); BOOST_ASSERT(0 == r); } @@ -157,7 +157,7 @@ void scoped_static_mutex_lock::lock() { boost::call_once(static_mutex::m_once,&static_mutex::init); if(0 == m_plock) - m_plock = new boost::recursive_mutex::scoped_lock(*static_mutex::m_pmutex, false); + m_plock = new boost::recursive_mutex::scoped_lock(*static_mutex::m_pmutex, boost::defer_lock); m_plock->lock(); m_have_lock = true; } diff --git a/3rdParty/Boost/src/libs/regex/src/usinstances.cpp b/3rdParty/Boost/src/libs/regex/src/usinstances.cpp index 5665366..44ebd28 100644 --- a/3rdParty/Boost/src/libs/regex/src/usinstances.cpp +++ b/3rdParty/Boost/src/libs/regex/src/usinstances.cpp @@ -17,13 +17,17 @@ */ #define BOOST_REGEX_SOURCE +#ifdef _MSC_VER +#pragma warning(disable:4506) // 'no definition for inline function' +#endif #include <boost/detail/workaround.hpp> #include <memory> #include <string> #if defined(_DLL_CPPLIB) && !defined(_M_CEE_PURE) && defined(_NATIVE_WCHAR_T_DEFINED) \ - && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)) + && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))\ + && BOOST_WORKAROUND(BOOST_MSVC, <1600) // // This is a horrible workaround, but without declaring these symbols extern we get // duplicate symbol errors when linking if the application is built without diff --git a/3rdParty/Boost/src/libs/regex/src/wc_regex_traits.cpp b/3rdParty/Boost/src/libs/regex/src/wc_regex_traits.cpp index 3640f29..fb622b5 100644 --- a/3rdParty/Boost/src/libs/regex/src/wc_regex_traits.cpp +++ b/3rdParty/Boost/src/libs/regex/src/wc_regex_traits.cpp @@ -24,7 +24,8 @@ #include <string> #if defined(_DLL_CPPLIB) && !defined(_M_CEE_PURE) && defined(_NATIVE_WCHAR_T_DEFINED) \ - && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)) + && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))\ + && BOOST_WORKAROUND(BOOST_MSVC, <1600) // // This is a horrible workaround, but without declaring these symbols extern we get // duplicate symbol errors when linking if the application is built without @@ -161,7 +162,9 @@ enum char_class_graph=char_class_alnum|char_class_punct, char_class_blank=1<<9, char_class_word=1<<10, - char_class_unicode=1<<11 + char_class_unicode=1<<11, + char_class_horizontal=1<<12, + char_class_vertical=1<<13 }; c_regex_traits<wchar_t>::char_class_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_classname(const wchar_t* p1, const wchar_t* p2) @@ -176,6 +179,7 @@ c_regex_traits<wchar_t>::char_class_type BOOST_REGEX_CALL c_regex_traits<wchar_t char_class_digit, char_class_digit, char_class_graph, + char_class_horizontal, char_class_lower, char_class_lower, char_class_print, @@ -185,6 +189,7 @@ c_regex_traits<wchar_t>::char_class_type BOOST_REGEX_CALL c_regex_traits<wchar_t char_class_upper, char_class_unicode, char_class_upper, + char_class_vertical, char_class_alnum | char_class_word, char_class_alnum | char_class_word, char_class_xdigit, @@ -216,7 +221,9 @@ bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::isctype(wchar_t c, char_class_typ || ((mask & char_class_xdigit) && (std::iswxdigit)(c)) || ((mask & char_class_blank) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c)) || ((mask & char_class_word) && (c == '_')) - || ((mask & char_class_unicode) && (c & ~static_cast<wchar_t>(0xff))); + || ((mask & char_class_unicode) && (c & ~static_cast<wchar_t>(0xff))) + || ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == L'\v'))) + || ((mask & char_class_horizontal) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c) && (c != L'\v')); } c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_collatename(const wchar_t* p1, const wchar_t* p2) diff --git a/3rdParty/Boost/src/libs/regex/src/wide_posix_api.cpp b/3rdParty/Boost/src/libs/regex/src/wide_posix_api.cpp index c8a9190..bdb7580 100644 --- a/3rdParty/Boost/src/libs/regex/src/wide_posix_api.cpp +++ b/3rdParty/Boost/src/libs/regex/src/wide_posix_api.cpp @@ -65,6 +65,7 @@ const wchar_t* wnames[] = { L"REG_EMPTY", L"REG_ECOMPLEXITY", L"REG_ESTACK", + L"REG_E_PERL", L"REG_E_UNKNOWN", }; } diff --git a/3rdParty/Boost/src/libs/signals/src/named_slot_map.cpp b/3rdParty/Boost/src/libs/signals/src/named_slot_map.cpp index 85a4bda..1ddde63 100644 --- a/3rdParty/Boost/src/libs/signals/src/named_slot_map.cpp +++ b/3rdParty/Boost/src/libs/signals/src/named_slot_map.cpp @@ -24,7 +24,7 @@ typedef slot_container_type::iterator group_iterator; typedef slot_container_type::const_iterator const_group_iterator; -#if BOOST_WORKAROUND(_MSC_VER, <= 1500) +#if BOOST_WORKAROUND(_MSC_VER, <= 1600) void named_slot_map_iterator::decrement() { assert(false); } void named_slot_map_iterator::advance(difference_type) { assert(false); } #endif diff --git a/3rdParty/Boost/src/libs/system/src/error_code.cpp b/3rdParty/Boost/src/libs/system/src/error_code.cpp index 030ab70..fa2cb0b 100644 --- a/3rdParty/Boost/src/libs/system/src/error_code.cpp +++ b/3rdParty/Boost/src/libs/system/src/error_code.cpp @@ -23,7 +23,7 @@ #include <cassert> using namespace boost::system; -using namespace boost::system::posix_error; +using namespace boost::system::errc; #include <cstring> // for strerror/strerror_r @@ -193,7 +193,7 @@ namespace case EIO: return make_error_condition( io_error ); case EISCONN: return make_error_condition( already_connected ); case EISDIR: return make_error_condition( is_a_directory ); - case ELOOP: return make_error_condition( too_many_synbolic_link_levels ); + case ELOOP: return make_error_condition( too_many_symbolic_link_levels ); case EMFILE: return make_error_condition( too_many_files_open ); case EMLINK: return make_error_condition( too_many_links ); case EMSGSIZE: return make_error_condition( message_size ); @@ -411,11 +411,13 @@ namespace boost namespace system { +# ifndef BOOST_SYSTEM_NO_DEPRECATED BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code; // note that it doesn't matter if this // isn't initialized before use since // the only use is to take its // address for comparison purposes +# endif BOOST_SYSTEM_DECL const error_category & get_system_category() { diff --git a/3rdParty/Boost/src/libs/thread/src/pthread/exceptions.cpp b/3rdParty/Boost/src/libs/thread/src/pthread/exceptions.cpp deleted file mode 100644 index 8881303..0000000 --- a/3rdParty/Boost/src/libs/thread/src/pthread/exceptions.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (C) 2001-2003 -// William E. Kempf -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include <boost/thread/detail/config.hpp> - -#include <boost/thread/exceptions.hpp> -#include <cstring> -#include <string> - -namespace boost { - -thread_exception::thread_exception() - : m_sys_err(0) -{ -} - -thread_exception::thread_exception(int sys_err_code) - : m_sys_err(sys_err_code) -{ -} - -thread_exception::~thread_exception() throw() -{ -} - -int thread_exception::native_error() const -{ - return m_sys_err; -} - -lock_error::lock_error() -{ -} - -lock_error::lock_error(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -lock_error::~lock_error() throw() -{ -} - -const char* lock_error::what() const throw() -{ - return "boost::lock_error"; -} - -thread_resource_error::thread_resource_error() -{ -} - -thread_resource_error::thread_resource_error(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -thread_resource_error::~thread_resource_error() throw() -{ -} - -const char* thread_resource_error::what() const throw() -{ - return "boost::thread_resource_error"; -} - -unsupported_thread_option::unsupported_thread_option() -{ -} - -unsupported_thread_option::unsupported_thread_option(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -unsupported_thread_option::~unsupported_thread_option() throw() -{ -} - -const char* unsupported_thread_option::what() const throw() -{ - return "boost::unsupported_thread_option"; -} - -invalid_thread_argument::invalid_thread_argument() -{ -} - -invalid_thread_argument::invalid_thread_argument(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -invalid_thread_argument::~invalid_thread_argument() throw() -{ -} - -const char* invalid_thread_argument::what() const throw() -{ - return "boost::invalid_thread_argument"; -} - -thread_permission_error::thread_permission_error() -{ -} - -thread_permission_error::thread_permission_error(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -thread_permission_error::~thread_permission_error() throw() -{ -} - -const char* thread_permission_error::what() const throw() -{ - return "boost::thread_permission_error"; -} - -} // namespace boost diff --git a/3rdParty/Boost/src/libs/thread/src/pthread/thread.cpp b/3rdParty/Boost/src/libs/thread/src/pthread/thread.cpp index cc71d97..3a5ce7c 100644 --- a/3rdParty/Boost/src/libs/thread/src/pthread/thread.cpp +++ b/3rdParty/Boost/src/libs/thread/src/pthread/thread.cpp @@ -42,19 +42,6 @@ namespace boost {} }; - struct tss_data_node - { - void const* key; - boost::shared_ptr<boost::detail::tss_cleanup_function> func; - void* value; - tss_data_node* next; - - tss_data_node(void const* key_,boost::shared_ptr<boost::detail::tss_cleanup_function> func_,void* value_, - tss_data_node* next_): - key(key_),func(func_),value(value_),next(next_) - {} - }; - namespace { boost::once_flag current_thread_tls_init_flag=BOOST_ONCE_INIT; @@ -67,7 +54,7 @@ namespace boost boost::detail::thread_data_base* thread_info=static_cast<boost::detail::thread_data_base*>(data); if(thread_info) { - while(thread_info->tss_data || thread_info->thread_exit_callbacks) + while(!thread_info->tss_data.empty() || thread_info->thread_exit_callbacks) { while(thread_info->thread_exit_callbacks) { @@ -80,15 +67,18 @@ namespace boost } delete current_node; } - while(thread_info->tss_data) + for(std::map<void const*,tss_data_node>::iterator next=thread_info->tss_data.begin(), + current, + end=thread_info->tss_data.end(); + next!=end;) { - detail::tss_data_node* const current_node=thread_info->tss_data; - thread_info->tss_data=current_node->next; - if(current_node->func) + current=next; + ++next; + if(current->second.func && current->second.value) { - (*current_node->func)(current_node->value); + (*current->second.func)(current->second.value); } - delete current_node; + thread_info->tss_data.erase(current); } } thread_info->self.reset(); @@ -390,7 +380,7 @@ namespace boost { #if defined(PTW32_VERSION) || defined(__hpux) return pthread_num_processors_np(); -#elif defined(__linux__) +#elif defined(_GNU_SOURCE) return get_nprocs(); #elif defined(__APPLE__) || defined(__FreeBSD__) int count; @@ -552,14 +542,11 @@ namespace boost detail::thread_data_base* const current_thread_data(get_current_thread_data()); if(current_thread_data) { - detail::tss_data_node* current_node=current_thread_data->tss_data; - while(current_node) + std::map<void const*,tss_data_node>::iterator current_node= + current_thread_data->tss_data.find(key); + if(current_node!=current_thread_data->tss_data.end()) { - if(current_node->key==key) - { - return current_node; - } - current_node=current_node->next; + return ¤t_node->second; } } return NULL; @@ -573,106 +560,47 @@ namespace boost } return NULL; } + + void add_new_tss_node(void const* key, + boost::shared_ptr<tss_cleanup_function> func, + void* tss_data) + { + detail::thread_data_base* const current_thread_data(get_or_make_current_thread_data()); + current_thread_data->tss_data.insert(std::make_pair(key,tss_data_node(func,tss_data))); + } + + void erase_tss_node(void const* key) + { + detail::thread_data_base* const current_thread_data(get_or_make_current_thread_data()); + current_thread_data->tss_data.erase(key); + } - void set_tss_data(void const* key,boost::shared_ptr<tss_cleanup_function> func,void* tss_data,bool cleanup_existing) + void set_tss_data(void const* key, + boost::shared_ptr<tss_cleanup_function> func, + void* tss_data,bool cleanup_existing) { if(tss_data_node* const current_node=find_tss_data(key)) { - if(cleanup_existing && current_node->func) + if(cleanup_existing && current_node->func && current_node->value) { (*current_node->func)(current_node->value); } - current_node->func=func; - current_node->value=tss_data; + if(func || tss_data) + { + current_node->func=func; + current_node->value=tss_data; + } + else + { + erase_tss_node(key); + } } else { - detail::thread_data_base* const current_thread_data(get_or_make_current_thread_data()); - tss_data_node* const new_node=new tss_data_node(key,func,tss_data,current_thread_data->tss_data); - current_thread_data->tss_data=new_node; + add_new_tss_node(key,func,tss_data); } } } -// thread_group::thread_group() -// { -// } - -// thread_group::~thread_group() -// { -// // We shouldn't have to scoped_lock here, since referencing this object -// // from another thread while we're deleting it in the current thread is -// // going to lead to undefined behavior any way. -// for (std::list<thread*>::iterator it = m_threads.begin(); -// it != m_threads.end(); ++it) -// { -// delete (*it); -// } -// } - -// thread* thread_group::create_thread(const function0<void>& threadfunc) -// { -// // No scoped_lock required here since the only "shared data" that's -// // modified here occurs inside add_thread which does scoped_lock. -// std::auto_ptr<thread> thrd(new thread(threadfunc)); -// add_thread(thrd.get()); -// return thrd.release(); -// } - -// void thread_group::add_thread(thread* thrd) -// { -// mutex::scoped_lock scoped_lock(m_mutex); - -// // For now we'll simply ignore requests to add a thread object multiple -// // times. Should we consider this an error and either throw or return an -// // error value? -// std::list<thread*>::iterator it = std::find(m_threads.begin(), -// m_threads.end(), thrd); -// BOOST_ASSERT(it == m_threads.end()); -// if (it == m_threads.end()) -// m_threads.push_back(thrd); -// } - -// void thread_group::remove_thread(thread* thrd) -// { -// mutex::scoped_lock scoped_lock(m_mutex); - -// // For now we'll simply ignore requests to remove a thread object that's -// // not in the group. Should we consider this an error and either throw or -// // return an error value? -// std::list<thread*>::iterator it = std::find(m_threads.begin(), -// m_threads.end(), thrd); -// BOOST_ASSERT(it != m_threads.end()); -// if (it != m_threads.end()) -// m_threads.erase(it); -// } - -// void thread_group::join_all() -// { -// mutex::scoped_lock scoped_lock(m_mutex); -// for (std::list<thread*>::iterator it = m_threads.begin(); -// it != m_threads.end(); ++it) -// { -// (*it)->join(); -// } -// } - -// void thread_group::interrupt_all() -// { -// boost::lock_guard<mutex> guard(m_mutex); - -// for(std::list<thread*>::iterator it=m_threads.begin(),end=m_threads.end(); -// it!=end; -// ++it) -// { -// (*it)->interrupt(); -// } -// } - - -// size_t thread_group::size() const -// { -// return m_threads.size(); -// } } diff --git a/3rdParty/Boost/src/libs/thread/src/win32/exceptions.cpp b/3rdParty/Boost/src/libs/thread/src/win32/exceptions.cpp deleted file mode 100644 index 8881303..0000000 --- a/3rdParty/Boost/src/libs/thread/src/win32/exceptions.cpp +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (C) 2001-2003 -// William E. Kempf -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include <boost/thread/detail/config.hpp> - -#include <boost/thread/exceptions.hpp> -#include <cstring> -#include <string> - -namespace boost { - -thread_exception::thread_exception() - : m_sys_err(0) -{ -} - -thread_exception::thread_exception(int sys_err_code) - : m_sys_err(sys_err_code) -{ -} - -thread_exception::~thread_exception() throw() -{ -} - -int thread_exception::native_error() const -{ - return m_sys_err; -} - -lock_error::lock_error() -{ -} - -lock_error::lock_error(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -lock_error::~lock_error() throw() -{ -} - -const char* lock_error::what() const throw() -{ - return "boost::lock_error"; -} - -thread_resource_error::thread_resource_error() -{ -} - -thread_resource_error::thread_resource_error(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -thread_resource_error::~thread_resource_error() throw() -{ -} - -const char* thread_resource_error::what() const throw() -{ - return "boost::thread_resource_error"; -} - -unsupported_thread_option::unsupported_thread_option() -{ -} - -unsupported_thread_option::unsupported_thread_option(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -unsupported_thread_option::~unsupported_thread_option() throw() -{ -} - -const char* unsupported_thread_option::what() const throw() -{ - return "boost::unsupported_thread_option"; -} - -invalid_thread_argument::invalid_thread_argument() -{ -} - -invalid_thread_argument::invalid_thread_argument(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -invalid_thread_argument::~invalid_thread_argument() throw() -{ -} - -const char* invalid_thread_argument::what() const throw() -{ - return "boost::invalid_thread_argument"; -} - -thread_permission_error::thread_permission_error() -{ -} - -thread_permission_error::thread_permission_error(int sys_err_code) - : thread_exception(sys_err_code) -{ -} - -thread_permission_error::~thread_permission_error() throw() -{ -} - -const char* thread_permission_error::what() const throw() -{ - return "boost::thread_permission_error"; -} - -} // namespace boost diff --git a/3rdParty/Boost/src/libs/thread/src/win32/thread.cpp b/3rdParty/Boost/src/libs/thread/src/win32/thread.cpp index a72f053..46af860 100644 --- a/3rdParty/Boost/src/libs/thread/src/win32/thread.cpp +++ b/3rdParty/Boost/src/libs/thread/src/win32/thread.cpp @@ -561,7 +561,7 @@ namespace boost { if(tss_data_node* const current_node=find_tss_data(key)) { - if(cleanup_existing && current_node->func.get()) + if(cleanup_existing && current_node->func.get() && current_node->value) { (*current_node->func)(current_node->value); } diff --git a/3rdParty/Boost/src/tools/bcp/add_dependent_lib.cpp b/3rdParty/Boost/src/tools/bcp/add_dependent_lib.cpp new file mode 100644 index 0000000..bb1818a --- /dev/null +++ b/3rdParty/Boost/src/tools/bcp/add_dependent_lib.cpp @@ -0,0 +1,216 @@ +/* + * + * Copyright (c) 2009 Dr John Maddock + * Use, modification and distribution is 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) + * + * This file implements the following: + * void bcp_implementation::add_path(const fs::path& p) + * void bcp_implementation::add_directory(const fs::path& p) + * void bcp_implementation::add_file(const fs::path& p) + * void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view) + */ + +#include "bcp_imp.hpp" +#include "fileview.hpp" +#include <boost/regex.hpp> +#include <boost/filesystem/operations.hpp> +#include <boost/filesystem/exception.hpp> +#include <iostream> + +// +// This file contains the code required to work out whether the source/header file being scanned +// is actually dependent upon some library's source code or not. +// + +static std::map<std::string, boost::regex> scanner; + +static std::map<std::string, std::set<std::string> > free_function_names; +static std::map<std::string, std::set<std::string> > class_names; +static std::map<std::string, std::set<std::string> > variable_names; + +static void init_library_scanner(const fs::path& p, bool cvs_mode, const std::string& libname, bool recurse = false) +{ + /* + if(free_function_names.count(libname) == 0) + { + free_function_names[libname] = "[\\x0]"; + class_names[libname] = "[\\x0]"; + variable_names[libname] = "[\\x0]"; + } + */ + // + // Don't add files created by build system: + // + if((p.leaf() == "bin") || (p.leaf() == "bin-stage")) + return; + // + // Don't add version control directories: + // + if((p.leaf() == "CVS") || (p.leaf() == ".svn")) + return; + // + // don't add directories not under version control: + // + if(cvs_mode && !fs::exists(p / "CVS/Entries")) + return; + if(cvs_mode && !fs::exists(p / ".svn/entries")) + return; + // + // Enumerate files and directories: + // + fs::directory_iterator i(p); + fs::directory_iterator j; + while(i != j) + { + if(fs::is_directory(*i)) + init_library_scanner(*i, cvs_mode, libname, true); + if(bcp_implementation::is_source_file(*i)) + { + static boost::regex function_scanner( + "(?|" // Branch reset group + "(?:\\<\\w+\\>[^>;{},:]*)" // Return type + "(?:" + "(\\<\\w+\\>)" // Maybe class name + "\\s*" + "(?:<[^>;{]*>)?" // Maybe template specialisation + "::\\s*)?" + "(\\<(?!throw|if|while|for|catch)\\w+\\>)" // function name + "\\s*" + "\\(" + "[^\\(\\);{}]*" // argument list + "\\)" + "\\s*" + "\\{" // start of definition + "|" + "(\\<\\w+\\>)" // Maybe class name + "\\s*" + "(?:<[^>;{]*>)?" // Maybe template specialisation + "::\\s*" + "~?\\1" // function name, same as class name + "\\s*" + "\\(" + "[^\\(\\);{}]*" // argument list + "\\)" + "\\s*" + "\\{" // start of definition + ")" // end branch reset + ); + fileview view(*i); + boost::regex_iterator<const char*> a(view.begin(), view.end(), function_scanner); + boost::regex_iterator<const char*> b; + while(a != b) + { + if((*a)[1].matched) + { + std::string n = a->str(1); + class_names[libname].insert(n); + } + else + { + std::string n = a->str(2); + free_function_names[libname].insert(n); + } + ++a; + } + } + ++i; + } + + if(recurse == false) + { + // + // Build the regular expressions: + // + const char* e1 = + "^(?>[[:blank:]]*)(?!#)[^;{}\\r\\n]*" + "(?|" + "(?:class|struct)[^:;{}#]*" + "("; + // list of class names goes here... + const char* e2 = + ")\\s*(?:<[^;{>]*>\\s*)?(?::[^;{]*)?\\{" + "|" + "\\<(?!return)\\w+\\>[^:;{}#=<>!~%.\\w]*("; + // List of function names goes here... + const char* e3 = + ")\\s*\\([^;()]*\\)\\s*;)"; + + std::string class_name_list; + std::set<std::string>::const_iterator i = class_names[libname].begin(), j = class_names[libname].end(); + if(i != j) + { + class_name_list = *i; + ++i; + while(i != j) + { + class_name_list += "|" + *i; + ++i; + } + } + else + { + class_name_list = "[\\x0]"; + } + std::string function_name_list; + i = free_function_names[libname].begin(); + j = free_function_names[libname].end(); + if(i != j) + { + function_name_list = *i; + ++i; + while(i != j) + { + function_name_list += "|" + *i; + ++i; + } + } + else + { + function_name_list = "[\\x0]"; + } + + scanner[libname] = boost::regex(e1 + class_name_list + e2 + function_name_list + e3); + } +} + +void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view) +{ + // + // if the boost library libname has source associated with it + // then add the source to our list: + // + if(fs::exists(m_boost_path / "libs" / libname / "src")) + { + if(!m_dependencies.count(fs::path("libs") / libname / "src")) + { + if(scanner.count(libname) == 0) + init_library_scanner(m_boost_path / "libs" / libname / "src", m_cvs_mode, libname); + boost::cmatch what; + if(regex_search(view.begin(), view.end(), what, scanner[libname])) + { + std::cout << "INFO: tracking source dependencies of library " << libname + << " due to presence of \"" << what << "\" in file " << p << std::endl; + //std::cout << "Full text match was: " << what << std::endl; + m_dependencies[fs::path("libs") / libname / "src"] = p; // set up dependency tree + add_path(fs::path("libs") / libname / "src"); + + if(fs::exists(m_boost_path / "libs" / libname / "build")) + { + if(!m_dependencies.count(fs::path("libs") / libname / "build")) + { + m_dependencies[fs::path("libs") / libname / "build"] = p; // set up dependency tree + add_path(fs::path("libs") / libname / "build"); + //m_dependencies[fs::path("boost-build.jam")] = p; + //add_path(fs::path("boost-build.jam")); + m_dependencies[fs::path("Jamroot")] = p; + add_path(fs::path("Jamroot")); + //m_dependencies[fs::path("tools/build")] = p; + //add_path(fs::path("tools/build")); + } + } + } + } + } +} diff --git a/3rdParty/Boost/src/tools/bcp/add_path.cpp b/3rdParty/Boost/src/tools/bcp/add_path.cpp index 200500d..04530c6 100644 --- a/3rdParty/Boost/src/tools/bcp/add_path.cpp +++ b/3rdParty/Boost/src/tools/bcp/add_path.cpp @@ -9,7 +9,7 @@ * void bcp_implementation::add_path(const fs::path& p) * void bcp_implementation::add_directory(const fs::path& p) * void bcp_implementation::add_file(const fs::path& p) - * void bcp_implementation::add_dependent_lib(const std::string& libname) + * void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view) */ #include "bcp_imp.hpp" @@ -23,7 +23,7 @@ void bcp_implementation::add_path(const fs::path& p) { fs::path normalized_path = p; - normalized_path.normalize(); + normalized_path.normalize(); if(fs::exists(m_boost_path / normalized_path)) { if(fs::is_directory(m_boost_path / normalized_path)) @@ -34,6 +34,7 @@ void bcp_implementation::add_path(const fs::path& p) else { std::cerr << "CAUTION: dependent file " << p.string() << " does not exist." << std::endl; + std::cerr << " Found while scanning file " << m_dependencies[p].string() << std::endl; } } @@ -71,8 +72,10 @@ void bcp_implementation::add_directory(const fs::path& p) if(m_boost_path.string().size()) s.erase(0, m_boost_path.string().size() + 1); if(!m_dependencies.count(fs::path(s))) + { m_dependencies[fs::path(s)] = p; // set up dependency tree - add_path(fs::path(s)); + add_path(fs::path(s)); + } ++i; } } @@ -100,6 +103,37 @@ void bcp_implementation::add_file(const fs::path& p) { add_file_dependencies(p, false); } + if(is_jam_file(p) && m_namespace_name.size() && ((std::distance(p.begin(), p.end()) < 3) || (*p.begin() != "tools") || (*++p.begin() != "build"))) + { + // + // We're doing a rename of namespaces and library names + // so scan for names of libraries: + // + static const boost::regex e( + "\\<lib\\s+(boost\\w+)\\s+[:;]" + ); + + fileview view(m_boost_path / p); + boost::regex_token_iterator<const char*> i(view.begin(), view.end(), e, 1); + boost::regex_token_iterator<const char*> j; + while(i != j) + { + m_lib_names.insert(*i); + ++i; + } + static const std::pair<fs::path, std::string> specials_library_names[] = { + std::pair<fs::path, std::string>("libs/python/build/Jamfile.v2", "boost_python"), + std::pair<fs::path, std::string>("libs/python/build/Jamfile.v2", "boost_python3"), + }; + + for(unsigned int n = 0; n < (sizeof(specials_library_names)/sizeof(specials_library_names[0])); ++n) + { + if(0 == compare_paths(specials_library_names[n].first, p)) + { + m_lib_names.insert(specials_library_names[n].second); + } + } + } // // if this is a html file, scan for dependencies: // @@ -126,6 +160,14 @@ void bcp_implementation::add_file(const fs::path& p) s.erase(s.size() - 1); } // + // Remove any target suffix: + // + std::string::size_type n = s.find('#'); + if(n != std::string::npos) + { + s.erase(n); + } + // // if the name starts with ./ remove it // or we'll get an error: if(s.compare(0, 2, "./") == 0) @@ -136,8 +178,10 @@ void bcp_implementation::add_file(const fs::path& p) // rather than a URL: fs::path dep(p.branch_path() / s); if(!m_dependencies.count(dep)) + { m_dependencies[dep] = p; // set up dependency tree - add_path(dep); + add_path(dep); + } } ++i; } @@ -178,6 +222,18 @@ static const std::pair<fs::path, fs::path> std::pair<fs::path, fs::path>("boost/mpl/map/aux_/include_preprocessed.hpp", "boost/mpl/map/aux_/preprocessed"), std::pair<fs::path, fs::path>("boost/mpl/list/aux_/include_preprocessed.hpp", "boost/mpl/list/aux_/preprocessed"), std::pair<fs::path, fs::path>("libs/graph/src/python/visitor.hpp", "libs/graph/src/python"), + std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/test/src"), + std::pair<fs::path, fs::path>("boost/test/detail/config.hpp", "libs/test/build"), + std::pair<fs::path, fs::path>("boost/typeof.hpp", "boost/typeof/incr_registration_group.hpp"), + std::pair<fs::path, fs::path>("boost/function_types/detail/pp_loop.hpp", "boost/function_types/detail/pp_cc_loop"), + std::pair<fs::path, fs::path>("boost/function_types/components.hpp", "boost/function_types/detail/components_impl"), + std::pair<fs::path, fs::path>("boost/function_types/detail/pp_loop.hpp", "boost/function_types/detail"), + std::pair<fs::path, fs::path>("boost/math/tools/rational.hpp", "boost/math/tools/detail"), + std::pair<fs::path, fs::path>("boost/proto/repeat.hpp", "boost/proto/detail/local.hpp"), + std::pair<fs::path, fs::path>("boost/signals/signal_template.hpp", "boost/function"), + std::pair<fs::path, fs::path>("boost/preprocessor/slot/counter.hpp", "boost/preprocessor/slot/detail/counter.hpp"), + std::pair<fs::path, fs::path>("boost/graph/distributed/detail/tag_allocator.hpp", "libs/graph_parallel"), + std::pair<fs::path, fs::path>("boost/graph/distributed/mpi_process_group.hpp", "libs/graph_parallel"), }; for(unsigned int n = 0; n < (sizeof(specials)/sizeof(specials[0])); ++n) @@ -185,33 +241,15 @@ static const std::pair<fs::path, fs::path> if(0 == compare_paths(specials[n].first, p)) { if(!m_dependencies.count(specials[n].second)) + { m_dependencies[specials[n].second] = p; // set up dependency tree - add_path(specials[n].second); + add_path(specials[n].second); + } } } } -void bcp_implementation::add_dependent_lib(const std::string& libname, const fs::path& p) -{ - // - // if the boost library libname has source associated with it - // then add the source to our list: - // - if(fs::exists(m_boost_path / "libs" / libname / "src")) - { - if(!m_dependencies.count(fs::path("libs") / libname / "src")) - m_dependencies[fs::path("libs") / libname / "src"] = p; // set up dependency tree - add_path(fs::path("libs") / libname / "src"); - if(fs::exists(m_boost_path / "libs" / libname / "build")) - { - if(!m_dependencies.count(fs::path("libs") / libname / "build")) - m_dependencies[fs::path("libs") / libname / "build"] = p; // set up dependency tree - add_path(fs::path("libs") / libname / "build"); - } - } -} - void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile) { static const boost::regex e( @@ -263,14 +301,18 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile) if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.branch_path().string() != "boost")) { if(!m_dependencies.count(p.branch_path() / include_file)) + { m_dependencies[p.branch_path() / include_file] = p; - add_path(p.branch_path() / include_file); + add_path(p.branch_path() / include_file); + } } else if(fs::exists(m_boost_path / include_file)) { if(!m_dependencies.count(include_file)) + { m_dependencies[include_file] = p; - add_path(include_file); + add_path(include_file); + } } ++i; } @@ -278,7 +320,7 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile) // Now we need to scan for Boost.Preprocessor includes that // are included via preprocessor iteration: // - boost::regex ppfiles("^[[:blank:]]*#[[:blank:]]*define[[:blank:]]+(?:BOOST_PP_FILENAME|BOOST_PP_ITERATION_PARAMS|BOOST_PP_INDIRECT_SELF)[^\\n]+?[\"<]([^\">]+)[\">]"); + static const boost::regex ppfiles("^[[:blank:]]*#[[:blank:]]*define[[:blank:]]+(?:BOOST_PP_FILENAME|BOOST_PP_ITERATION_PARAMS|BOOST_PP_INDIRECT_SELF)[^\\n]+?[\"<]([^\">]+)[\">]"); i = boost::regex_token_iterator<const char*>(view.begin(), view.end(), ppfiles, 1); while(i != j) { @@ -302,14 +344,18 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile) if(fs::exists(test_file) && !fs::is_directory(test_file) && (p.branch_path().string() != "boost")) { if(!m_dependencies.count(p.branch_path() / include_file)) + { m_dependencies[p.branch_path() / include_file] = p; - add_path(p.branch_path() / include_file); + add_path(p.branch_path() / include_file); + } } else if(fs::exists(m_boost_path / include_file)) { if(!m_dependencies.count(include_file)) + { m_dependencies[include_file] = p; - add_path(include_file); + add_path(include_file); + } } else { @@ -325,6 +371,8 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile) // we know about and are correctly handled as special cases: // static const std::string known_macros[] = { + "AUX778076_INCLUDE_STRING", + "BOOST_PP_STRINGIZE(boost/mpl/aux_/preprocessed/AUX778076_PREPROCESSED_HEADER)", "BOOST_USER_CONFIG", "BOOST_COMPILER_CONFIG", "BOOST_STDLIB_CONFIG", @@ -367,16 +415,49 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile) "BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_C_HEADER)", "BOOST_REGEX_USER_CONFIG", "BGL_PYTHON_EVENTS_HEADER", - }; + "B1", + "B2", + "BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()", + "BOOST_SLIST_HEADER", + "BOOST_HASH_SET_HEADER", + "BOOST_HASH_MAP_HEADER", + "BOOST_INTRUSIVE_INVARIANT_ASSERT_INCLUDE", + "BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT_INCLUDE", + "BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE", + "BOOST_FT_loop", + "BOOST_FT_AL_PREPROCESSED", + "BOOST_FT_AL_INCLUDE_FILE", + "__FILE__", + "BOOST_FT_cc_file", + "BOOST_FT_variate_file", + "BOOST_USER_CONFIG", + "BOOST_HEADER()", + "BOOST_TR1_STD_HEADER(utility)", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(tuple))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(random))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(array))", + "BOOST_TR1_HEADER(cmath)", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(complex))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(functional))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(memory))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(regex))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(type_traits))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(unordered_map))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(unordered_set))", + "BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(utility))", + "BOOST_PROTO_LOCAL_ITERATE()", + "BOOST_SIGNAL_FUNCTION_N_HEADER", + "BOOST_PP_UPDATE_COUNTER()", + }; - boost::regex indirect_includes("^[[:blank:]]*#[[:blank:]]*include[[:blank:]]+([^\"<][^\n]*?)[[:blank:]]*$"); + static const boost::regex indirect_includes("^[[:blank:]]*#[[:blank:]]*include[[:blank:]]+([^\"<][^\n]*?)[[:blank:]]*$"); i = boost::regex_token_iterator<const char*>(view.begin(), view.end(), indirect_includes, 1); while(i != j) { const std::string* known_macros_end = known_macros + sizeof(known_macros)/sizeof(known_macros[0]); if(known_macros_end == std::find(known_macros, known_macros_end, i->str())) { - std::cerr << "CAUTION: don't know how to trace depenencies through macro: " << *i << " in file: " << p.string() << std::endl; + std::cerr << "CAUTION: don't know how to trace depenencies through macro: \"" << *i << "\" in file: " << p.string() << std::endl; } ++i; } @@ -389,27 +470,49 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile) boost::cmatch what; if(boost::regex_search(view.begin(), view.end(), what, m)) { - add_dependent_lib("test", p); + add_dependent_lib("test", p, view); } - // - // grab the name of the library to which the header belongs, - // and if that library has source then add the source to our - // list: - // - // this regex catches boost/libname.hpp or boost/libname/whatever: - // - static const boost::regex lib1("boost/([^\\./]+)(?!detail).*"); - boost::smatch swhat; - if(boost::regex_match(p.string(), swhat, lib1)) + if(!scanfile) { - add_dependent_lib(swhat.str(1), p); + // + // grab the name of the library to which the header belongs, + // and if that library has source then add the source to our + // list: + // + // this regex catches boost/libname.hpp or boost/libname/whatever: + // + static const boost::regex lib1("boost/([^\\./]+)(?!detail).*"); + boost::smatch swhat; + if(boost::regex_match(p.string(), swhat, lib1)) + { + add_dependent_lib(swhat.str(1), p, view); + } + // + // and this one catches boost/x/y/whatever (for example numeric/ublas): + // + static const boost::regex lib2("boost/([^/]+/[^/]+)/(?!detail).*"); + if(boost::regex_match(p.string(), swhat, lib2)) + { + add_dependent_lib(swhat.str(1), p, view); + } } - // - // and this one catches boost/x/y/whatever (for example numeric/ublas): - // - static const boost::regex lib2("boost/([^/]+/[^/]+)/(?!detail).*"); - if(boost::regex_match(p.string(), swhat, lib2)) + if(m_list_namespaces) { - add_dependent_lib(swhat.str(1), p); + // + // scan for top level namespaces and add to our list: + // + static const boost::regex namespace_scanner( + "^(?<!\\\\\\n)[[:blank:]]*+namespace\\s++(\\w++)\\s++(\\{[^{}]*(?:(?2)[^{}]*)*\\})" + ); + i = boost::regex_token_iterator<const char*>(view.begin(), view.end(), namespace_scanner, 1); + while(i != j) + { + if(m_top_namespaces.count(*i) == 0) + { + //std::cout << *i << " (Found in " << p << ")" << std::endl; + m_top_namespaces[*i] = p; + } + ++i; + } } } diff --git a/3rdParty/Boost/src/tools/bcp/bcp.hpp b/3rdParty/Boost/src/tools/bcp/bcp.hpp index 41bb070..ea2b4d0 100644 --- a/3rdParty/Boost/src/tools/bcp/bcp.hpp +++ b/3rdParty/Boost/src/tools/bcp/bcp.hpp @@ -29,6 +29,9 @@ public: virtual void set_boost_path(const char* p) = 0; virtual void set_destination(const char* p) = 0; virtual void add_module(const char* p) = 0; + virtual void set_namespace(const char* name) = 0; + virtual void set_namespace_alias(bool) = 0; + virtual void set_namespace_list(bool) = 0; virtual int run() = 0; diff --git a/3rdParty/Boost/src/tools/bcp/bcp_imp.cpp b/3rdParty/Boost/src/tools/bcp/bcp_imp.cpp index f00f022..c5d7fb4 100644 --- a/3rdParty/Boost/src/tools/bcp/bcp_imp.cpp +++ b/3rdParty/Boost/src/tools/bcp/bcp_imp.cpp @@ -18,7 +18,9 @@ #include <string> bcp_implementation::bcp_implementation() - : m_list_mode(false), m_list_summary_mode(false), m_license_mode(false), m_cvs_mode(false), m_svn_mode(false), m_unix_lines(false), m_scan_mode(false), m_bsl_convert_mode(false), m_bsl_summary_mode(false) + : m_list_mode(false), m_list_summary_mode(false), m_license_mode(false), m_cvs_mode(false), + m_svn_mode(false), m_unix_lines(false), m_scan_mode(false), m_bsl_convert_mode(false), + m_bsl_summary_mode(false), m_namespace_alias(false), m_list_namespaces(false) { } @@ -100,6 +102,22 @@ void bcp_implementation::add_module(const char* p) m_module_list.push_back(p); } +void bcp_implementation::set_namespace(const char* name) +{ + m_namespace_name = name; +} + +void bcp_implementation::set_namespace_alias(bool b) +{ + m_namespace_alias = b; +} + +void bcp_implementation::set_namespace_list(bool b) +{ + m_list_namespaces = b; + m_list_mode = b; +} + fs::path get_short_path(const fs::path& p) { // truncate path no more than "x/y": @@ -152,7 +170,7 @@ int bcp_implementation::run() fs::ifstream in(blanket_permission); std::string line; while (std::getline(in, line)) { - boost::regex e("([^(]+)\\("); + static const boost::regex e("([^(]+)\\("); boost::smatch result; if (boost::regex_search(line, result, e)) m_bsl_authors.insert(format_authors_name(result[1])); @@ -221,6 +239,33 @@ int bcp_implementation::run() // // now perform output: // + if(m_list_namespaces) + { + // List the namespaces, in two lists, headers and source files + // first, then everything else afterwards: + // + boost::regex important_file("boost/.*|libs/[^/]*/(?:[^/]*/)?/src/.*"); + std::map<std::string, fs::path>::const_iterator i, j; + i = m_top_namespaces.begin(); + j = m_top_namespaces.end(); + std::cout << "\n\nThe top level namespaces found for header and source files were:\n"; + while(i != j) + { + if(regex_match(i->second.string(), important_file)) + std::cout << i->first << " (from " << i->second << ")" << std::endl; + ++i; + } + + i = m_top_namespaces.begin(); + std::cout << "\n\nThe top level namespaces found for all other source files were:\n"; + while(i != j) + { + if(!regex_match(i->second.string(), important_file)) + std::cout << i->first << " (from " << i->second << ")" << std::endl; + ++i; + } + return 0; + } std::set<fs::path, path_less>::iterator m, n; std::set<fs::path, path_less> short_paths; m = m_copy_paths.begin(); diff --git a/3rdParty/Boost/src/tools/bcp/bcp_imp.hpp b/3rdParty/Boost/src/tools/bcp/bcp_imp.hpp index f65e0b2..9f45915 100644 --- a/3rdParty/Boost/src/tools/bcp/bcp_imp.hpp +++ b/3rdParty/Boost/src/tools/bcp/bcp_imp.hpp @@ -44,6 +44,9 @@ class bcp_implementation public: bcp_implementation(); ~bcp_implementation(); + static bool is_source_file(const fs::path& p); + static bool is_html_file(const fs::path& p); + static bool is_jam_file(const fs::path& p); private: // // the following are the overridden virtuals from the base class: @@ -60,10 +63,14 @@ private: void set_boost_path(const char* p); void set_destination(const char* p); void add_module(const char* p); + void set_namespace(const char* name); + void set_namespace_alias(bool); + void set_namespace_list(bool); virtual int run(); -private: + // internal helper functions: + bool is_binary_file(const fs::path& p); void scan_cvs_path(const fs::path& p); void scan_svn_path(const fs::path& p); void add_path(const fs::path& p); @@ -71,10 +78,7 @@ private: void add_file(const fs::path& p); void copy_path(const fs::path& p); void add_file_dependencies(const fs::path& p, bool scanfile); - bool is_source_file(const fs::path& p); - bool is_html_file(const fs::path& p); - bool is_binary_file(const fs::path& p); - void add_dependent_lib(const std::string& libname, const fs::path& p); + void add_dependent_lib(const std::string& libname, const fs::path& p, const fileview& view); void create_path(const fs::path& p); // license code: void scan_license(const fs::path& p, const fileview& v); @@ -90,18 +94,25 @@ private: bool m_scan_mode; // scan non-boost files. bool m_bsl_convert_mode; // try to convert to the BSL bool m_bsl_summary_mode; // summarise BSL issues only + bool m_namespace_alias; // make "boost" a namespace alias when doing a namespace rename. + bool m_list_namespaces; // list all the top level namespaces found. fs::path m_boost_path; // the path to the boost root fs::path m_dest_path; // the path to copy to - std::map<fs::path, bool, path_less> m_cvs_paths; // valid files under cvs control - std::set<fs::path, path_less> m_copy_paths; // list of files to copy - std::map<int, license_data> m_license_data; // licenses in use - std::set<fs::path, path_less> m_unknown_licenses; // files with no known license - std::set<fs::path, path_less> m_unknown_authors; // files with no known copyright/author - std::set<fs::path, path_less> m_can_migrate_to_bsl; // files that can migrate to the BSL - std::set<fs::path, path_less> m_cannot_migrate_to_bsl; // files that cannot migrate to the BSL - std::set<std::string> m_bsl_authors; // authors giving blanket permission to use the BSL - std::set<std::string> m_authors_for_bsl_migration; // authors we need for BSL migration - std::map<fs::path, std::pair<std::string, std::string>, path_less> m_converted_to_bsl; - std::map<std::string, std::set<fs::path, path_less> > m_author_data; // all the authors - std::map<fs::path, fs::path, path_less> m_dependencies; // dependency information + std::map<fs::path, bool, path_less> m_cvs_paths; // valid files under cvs control + std::set<fs::path, path_less> m_copy_paths; // list of files to copy + std::map<int, license_data> m_license_data; // licenses in use + std::set<fs::path, path_less> m_unknown_licenses; // files with no known license + std::set<fs::path, path_less> m_unknown_authors; // files with no known copyright/author + std::set<fs::path, path_less> m_can_migrate_to_bsl; // files that can migrate to the BSL + std::set<fs::path, path_less> m_cannot_migrate_to_bsl; // files that cannot migrate to the BSL + std::set<std::string> m_bsl_authors; // authors giving blanket permission to use the BSL + std::set<std::string> m_authors_for_bsl_migration; // authors we need for BSL migration + std::map<fs::path, std::pair<std::string, std::string>, path_less> + m_converted_to_bsl; + std::map<std::string, std::set<fs::path, path_less> > m_author_data; // all the authors + std::map<fs::path, fs::path, path_less> m_dependencies; // dependency information + std::string m_namespace_name; // namespace rename. + std::set<std::string> m_lib_names; // List of library binary names + std::map<std::string, fs::path> m_top_namespaces; // List of top level namespace names }; + diff --git a/3rdParty/Boost/src/tools/bcp/copy_path.cpp b/3rdParty/Boost/src/tools/bcp/copy_path.cpp index c976865..af99b62 100644 --- a/3rdParty/Boost/src/tools/bcp/copy_path.cpp +++ b/3rdParty/Boost/src/tools/bcp/copy_path.cpp @@ -11,12 +11,36 @@ */ #include "bcp_imp.hpp" +#include "fileview.hpp" #include <boost/filesystem/operations.hpp> +#include <boost/regex.hpp> #include <fstream> #include <iterator> #include <algorithm> #include <iostream> +struct get_new_library_name +{ + get_new_library_name(const std::string& n) : m_new_name(n) {} + template <class I> + std::string operator()(const boost::match_results<I>& what) + { + std::string s = what[0]; + std::string::size_type n = s.find("boost"); + if(n == std::string::npos) + { + s.insert(0, m_new_name); + } + else + { + s.replace(n, 5, m_new_name); + } + return s; + } +private: + std::string m_new_name; +}; + void bcp_implementation::copy_path(const fs::path& p) { assert(!fs::is_directory(m_boost_path / p)); @@ -34,7 +58,123 @@ void bcp_implementation::copy_path(const fs::path& p) // // do text based copy if requested: // - if(m_unix_lines && !is_binary_file(p)) + if(m_namespace_name.size() && m_lib_names.size() && is_jam_file(p)) + { + static std::vector<char> v1, v2; + v1.clear(); + v2.clear(); + std::ifstream is((m_boost_path / p).native_file_string().c_str()); + std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1)); + + static boost::regex libname_matcher; + if(libname_matcher.empty()) + { + std::string re = "\\<"; + re += *m_lib_names.begin(); + for(std::set<std::string>::const_iterator i = ++m_lib_names.begin(); i != m_lib_names.end(); ++i) + { + re += "|" + *i; + } + re += "\\>"; + libname_matcher.assign(re); + } + + regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), libname_matcher, get_new_library_name(m_namespace_name)); + std::swap(v1, v2); + v2.clear(); + + std::ofstream os; + if(m_unix_lines) + os.open((m_dest_path / p).native_file_string().c_str(), std::ios_base::binary | std::ios_base::out); + else + os.open((m_dest_path / p).native_file_string().c_str(), std::ios_base::out); + os.write(&*v1.begin(), v1.size()); + os.close(); + } + else if(m_namespace_name.size() && is_source_file(p)) + { + // + // v1 hold the current content, v2 is temp buffer. + // Each time we do a search and replace the new content + // ends up in v2: we then swap v1 and v2, and clear v2. + // + static std::vector<char> v1, v2; + v1.clear(); + v2.clear(); + std::ifstream is((m_boost_path / p).native_file_string().c_str()); + std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1)); + + static const boost::regex namespace_matcher( + "(?|" + "(namespace\\s+)boost(_\\w+)?" + "|" + "(namespace\\s+)(adstl|phoenix|rapidxml)\\>" + "|" + "()boost((?:_\\w+)?\\s*(?:::|,|\\)))" + "|" + "()((?:adstl|phoenix|rapidxml)\\s*(?:::|,|\\)))" + "|" + "(namespace\\s+\\w+\\s*=\\s*(?:::\\s*)?)boost(_\\w+)?" + "|" + "(namespace\\s+\\w+\\s*=\\s*(?:::\\s*)?)(adstl|phoenix|rapidxml)\\>" + "|" + "(^\\s*#\\s*define[^\\n]+)boost((?:_\\w+)?\\s*)$" + "|" + "(^\\s*#\\s*define[^\\n]+)((?:adstl|phoenix|rapidxml)\\s*)$" + ")" + ); + + regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_matcher, "$1" + m_namespace_name + "$2"); + std::swap(v1, v2); + v2.clear(); + + if(m_namespace_alias) + { + static const boost::regex namespace_alias( + /* + "namespace\\s+" + m_namespace_name + + "\\s*" + "(" + "\\{" + "(?:" + "(?>[^\\{\\}/]+)" + "(?>" + "(?:" + "(?1)" + "|//[^\\n]+$" + "|/[^/]" + "|(?:^\\s*#[^\\n]*" + "(?:(?<=\\\\)\\n[^\\n]*)*)" + ")" + "[^\\{\\}]+" + ")*" + ")*" + "\\}" + ")" + */ + /* + "(namespace\\s+" + m_namespace_name + + "\\s*\\{.*" + "\\})([^\\{\\};]*)\\z" + */ + "namespace\\s+" + m_namespace_name + + "\\s*\\{" + ); + regex_replace(std::back_inserter(v2), v1.begin(), v1.end(), namespace_alias, + "namespace " + m_namespace_name + "{} namespace boost = " + m_namespace_name + "; namespace " + m_namespace_name + "{"); + std::swap(v1, v2); + v2.clear(); + } + + std::ofstream os; + if(m_unix_lines) + os.open((m_dest_path / p).native_file_string().c_str(), std::ios_base::binary | std::ios_base::out); + else + os.open((m_dest_path / p).native_file_string().c_str(), std::ios_base::out); + os.write(&*v1.begin(), v1.size()); + os.close(); + } + else if(m_unix_lines && !is_binary_file(p)) { std::ifstream is((m_boost_path / p).native_file_string().c_str()); std::istreambuf_iterator<char> isi(is); diff --git a/3rdParty/Boost/src/tools/bcp/file_types.cpp b/3rdParty/Boost/src/tools/bcp/file_types.cpp index bc9ca31..abc0149 100644 --- a/3rdParty/Boost/src/tools/bcp/file_types.cpp +++ b/3rdParty/Boost/src/tools/bcp/file_types.cpp @@ -19,11 +19,11 @@ bool bcp_implementation::is_source_file(const fs::path& p) static const boost::regex e( ".*\\." "(?:" - "c|cxx|h|hxx|inc|.?pp|yy?" + "c|cxx|h|hxx|inc|inl|.?pp|yy?" ")", boost::regex::perl | boost::regex::icase ); - return boost::regex_match(p.string(), e); + return boost::regex_match(p.filename(), e); } bool bcp_implementation::is_html_file(const fs::path& p) @@ -34,7 +34,7 @@ bool bcp_implementation::is_html_file(const fs::path& p) "html?|css" ")" ); - return boost::regex_match(p.string(), e); + return boost::regex_match(p.filename(), e); } bool bcp_implementation::is_binary_file(const fs::path& p) @@ -55,3 +55,18 @@ bool bcp_implementation::is_binary_file(const fs::path& p) return !boost::regex_match(p.leaf(), e); } + +bool bcp_implementation::is_jam_file(const fs::path& p) +{ + static const boost::regex e( + ".*\\." + "(?:" + "jam|v2" + ")" + "|" + "(Jamfile|Jamroot)\\.?", + boost::regex::perl | boost::regex::icase + ); + return boost::regex_match(p.filename(), e); +} + diff --git a/3rdParty/Boost/src/tools/bcp/licence_info.cpp b/3rdParty/Boost/src/tools/bcp/licence_info.cpp index 2081f10..ab34b83 100644 --- a/3rdParty/Boost/src/tools/bcp/licence_info.cpp +++ b/3rdParty/Boost/src/tools/bcp/licence_info.cpp @@ -5,6 +5,7 @@ * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) * + * boostinspect:noascii */ #include "licence_info.hpp" diff --git a/3rdParty/Boost/src/tools/bcp/main.cpp b/3rdParty/Boost/src/tools/bcp/main.cpp index 16a1722..a152138 100644 --- a/3rdParty/Boost/src/tools/bcp/main.cpp +++ b/3rdParty/Boost/src/tools/bcp/main.cpp @@ -34,15 +34,17 @@ void show_usage() " bcp [options] module-list output-path\n" "\n" "Options:\n" - " --boost=path sets the location of the boost tree to path\n" - " --scan treat the module list as a list of (possibly non-boost)\n" - " files to scan for boost dependencies\n" - " --cvs only copy files under cvs version control\n" - " --unix-lines make sure that all copied files use Unix style line endings\n" + " --boost=path sets the location of the boost tree to path\n" + " --scan treat the module list as a list of (possibly non-boost)\n" + " files to scan for boost dependencies\n" + " --svn only copy files under cvs version control\n" + " --unix-lines make sure that all copied files use Unix style line endings\n" + " --namespace=name rename the boost namespace to name (also changes library names).\n" + " --namespace-alias Makes namespace boost an alias of the namespace set with --namespace.\n" "\n" - "module-list: a list of boost files or library names to copy\n" - "html-file: the name of a html file to which the report will be written\n" - "output-path: the path to which files will be copied\n"; + "module-list: a list of boost files or library names to copy\n" + "html-file: the name of a html file to which the report will be written\n" + "output-path: the path to which files will be copied\n"; } bool filesystem_name_check( const std::string & name ) @@ -64,6 +66,7 @@ int cpp_main(int argc, char* argv[]) // if(argc < 2) { + std::cout << "Error: insufficient arguments, don't know what to do." << std::endl; show_usage(); return 0; } @@ -134,8 +137,22 @@ int cpp_main(int argc, char* argv[]) { papp->set_boost_path(argv[i] + 8); } + else if(0 == std::strncmp("--namespace=", argv[i], 12)) + { + papp->set_namespace(argv[i] + 12); + } + else if(0 == std::strncmp("--namespace-alias", argv[i], 17)) + { + papp->set_namespace_alias(true); + } + else if(0 == std::strncmp("--list-namespaces", argv[i], 17)) + { + list_mode = true; + papp->set_namespace_list(true); + } else if(argv[i][0] == '-') { + std::cout << "Error: Unknown argument " << argv[i] << std::endl; show_usage(); return 1; } diff --git a/3rdParty/Boost/src/tools/bcp/output_licence_info.cpp b/3rdParty/Boost/src/tools/bcp/output_licence_info.cpp index 2196894..26eae7b 100644 --- a/3rdParty/Boost/src/tools/bcp/output_licence_info.cpp +++ b/3rdParty/Boost/src/tools/bcp/output_licence_info.cpp @@ -139,7 +139,7 @@ void bcp_implementation::output_license_info() // version): // fileview version_file(m_boost_path / "boost/version.hpp"); - boost::regex version_regex( + static const boost::regex version_regex( "^[[:blank:]]*#[[:blank:]]*define[[:blank:]]+BOOST_VERSION[[:blank:]]+(\\d+)"); boost::cmatch what; if(boost::regex_search(version_file.begin(), version_file.end(), what, version_regex)) |