forked from boostorg/core
Compare commits
2 Commits
feature/yi
...
feature/is
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7134904e2 | ||
|
|
216999e552 |
@@ -30,16 +30,33 @@ namespace boost
|
||||
|
||||
template<class T> inline void checked_delete(T * x) BOOST_NOEXCEPT
|
||||
{
|
||||
// intentionally complex - simplification causes regressions
|
||||
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
|
||||
#if defined(__cpp_static_assert) && __cpp_static_assert >= 200410L
|
||||
|
||||
static_assert( sizeof(T) != 0, "Type must be complete" );
|
||||
|
||||
#else
|
||||
|
||||
typedef char type_must_be_complete[ sizeof(T) ];
|
||||
(void) sizeof(type_must_be_complete);
|
||||
|
||||
#endif
|
||||
|
||||
delete x;
|
||||
}
|
||||
|
||||
template<class T> inline void checked_array_delete(T * x) BOOST_NOEXCEPT
|
||||
{
|
||||
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
|
||||
#if defined(__cpp_static_assert) && __cpp_static_assert >= 200410L
|
||||
|
||||
static_assert( sizeof(T) != 0, "Type must be complete" );
|
||||
|
||||
#else
|
||||
|
||||
typedef char type_must_be_complete[ sizeof(T) ];
|
||||
(void) sizeof(type_must_be_complete);
|
||||
|
||||
#endif
|
||||
|
||||
delete [] x;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ using boost::core::detail::sp_thread_sleep;
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if defined(BOOST_HAS_PTHREADS)
|
||||
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace core
|
||||
|
||||
inline void sp_thread_sleep() BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(BOOST_HAS_PTHREADS)
|
||||
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
|
||||
|
||||
int oldst;
|
||||
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &oldst );
|
||||
@@ -85,7 +85,7 @@ inline void sp_thread_sleep() BOOST_NOEXCEPT
|
||||
|
||||
nanosleep( &rqtp, 0 );
|
||||
|
||||
#if defined(BOOST_HAS_PTHREADS)
|
||||
#if defined(BOOST_HAS_PTHREADS) && !defined(__ANDROID__)
|
||||
|
||||
pthread_setcancelstate( oldst, &oldst );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user