blob: 5b5b4df9e835a645672433289ee0f8205ac33c8b [file] [log] [blame]
Jeff Thompson3d613fd2013-10-15 15:39:04 -07001#ifndef NDNBOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
2#define NDNBOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED
Jeff Thompsonf7d49942013-08-01 16:47:40 -07003
4// MS compatible compilers support #pragma once
5
6#if defined(_MSC_VER) && (_MSC_VER >= 1020)
7# pragma once
8#endif
9
10//
Jeff Thompson9939dcd2013-10-15 15:12:24 -070011// ndnboost/smart_ptr/detail/sp_has_sync.hpp
Jeff Thompsonf7d49942013-08-01 16:47:40 -070012//
13// Copyright (c) 2008, 2009 Peter Dimov
14//
15// Distributed under the Boost Software License, Version 1.0.
16// See accompanying file LICENSE_1_0.txt or copy at
17// http://www.boost.org/LICENSE_1_0.txt)
18//
Jeff Thompson3d613fd2013-10-15 15:39:04 -070019// Defines the NDNBOOST_SP_HAS_SYNC macro if the __sync_* intrinsics
Jeff Thompsonf7d49942013-08-01 16:47:40 -070020// are available.
21//
22
Jeff Thompson3d613fd2013-10-15 15:39:04 -070023#ifndef NDNBOOST_SP_NO_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070024
25#if defined( __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 )
26
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027# define NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070028
29#elif defined( __IBMCPP__ ) && ( __IBMCPP__ >= 1210 )
30
Jeff Thompson3d613fd2013-10-15 15:39:04 -070031# define NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070032
33#elif defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )
34
Jeff Thompson3d613fd2013-10-15 15:39:04 -070035#define NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070036
37#if defined( __arm__ ) || defined( __armel__ )
Jeff Thompson3d613fd2013-10-15 15:39:04 -070038#undef NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070039#endif
40
41#if defined( __hppa ) || defined( __hppa__ )
Jeff Thompson3d613fd2013-10-15 15:39:04 -070042#undef NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070043#endif
44
45#if defined( __m68k__ )
Jeff Thompson3d613fd2013-10-15 15:39:04 -070046#undef NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070047#endif
48
49#if defined( __sh__ )
Jeff Thompson3d613fd2013-10-15 15:39:04 -070050#undef NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070051#endif
52
53#if defined( __sparc__ )
Jeff Thompson3d613fd2013-10-15 15:39:04 -070054#undef NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070055#endif
56
57#if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) && ( __INTEL_COMPILER < 1110 )
Jeff Thompson3d613fd2013-10-15 15:39:04 -070058#undef NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070059#endif
60
61#if defined(__PATHSCALE__) && ((__PATHCC__ == 4) && (__PATHCC_MINOR__ < 9))
Jeff Thompson3d613fd2013-10-15 15:39:04 -070062#undef NDNBOOST_SP_HAS_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070063#endif
64
65#endif
66
Jeff Thompson3d613fd2013-10-15 15:39:04 -070067#endif // #ifndef NDNBOOST_SP_NO_SYNC
Jeff Thompsonf7d49942013-08-01 16:47:40 -070068
Jeff Thompson3d613fd2013-10-15 15:39:04 -070069#endif // #ifndef NDNBOOST_SMART_PTR_DETAIL_SP_HAS_SYNC_HPP_INCLUDED