Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85994 - trunk/boost/detail
From: pdimov_at_[hidden]
Date: 2013-09-29 07:04:37


Author: pdimov
Date: 2013-09-29 07:04:37 EDT (Sun, 29 Sep 2013)
New Revision: 85994
URL: http://svn.boost.org/trac/boost/changeset/85994

Log:
Add BOOST_USE_INTRIN_H support; remove #pragma intrinsic, not needed and not supported on Intel.

Text files modified:
   trunk/boost/detail/interlocked.hpp | 33 ++++++++++++++++++++++++---------
   1 files changed, 24 insertions(+), 9 deletions(-)

Modified: trunk/boost/detail/interlocked.hpp
==============================================================================
--- trunk/boost/detail/interlocked.hpp Sun Sep 29 06:43:15 2013 (r85993)
+++ trunk/boost/detail/interlocked.hpp 2013-09-29 07:04:37 EDT (Sun, 29 Sep 2013) (r85994)
@@ -30,6 +30,30 @@
 # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER InterlockedCompareExchangePointer
 # define BOOST_INTERLOCKED_EXCHANGE_POINTER InterlockedExchangePointer
 
+#elif defined( BOOST_USE_INTRIN_H )
+
+#include <intrin.h>
+
+# define BOOST_INTERLOCKED_INCREMENT _InterlockedIncrement
+# define BOOST_INTERLOCKED_DECREMENT _InterlockedDecrement
+# define BOOST_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
+# define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange
+# define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd
+
+# if defined(_M_IA64) || defined(_M_AMD64) || defined(__x86_64__) || defined(__x86_64)
+
+# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
+# define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
+
+# else
+
+# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
+ ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
+# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
+ ((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
+
+# endif
+
 #elif defined(_WIN32_WCE)
 
 #if _WIN32_WCE >= 0x600
@@ -92,20 +116,11 @@
 
 #endif
 
-# pragma intrinsic( _InterlockedIncrement )
-# pragma intrinsic( _InterlockedDecrement )
-# pragma intrinsic( _InterlockedCompareExchange )
-# pragma intrinsic( _InterlockedExchange )
-# pragma intrinsic( _InterlockedExchangeAdd )
-
 # if defined(_M_IA64) || defined(_M_AMD64)
 
 extern "C" void* __cdecl _InterlockedCompareExchangePointer( void* volatile *, void*, void* );
 extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
 
-# pragma intrinsic( _InterlockedCompareExchangePointer )
-# pragma intrinsic( _InterlockedExchangePointer )
-
 # define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER _InterlockedCompareExchangePointer
 # define BOOST_INTERLOCKED_EXCHANGE_POINTER _InterlockedExchangePointer
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk