mirror of
https://github.com/boostorg/detail.git
synced 2025-12-19 05:22:37 +01:00
Compare commits
36 Commits
svn-branch
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fcb238b7f | ||
|
|
20c35502cb | ||
|
|
ac8783da2c | ||
|
|
4ae97fa5cb | ||
|
|
18dbae4700 | ||
|
|
b328080dbb | ||
|
|
a6af6ca66f | ||
|
|
df8aaff6da | ||
|
|
06946f6607 | ||
|
|
3c2c779258 | ||
|
|
7c911e570f | ||
|
|
96b53f28a8 | ||
|
|
7e259580c1 | ||
|
|
3d539b76df | ||
|
|
e4054d843a | ||
|
|
9dcdea9efc | ||
|
|
680e819cf3 | ||
|
|
22520394e4 | ||
|
|
9469ab6c88 | ||
|
|
7571f64b35 | ||
|
|
8da5b03c03 | ||
|
|
537dc5325c | ||
|
|
7c8108ee0b | ||
|
|
49858c1ac4 | ||
|
|
ec6dfefa6e | ||
|
|
1df1d181c0 | ||
|
|
dc34adabef | ||
|
|
8aebcc4fbd | ||
|
|
2551c9baf0 | ||
|
|
71ec49242e | ||
|
|
0dc54e7b18 | ||
|
|
4039b44fce | ||
|
|
2f7218cdc4 | ||
|
|
37cd3c6dd2 | ||
|
|
71a268689d | ||
|
|
4dda81e93a |
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2003-2007 Joaqu<EFBFBD>n M L<EFBFBD>pez Mu<EFBFBD>oz.
|
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||||
* 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)
|
||||||
|
|||||||
0
include/boost/detail/indirect_traits.hpp
Executable file → Normal file
0
include/boost/detail/indirect_traits.hpp
Executable file → Normal file
@@ -92,7 +92,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__ )
|
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|||||||
0
include/boost/detail/is_function_ref_tester.hpp
Executable file → Normal file
0
include/boost/detail/is_function_ref_tester.hpp
Executable file → Normal file
0
include/boost/detail/is_incrementable.hpp
Executable file → Normal file
0
include/boost/detail/is_incrementable.hpp
Executable file → Normal file
0
include/boost/detail/is_xxx.hpp
Executable file → Normal file
0
include/boost/detail/is_xxx.hpp
Executable file → Normal file
135
include/boost/detail/lightweight_thread.hpp
Normal file
135
include/boost/detail/lightweight_thread.hpp
Normal file
@@ -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 <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 <EFBFBD> 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).
|
// 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)
|
||||||
|
|||||||
0
include/boost/indirect_reference.hpp
Executable file → Normal file
0
include/boost/indirect_reference.hpp
Executable file → Normal file
@@ -1,20 +1,16 @@
|
|||||||
// -------------------------------------
|
// -----------------------------------------------------------
|
||||||
// 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
|
||||||
@@ -37,7 +33,7 @@ namespace boost {
|
|||||||
|
|
||||||
while (x != 1) {
|
while (x != 1) {
|
||||||
|
|
||||||
const T t = x >> n;
|
const T t = static_cast<T>(x >> n);
|
||||||
if (t) {
|
if (t) {
|
||||||
result += n;
|
result += n;
|
||||||
x = t;
|
x = t;
|
||||||
|
|||||||
@@ -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 <EFBFBD> 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).
|
// 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
|
||||||
|
|||||||
Reference in New Issue
Block a user