forked from boostorg/smart_ptr
@ -74,6 +74,7 @@
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_has_sync.hpp>
|
||||
|
||||
#ifndef BOOST_HAS_THREADS
|
||||
|
||||
@ -95,10 +96,10 @@ typedef long atomic_count;
|
||||
#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
|
||||
# include <boost/smart_ptr/detail/atomic_count_gcc_x86.hpp>
|
||||
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
# include <boost/smart_ptr/detail/atomic_count_win32.hpp>
|
||||
|
||||
#elif defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) && !defined( __arm__ ) && !defined( __hppa ) && ( !defined( __INTEL_COMPILER ) || defined( __ia64__ ) )
|
||||
#elif defined( BOOST_SP_HAS_SYNC )
|
||||
# include <boost/smart_ptr/detail/atomic_count_sync.hpp>
|
||||
|
||||
#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
|
||||
|
@ -17,7 +17,11 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#include <bits/atomicity.h>
|
||||
#if __GNUC__ * 100 + __GNUC_MINOR__ >= 402
|
||||
# include <ext/atomicity.h>
|
||||
#else
|
||||
# include <bits/atomicity.h>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
@ -18,6 +18,7 @@
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_has_sync.hpp>
|
||||
|
||||
#if defined( BOOST_SP_DISABLE_THREADS )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_nt.hpp>
|
||||
@ -46,13 +47,13 @@
|
||||
#elif defined( __GNUC__ ) && ( defined( __powerpc__ ) || defined( __ppc__ ) || defined( __ppc ) )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp>
|
||||
|
||||
#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) && !defined( __arm__ ) && !defined( __hppa ) && ( !defined( __INTEL_COMPILER ) || defined( __ia64__ ) )
|
||||
#elif defined( BOOST_SP_HAS_SYNC )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_sync.hpp>
|
||||
|
||||
#elif defined(__GNUC__) && ( defined( __sparcv9 ) || ( defined( __sparcv8 ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 402 ) ) )
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp>
|
||||
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
|
||||
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined(__CYGWIN__)
|
||||
# include <boost/smart_ptr/detail/sp_counted_base_w32.hpp>
|
||||
|
||||
#elif !defined( BOOST_HAS_THREADS )
|
||||
|
49
include/boost/smart_ptr/detail/sp_has_sync.hpp
Normal file
49
include/boost/smart_ptr/detail/sp_has_sync.hpp
Normal file
@ -0,0 +1,49 @@
|
||||
#ifndef BOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
|
||||
#define BOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/smart_ptr/detail/sp_has_sync.hpp
|
||||
//
|
||||
// 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
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Defines the BOOST_SP_HAS_SYNC macro if the __sync_* intrinsics
|
||||
// are available.
|
||||
//
|
||||
|
||||
#if defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )
|
||||
|
||||
#define BOOST_SP_HAS_SYNC
|
||||
|
||||
#if defined( __arm__ ) || defined( __armel__ )
|
||||
#undef BOOST_SP_HAS_SYNC
|
||||
#endif
|
||||
|
||||
#if defined( __hppa ) || defined( __hppa__ )
|
||||
#undef BOOST_SP_HAS_SYNC
|
||||
#endif
|
||||
|
||||
#if defined( __m68k__ )
|
||||
#undef BOOST_SP_HAS_SYNC
|
||||
#endif
|
||||
|
||||
#if defined( __sparc__ )
|
||||
#undef BOOST_SP_HAS_SYNC
|
||||
#endif
|
||||
|
||||
#if defined( __INTEL_COMPILER ) && !defined( __ia64__ )
|
||||
#undef BOOST_SP_HAS_SYNC
|
||||
#endif
|
||||
|
||||
#endif // __GNUC__ * 100 + __GNUC_MINOR__ >= 401
|
||||
|
||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
|
@ -29,17 +29,23 @@
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_has_sync.hpp>
|
||||
|
||||
#if defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ )
|
||||
# include <boost/smart_ptr/detail/spinlock_gcc_arm.hpp>
|
||||
#elif defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) && !defined( __arm__ ) && !defined( __hppa ) && ( !defined( __INTEL_COMPILER ) || defined( __ia64__ ) )
|
||||
|
||||
#elif defined( BOOST_SP_HAS_SYNC )
|
||||
# include <boost/smart_ptr/detail/spinlock_sync.hpp>
|
||||
|
||||
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
# include <boost/smart_ptr/detail/spinlock_w32.hpp>
|
||||
|
||||
#elif defined(BOOST_HAS_PTHREADS)
|
||||
# include <boost/smart_ptr/detail/spinlock_pt.hpp>
|
||||
|
||||
#elif !defined(BOOST_HAS_THREADS)
|
||||
# include <boost/smart_ptr/detail/spinlock_nt.hpp>
|
||||
|
||||
#else
|
||||
# error Unrecognized threading platform
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user