Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85793 - trunk/boost/atomic/detail
From: andrey.semashev_at_[hidden]
Date: 2013-09-19 16:04:47


Author: andysem
Date: 2013-09-19 16:04:47 EDT (Thu, 19 Sep 2013)
New Revision: 85793
URL: http://svn.boost.org/trac/boost/changeset/85793

Log:
Fixed duplicate BOOST_ATOMIC_COMPILER_BARRIER macro definition. Extracted linking setup to a separate header so that including interlocked.hpp doesn't require linking with the library.

Added:
   trunk/boost/atomic/detail/link.hpp (contents, props changed)
Text files modified:
   trunk/boost/atomic/detail/config.hpp | 34 ---------------------------
   trunk/boost/atomic/detail/link.hpp | 50 ++++++++++++++++++++++++++++++++++++++++
   trunk/boost/atomic/detail/lockpool.hpp | 1
   trunk/boost/atomic/detail/windows.hpp | 13 ---------
   4 files changed, 52 insertions(+), 46 deletions(-)

Modified: trunk/boost/atomic/detail/config.hpp
==============================================================================
--- trunk/boost/atomic/detail/config.hpp Thu Sep 19 15:27:41 2013 (r85792)
+++ trunk/boost/atomic/detail/config.hpp 2013-09-19 16:04:47 EDT (Thu, 19 Sep 2013) (r85793)
@@ -13,38 +13,4 @@
 #pragma once
 #endif
 
-///////////////////////////////////////////////////////////////////////////////
-// Set up dll import/export options
-#if (defined(BOOST_ATOMIC_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && \
- !defined(BOOST_ATOMIC_STATIC_LINK)
-
-#if defined(BOOST_ATOMIC_SOURCE)
-#define BOOST_ATOMIC_DECL BOOST_SYMBOL_EXPORT
-#define BOOST_ATOMIC_BUILD_DLL
-#else
-#define BOOST_ATOMIC_DECL BOOST_SYMBOL_IMPORT
-#endif
-
-#endif // building a shared library
-
-#ifndef BOOST_ATOMIC_DECL
-#define BOOST_ATOMIC_DECL
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// Auto library naming
-#if !defined(BOOST_ATOMIC_SOURCE) && !defined(BOOST_ALL_NO_LIB) && \
- !defined(BOOST_ATOMIC_NO_LIB)
-
-#define BOOST_LIB_NAME boost_atomic
-
-// tell the auto-link code to select a dll when required:
-#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ATOMIC_DYN_LINK)
-#define BOOST_DYN_LINK
-#endif
-
-#include <boost/config/auto_link.hpp>
-
-#endif // auto-linking disabled
-
 #endif

Added: trunk/boost/atomic/detail/link.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/atomic/detail/link.hpp 2013-09-19 16:04:47 EDT (Thu, 19 Sep 2013) (r85793)
@@ -0,0 +1,50 @@
+#ifndef BOOST_ATOMIC_DETAIL_LINK_HPP
+#define BOOST_ATOMIC_DETAIL_LINK_HPP
+
+// Copyright (c) 2012 Hartmut Kaiser
+//
+// 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/atomic/detail/config.hpp>
+
+#ifdef BOOST_HAS_PRAGMA_ONCE
+#pragma once
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// Set up dll import/export options
+#if (defined(BOOST_ATOMIC_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && \
+ !defined(BOOST_ATOMIC_STATIC_LINK)
+
+#if defined(BOOST_ATOMIC_SOURCE)
+#define BOOST_ATOMIC_DECL BOOST_SYMBOL_EXPORT
+#define BOOST_ATOMIC_BUILD_DLL
+#else
+#define BOOST_ATOMIC_DECL BOOST_SYMBOL_IMPORT
+#endif
+
+#endif // building a shared library
+
+#ifndef BOOST_ATOMIC_DECL
+#define BOOST_ATOMIC_DECL
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// Auto library naming
+#if !defined(BOOST_ATOMIC_SOURCE) && !defined(BOOST_ALL_NO_LIB) && \
+ !defined(BOOST_ATOMIC_NO_LIB)
+
+#define BOOST_LIB_NAME boost_atomic
+
+// tell the auto-link code to select a dll when required:
+#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_ATOMIC_DYN_LINK)
+#define BOOST_DYN_LINK
+#endif
+
+#include <boost/config/auto_link.hpp>
+
+#endif // auto-linking disabled
+
+#endif

Modified: trunk/boost/atomic/detail/lockpool.hpp
==============================================================================
--- trunk/boost/atomic/detail/lockpool.hpp Thu Sep 19 15:27:41 2013 (r85792)
+++ trunk/boost/atomic/detail/lockpool.hpp 2013-09-19 16:04:47 EDT (Thu, 19 Sep 2013) (r85793)
@@ -8,6 +8,7 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 #include <boost/atomic/detail/config.hpp>
+#include <boost/atomic/detail/link.hpp>
 #ifndef BOOST_ATOMIC_FLAG_LOCK_FREE
 #include <boost/smart_ptr/detail/lightweight_mutex.hpp>
 #endif

Modified: trunk/boost/atomic/detail/windows.hpp
==============================================================================
--- trunk/boost/atomic/detail/windows.hpp Thu Sep 19 15:27:41 2013 (r85792)
+++ trunk/boost/atomic/detail/windows.hpp 2013-09-19 16:04:47 EDT (Thu, 19 Sep 2013) (r85793)
@@ -46,7 +46,7 @@
 
 // Define compiler barriers
 #if defined(__INTEL_COMPILER)
-#define BOOST_ATOMIC_COMPILER_BARRIER __memory_barrier();
+#define BOOST_ATOMIC_COMPILER_BARRIER() __memory_barrier()
 #elif defined(_MSC_VER) && _MSC_VER >= 1310 && !defined(_WIN32_WCE)
 extern "C" void _ReadWriteBarrier(void);
 #pragma intrinsic(_ReadWriteBarrier)
@@ -72,17 +72,6 @@
 #endif
 }
 
-// Define compiler barriers
-#if defined(_MSC_VER) && _MSC_VER >= 1310 && !defined(_WIN32_WCE)
-extern "C" void _ReadWriteBarrier();
-#pragma intrinsic(_ReadWriteBarrier)
-#define BOOST_ATOMIC_COMPILER_BARRIER() _ReadWriteBarrier()
-#endif
-
-#ifndef BOOST_ATOMIC_COMPILER_BARRIER
-#define BOOST_ATOMIC_COMPILER_BARRIER()
-#endif
-
 BOOST_FORCEINLINE void
 platform_fence_before(memory_order)
 {


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