Skip to content

Commit

Permalink
Lockfree: early use of pragma once
Browse files Browse the repository at this point in the history
  • Loading branch information
timblechmann committed Dec 13, 2024
1 parent ebfefa7 commit 435eec3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
12 changes: 8 additions & 4 deletions include/boost/lockfree/lockfree_forward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@
#ifndef BOOST_LOCKFREE_FORWARD_HPP_INCLUDED
#define BOOST_LOCKFREE_FORWARD_HPP_INCLUDED

#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif


#ifndef BOOST_DOXYGEN_INVOKED

# include <cstddef>
# include <type_traits>

# include <boost/config.hpp>
# if !defined( BOOST_NO_CXX20_HDR_CONCEPTS )
# include <type_traits>
# endif

namespace boost { namespace lockfree {

Expand Down Expand Up @@ -57,5 +62,4 @@ struct spsc_value;
}} // namespace boost::lockfree

#endif // BOOST_DOXYGEN_INVOKED

#endif // BOOST_LOCKFREE_FORWARD_HPP_INCLUDED
5 changes: 5 additions & 0 deletions include/boost/lockfree/policies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
#ifndef BOOST_LOCKFREE_POLICIES_HPP_INCLUDED
#define BOOST_LOCKFREE_POLICIES_HPP_INCLUDED

#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif

#include <boost/parameter/template_keyword.hpp>

#include <type_traits>
Expand Down
10 changes: 5 additions & 5 deletions include/boost/lockfree/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
#ifndef BOOST_LOCKFREE_FIFO_HPP_INCLUDED
#define BOOST_LOCKFREE_FIFO_HPP_INCLUDED

#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif

#include <boost/assert.hpp>
#include <boost/config.hpp> // for BOOST_LIKELY & BOOST_ALIGNMENT
#include <boost/core/allocator_access.hpp>
#include <boost/parameter/optional.hpp>
#include <boost/parameter/parameters.hpp>
Expand All @@ -26,10 +30,6 @@
#include <boost/lockfree/detail/uses_optional.hpp>
#include <boost/lockfree/lockfree_forward.hpp>

#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif


#if defined( _MSC_VER )
# pragma warning( push )
Expand Down
10 changes: 5 additions & 5 deletions include/boost/lockfree/spsc_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@
#ifndef BOOST_LOCKFREE_SPSC_QUEUE_HPP_INCLUDED
#define BOOST_LOCKFREE_SPSC_QUEUE_HPP_INCLUDED

#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif

#include <algorithm>
#include <memory>
#include <type_traits>

#include <boost/aligned_storage.hpp>
#include <boost/assert.hpp>
#include <boost/config.hpp> // for BOOST_LIKELY
#include <boost/core/allocator_access.hpp>
#include <boost/core/span.hpp>
#include <boost/parameter/optional.hpp>
Expand All @@ -30,10 +34,6 @@
#include <boost/lockfree/detail/uses_optional.hpp>
#include <boost/lockfree/lockfree_forward.hpp>

#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif

namespace boost { namespace lockfree {
namespace detail {

Expand Down
10 changes: 6 additions & 4 deletions include/boost/lockfree/stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
#ifndef BOOST_LOCKFREE_STACK_HPP_INCLUDED
#define BOOST_LOCKFREE_STACK_HPP_INCLUDED

#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif


#include <boost/assert.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/no_exceptions_support.hpp>
Expand All @@ -26,10 +32,6 @@
#include <tuple>
#include <type_traits>

#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif

namespace boost { namespace lockfree {
namespace detail {

Expand Down

0 comments on commit 435eec3

Please sign in to comment.