diff --git a/include/boost/detail/allocator_utilities.hpp b/include/boost/detail/allocator_utilities.hpp index 5a9a79e..91b0fa7 100644 --- a/include/boost/detail/allocator_utilities.hpp +++ b/include/boost/detail/allocator_utilities.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2007 Joaquín M López Muñoz. +/* Copyright 2003-2008 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 6936dba..6394d92 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -42,10 +42,10 @@ # error Unknown machine endianness detected. # endif # define BOOST_BYTE_ORDER __BYTE_ORDER -#elif defined(_BIG_ENDIAN) +#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 -#elif defined(_LITTLE_ENDIAN) +#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 #elif defined(__sparc) || defined(__sparc__) \ diff --git a/include/boost/detail/indirect_traits.hpp b/include/boost/detail/indirect_traits.hpp old mode 100755 new mode 100644 diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 76a24c3..b6c8d75 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -47,6 +47,11 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare))) +# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)BOOST_INTERLOCKED_EXCHANGE((long*)(dest),(long)(exchange))) + #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) extern "C" long __cdecl _InterlockedIncrement( long volatile * ); @@ -87,7 +92,7 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* ); # define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd -#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) +#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ ) namespace boost { diff --git a/include/boost/detail/is_function_ref_tester.hpp b/include/boost/detail/is_function_ref_tester.hpp old mode 100755 new mode 100644 diff --git a/include/boost/detail/is_incrementable.hpp b/include/boost/detail/is_incrementable.hpp old mode 100755 new mode 100644 index cb7d7a7..1c8fd57 --- a/include/boost/detail/is_incrementable.hpp +++ b/include/boost/detail/is_incrementable.hpp @@ -63,7 +63,12 @@ namespace is_incrementable_ tag operator,(tag,int); # define BOOST_comma(a,b) (a,b) # endif - + +# if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4913) // Warning about operator, +# endif + // two check overloads help us identify which operator++ was picked char (& check(tag) )[2]; @@ -92,6 +97,11 @@ namespace is_incrementable_ , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1 ); }; + +# if defined(BOOST_MSVC) +# pragma warning(pop) +# endif + } # undef BOOST_comma diff --git a/include/boost/detail/is_xxx.hpp b/include/boost/detail/is_xxx.hpp old mode 100755 new mode 100644 diff --git a/include/boost/detail/lightweight_thread.hpp b/include/boost/detail/lightweight_thread.hpp new file mode 100644 index 0000000..6fe70a6 --- /dev/null +++ b/include/boost/detail/lightweight_thread.hpp @@ -0,0 +1,135 @@ +#ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED +#define BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// boost/detail/lightweight_thread.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2008 Peter Dimov +// +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include + +// pthread_create, pthread_join + +#if defined( BOOST_HAS_PTHREADS ) + +#include + +#else + +#include +#include + +typedef HANDLE pthread_t; + +int pthread_create( pthread_t * thread, void const *, unsigned (__stdcall * start_routine) (void*), void* arg ) +{ + HANDLE h = (HANDLE)_beginthreadex( 0, 0, start_routine, arg, 0, 0 ); + + if( h != 0 ) + { + *thread = h; + return 0; + } + else + { + return EAGAIN; + } +} + +int pthread_join( pthread_t thread, void ** /*value_ptr*/ ) +{ + ::WaitForSingleObject( thread, INFINITE ); + ::CloseHandle( thread ); + return 0; +} + +#endif + +// template int lw_thread_create( pthread_t & pt, F f ); + +namespace boost +{ + +namespace detail +{ + +class lw_abstract_thread +{ +public: + + virtual ~lw_abstract_thread() {} + virtual void run() = 0; +}; + +#if defined( BOOST_HAS_PTHREADS ) + +extern "C" void * lw_thread_routine( void * pv ) +{ + std::auto_ptr pt( static_cast( pv ) ); + + pt->run(); + + return 0; +} + +#else + +unsigned __stdcall lw_thread_routine( void * pv ) +{ + std::auto_ptr pt( static_cast( pv ) ); + + pt->run(); + + return 0; +} + +#endif + +template class lw_thread_impl: public lw_abstract_thread +{ +public: + + explicit lw_thread_impl( F f ): f_( f ) + { + } + + void run() + { + f_(); + } + +private: + + F f_; +}; + +template int lw_thread_create( pthread_t & pt, F f ) +{ + std::auto_ptr p( new lw_thread_impl( f ) ); + + int r = pthread_create( &pt, 0, lw_thread_routine, p.get() ); + + if( r == 0 ) + { + p.release(); + } + + return r; +} + +} // namespace detail +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index 3826ee6..13c8346 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -1,4 +1,4 @@ -// Copyright © 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) // Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). // Distributed under the Boost Software License, Version 1.0. (See accompany- // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -79,25 +79,16 @@ // specialized on those types for this to work. #include -// for mbstate_t -#include -// for std::size_t -#include +#include // for mbstate_t +#include // for std::size_t #include #include -namespace std { - #if defined(__LIBCOMO__) - using ::mbstate_t; - #elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__) - using ::mbstate_t; - #elif defined(__SGI_STL_PORT) - #elif defined(BOOST_NO_STDC_NAMESPACE) - using ::mbstate_t; - using ::codecvt; - #endif -} // namespace std +#if defined(BOOST_NO_STDC_NAMESPACE) + using ::codecvt; + using ::mbstate_t; +#endif #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) #define BOOST_CODECVT_DO_LENGTH_CONST const diff --git a/include/boost/indirect_reference.hpp b/include/boost/indirect_reference.hpp old mode 100755 new mode 100644 diff --git a/include/boost/pending/integer_log2.hpp b/include/boost/pending/integer_log2.hpp index 15fd8b5..f4bc846 100644 --- a/include/boost/pending/integer_log2.hpp +++ b/include/boost/pending/integer_log2.hpp @@ -1,20 +1,16 @@ -// ------------------------------------- +// ----------------------------------------------------------- // integer_log2.hpp // // Gives the integer part of the logarithm, in base 2, of a // given number. Behavior is undefined if the argument is <= 0. // -// -// (C) Copyright Gennaro Prota 2003 - 2004. +// Copyright (c) 2003-2004, 2008 Gennaro Prota // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -// ------------------------------------------------------ -// -// $Id$ - +// ----------------------------------------------------------- #ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301 #define BOOST_INTEGER_LOG2_HPP_GP_20030301 @@ -37,7 +33,7 @@ namespace boost { while (x != 1) { - const T t = x >> n; + const T t = static_cast(x >> n); if (t) { result += n; x = t; diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 8a8c3ca..658ab6a 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -1,7 +1,7 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // utf8_codecvt_facet.cpp -// Copyright © 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) // Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at