mirror of
https://github.com/boostorg/detail.git
synced 2025-06-28 13:31:05 +02:00
Compare commits
1 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
7f7562ecf7 |
@ -1,21 +0,0 @@
|
|||||||
#----------------------------------------------------------------------------
|
|
||||||
# This file was automatically generated from the original CMakeLists.txt file
|
|
||||||
# Add a variable to hold the headers for the library
|
|
||||||
set (lib_headers
|
|
||||||
detail
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add a library target to the build system
|
|
||||||
boost_library_project(
|
|
||||||
detail
|
|
||||||
# SRCDIRS
|
|
||||||
# TESTDIRS
|
|
||||||
HEADERS ${lib_headers}
|
|
||||||
# DOCDIRS
|
|
||||||
# DESCRIPTION "Helps Boost library developers adapt to compiler idiosyncrasies; not intended for library users."
|
|
||||||
MODULARIZED
|
|
||||||
# AUTHORS "John Maddock <john -at- johnmaddock.co.uk>"
|
|
||||||
# MAINTAINERS
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
/* Copyright 2003-2005 Joaqu<EFBFBD>n M L<EFBFBD>pez Mu<EFBFBD>oz.
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
* Distributed under the Boost Software License, Version 1.0.
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
* http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -30,21 +30,13 @@ namespace detail{
|
|||||||
namespace allocator{
|
namespace allocator{
|
||||||
|
|
||||||
/* partial_std_allocator_wrapper inherits the functionality of a std
|
/* partial_std_allocator_wrapper inherits the functionality of a std
|
||||||
* allocator while providing a templatized ctor and other bits missing
|
* allocator while providing a templatized ctor.
|
||||||
* in some stdlib implementation or another.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename Type>
|
template<typename Type>
|
||||||
class partial_std_allocator_wrapper:public std::allocator<Type>
|
class partial_std_allocator_wrapper:public std::allocator<Type>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/* Oddly enough, STLport does not define std::allocator<void>::value_type
|
|
||||||
* when configured to work without partial template specialization.
|
|
||||||
* No harm in supplying the definition here unconditionally.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef Type value_type;
|
|
||||||
|
|
||||||
partial_std_allocator_wrapper(){};
|
partial_std_allocator_wrapper(){};
|
||||||
|
|
||||||
template<typename Other>
|
template<typename Other>
|
||||||
@ -181,13 +173,7 @@ void construct(void* p,const Type& t)
|
|||||||
template<typename Type>
|
template<typename Type>
|
||||||
void destroy(const Type* p)
|
void destroy(const Type* p)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
|
|
||||||
const_cast<Type*>(p)->~Type();
|
|
||||||
#else
|
|
||||||
p->~Type();
|
p->~Type();
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace boost::detail::allocator */
|
} /* namespace boost::detail::allocator */
|
||||||
|
@ -42,10 +42,10 @@
|
|||||||
# error Unknown machine endianness detected.
|
# error Unknown machine endianness detected.
|
||||||
# endif
|
# endif
|
||||||
# define BOOST_BYTE_ORDER __BYTE_ORDER
|
# define BOOST_BYTE_ORDER __BYTE_ORDER
|
||||||
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
|
#elif defined(_BIG_ENDIAN)
|
||||||
# define BOOST_BIG_ENDIAN
|
# define BOOST_BIG_ENDIAN
|
||||||
# define BOOST_BYTE_ORDER 4321
|
# define BOOST_BYTE_ORDER 4321
|
||||||
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
|
#elif defined(_LITTLE_ENDIAN)
|
||||||
# define BOOST_LITTLE_ENDIAN
|
# define BOOST_LITTLE_ENDIAN
|
||||||
# define BOOST_BYTE_ORDER 1234
|
# define BOOST_BYTE_ORDER 1234
|
||||||
#elif defined(__sparc) || defined(__sparc__) \
|
#elif defined(__sparc) || defined(__sparc__) \
|
||||||
|
0
include/boost/detail/indirect_traits.hpp
Normal file → Executable file
0
include/boost/detail/indirect_traits.hpp
Normal file → Executable file
@ -47,11 +47,6 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long );
|
|||||||
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
|
# define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd
|
# 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 )
|
#elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN )
|
||||||
|
|
||||||
extern "C" long __cdecl _InterlockedIncrement( long volatile * );
|
extern "C" long __cdecl _InterlockedIncrement( long volatile * );
|
||||||
@ -92,7 +87,7 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
|
|||||||
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
|
# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
|
||||||
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
|
# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
|
||||||
|
|
||||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
0
include/boost/detail/is_function_ref_tester.hpp
Normal file → Executable file
0
include/boost/detail/is_function_ref_tester.hpp
Normal file → Executable file
12
include/boost/detail/is_incrementable.hpp
Normal file → Executable file
12
include/boost/detail/is_incrementable.hpp
Normal file → Executable file
@ -63,12 +63,7 @@ namespace is_incrementable_
|
|||||||
tag operator,(tag,int);
|
tag operator,(tag,int);
|
||||||
# define BOOST_comma(a,b) (a,b)
|
# define BOOST_comma(a,b) (a,b)
|
||||||
# endif
|
# 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
|
// two check overloads help us identify which operator++ was picked
|
||||||
char (& check(tag) )[2];
|
char (& check(tag) )[2];
|
||||||
|
|
||||||
@ -97,11 +92,6 @@ namespace is_incrementable_
|
|||||||
, value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1
|
, value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
# if defined(BOOST_MSVC)
|
|
||||||
# pragma warning(pop)
|
|
||||||
# endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# undef BOOST_comma
|
# undef BOOST_comma
|
||||||
|
0
include/boost/detail/is_xxx.hpp
Normal file → Executable file
0
include/boost/detail/is_xxx.hpp
Normal file → Executable file
@ -1,135 +0,0 @@
|
|||||||
#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 <boost/config.hpp>
|
|
||||||
#include <memory>
|
|
||||||
#include <cerrno>
|
|
||||||
|
|
||||||
// pthread_create, pthread_join
|
|
||||||
|
|
||||||
#if defined( BOOST_HAS_PTHREADS )
|
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include <process.h>
|
|
||||||
|
|
||||||
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<class F> 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<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
|
|
||||||
|
|
||||||
pt->run();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
unsigned __stdcall lw_thread_routine( void * pv )
|
|
||||||
{
|
|
||||||
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
|
|
||||||
|
|
||||||
pt->run();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class F> class lw_thread_impl: public lw_abstract_thread
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
explicit lw_thread_impl( F f ): f_( f )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void run()
|
|
||||||
{
|
|
||||||
f_();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
F f_;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class F> int lw_thread_create( pthread_t & pt, F f )
|
|
||||||
{
|
|
||||||
std::auto_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( 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
|
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
// Copyright <EFBFBD> 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
||||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompany-
|
// 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)
|
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -79,17 +79,25 @@
|
|||||||
// specialized on those types for this to work.
|
// specialized on those types for this to work.
|
||||||
|
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <cwchar> // for mbstate_t
|
// for mbstate_t
|
||||||
#include <cstddef> // for std::size_t
|
#include <wchar.h>
|
||||||
|
// for std::size_t
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
|
|
||||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
namespace std {
|
||||||
using ::codecvt;
|
#if defined(__LIBCOMO__)
|
||||||
using ::mbstate_t;
|
using ::mbstate_t;
|
||||||
using ::size_t
|
#elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__)
|
||||||
#endif
|
using ::mbstate_t;
|
||||||
|
#elif defined(__SGI_STL_PORT)
|
||||||
|
#elif defined(BOOST_NO_STDC_NAMESPACE)
|
||||||
|
using ::mbstate_t;
|
||||||
|
using ::codecvt;
|
||||||
|
#endif
|
||||||
|
} // namespace std
|
||||||
|
|
||||||
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
|
#if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
|
||||||
#define BOOST_CODECVT_DO_LENGTH_CONST const
|
#define BOOST_CODECVT_DO_LENGTH_CONST const
|
||||||
|
0
include/boost/indirect_reference.hpp
Normal file → Executable file
0
include/boost/indirect_reference.hpp
Normal file → Executable file
@ -1,16 +1,20 @@
|
|||||||
// -----------------------------------------------------------
|
// -------------------------------------
|
||||||
// integer_log2.hpp
|
// integer_log2.hpp
|
||||||
//
|
//
|
||||||
// Gives the integer part of the logarithm, in base 2, of a
|
// Gives the integer part of the logarithm, in base 2, of a
|
||||||
// given number. Behavior is undefined if the argument is <= 0.
|
// given number. Behavior is undefined if the argument is <= 0.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2003-2004, 2008 Gennaro Prota
|
//
|
||||||
|
// (C) Copyright Gennaro Prota 2003 - 2004.
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//
|
//
|
||||||
// -----------------------------------------------------------
|
// ------------------------------------------------------
|
||||||
|
//
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
|
||||||
#ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301
|
#ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301
|
||||||
#define BOOST_INTEGER_LOG2_HPP_GP_20030301
|
#define BOOST_INTEGER_LOG2_HPP_GP_20030301
|
||||||
@ -33,7 +37,7 @@ namespace boost {
|
|||||||
|
|
||||||
while (x != 1) {
|
while (x != 1) {
|
||||||
|
|
||||||
const T t = static_cast<T>(x >> n);
|
const T t = x >> n;
|
||||||
if (t) {
|
if (t) {
|
||||||
result += n;
|
result += n;
|
||||||
x = t;
|
x = t;
|
||||||
|
@ -1 +0,0 @@
|
|||||||
boost_module(detail DEPENDS integer)
|
|
@ -1,7 +1,7 @@
|
|||||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||||
// utf8_codecvt_facet.cpp
|
// utf8_codecvt_facet.cpp
|
||||||
|
|
||||||
// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
// Copyright <EFBFBD> 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu)
|
||||||
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu).
|
||||||
// Use, modification and distribution is subject to the Boost Software
|
// Use, modification and distribution is subject to the Boost Software
|
||||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
@ -139,8 +139,8 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
|
|||||||
int shift_exponent = (cont_octet_count) * 6;
|
int shift_exponent = (cont_octet_count) * 6;
|
||||||
|
|
||||||
// Process the first character
|
// Process the first character
|
||||||
*to++ = static_cast<char>(octet1_modifier_table[cont_octet_count] +
|
*to++ = octet1_modifier_table[cont_octet_count] +
|
||||||
(unsigned char)(*from / (1 << shift_exponent)));
|
(unsigned char)(*from / (1 << shift_exponent));
|
||||||
|
|
||||||
// Process the continuation characters
|
// Process the continuation characters
|
||||||
// Invariants: At the start of the loop:
|
// Invariants: At the start of the loop:
|
||||||
@ -150,7 +150,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out(
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
while (i != cont_octet_count && to != to_end) {
|
while (i != cont_octet_count && to != to_end) {
|
||||||
shift_exponent -= 6;
|
shift_exponent -= 6;
|
||||||
*to++ = static_cast<char>(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)));
|
*to++ = 0x80 + ((*from / (1 << shift_exponent)) % (1 << 6));
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
// If we filled up the out buffer before encoding the character
|
// If we filled up the out buffer before encoding the character
|
||||||
@ -199,7 +199,7 @@ int utf8_codecvt_facet::do_length(
|
|||||||
last_octet_count = (get_octet_count(*from_next));
|
last_octet_count = (get_octet_count(*from_next));
|
||||||
++char_count;
|
++char_count;
|
||||||
}
|
}
|
||||||
return static_cast<int>(from_next-from_end);
|
return from_next-from_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int utf8_codecvt_facet::get_octet_count(
|
unsigned int utf8_codecvt_facet::get_octet_count(
|
||||||
|
Reference in New Issue
Block a user