-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mikejiang
committed
Dec 18, 2021
1 parent
2955cc9
commit a6e9a88
Showing
21 changed files
with
5,896 additions
and
4,010 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
source files are copied from boost_1_75 | ||
source files are copied from boost_1_78 | ||
extraction file system module from boost: | ||
download boost_1_78 | ||
./bootstrap.sh | ||
./b2 tools/bcp | ||
mkdir foo | ||
./dist/bin/bcp boost/filesystem foo/ | ||
|
||
(portion of submodules extracted by bcp xxx ./foo, can's use build files from bcp since it doesn't work somehow) | ||
compiles with the headers from BH package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// atomic.hpp ------------------------------------------------------------------------// | ||
|
||
// Copyright 2021 Andrey Semashev | ||
|
||
// Distributed under the Boost Software License, Version 1.0. | ||
// See http://www.boost.org/LICENSE_1_0.txt | ||
|
||
// See library home page at http://www.boost.org/libs/filesystem | ||
|
||
//--------------------------------------------------------------------------------------// | ||
|
||
#ifndef BOOST_FILESYSTEM_SRC_ATOMIC_REF_HPP_ | ||
#define BOOST_FILESYSTEM_SRC_ATOMIC_REF_HPP_ | ||
|
||
#include <boost/filesystem/config.hpp> | ||
|
||
#if !defined(BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF) | ||
|
||
#include <atomic> | ||
|
||
namespace atomic_ns = std; | ||
|
||
#else // !defined(BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF) | ||
|
||
#include <boost/memory_order.hpp> | ||
#include <boost/atomic/atomic_ref.hpp> | ||
|
||
namespace atomic_ns = boost; | ||
|
||
#endif // !defined(BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF) | ||
|
||
#endif // BOOST_FILESYSTEM_SRC_ATOMIC_REF_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// atomic_tools.hpp ------------------------------------------------------------------// | ||
|
||
// Copyright 2021 Andrey Semashev | ||
|
||
// Distributed under the Boost Software License, Version 1.0. | ||
// See http://www.boost.org/LICENSE_1_0.txt | ||
|
||
// See library home page at http://www.boost.org/libs/filesystem | ||
|
||
//--------------------------------------------------------------------------------------// | ||
|
||
#ifndef BOOST_FILESYSTEM_SRC_ATOMIC_TOOLS_HPP_ | ||
#define BOOST_FILESYSTEM_SRC_ATOMIC_TOOLS_HPP_ | ||
|
||
#include <boost/filesystem/config.hpp> | ||
|
||
#if !defined(BOOST_FILESYSTEM_SINGLE_THREADED) | ||
|
||
#include "atomic_ref.hpp" | ||
|
||
namespace boost { | ||
namespace filesystem { | ||
namespace detail { | ||
|
||
//! Atomically loads the value | ||
template< typename T > | ||
BOOST_FORCEINLINE T atomic_load_relaxed(T& a) | ||
{ | ||
return atomic_ns::atomic_ref< T >(a).load(atomic_ns::memory_order_relaxed); | ||
} | ||
|
||
//! Atomically stores the value | ||
template< typename T > | ||
BOOST_FORCEINLINE void atomic_store_relaxed(T& a, T val) | ||
{ | ||
atomic_ns::atomic_ref< T >(a).store(val, atomic_ns::memory_order_relaxed); | ||
} | ||
|
||
} // namespace detail | ||
} // namespace filesystem | ||
} // namespace boost | ||
|
||
#else // !defined(BOOST_FILESYSTEM_SINGLE_THREADED) | ||
|
||
namespace boost { | ||
namespace filesystem { | ||
namespace detail { | ||
|
||
//! Atomically loads the value | ||
template< typename T > | ||
BOOST_FORCEINLINE T atomic_load_relaxed(T const& a) | ||
{ | ||
return a; | ||
} | ||
|
||
//! Atomically stores the value | ||
template< typename T > | ||
BOOST_FORCEINLINE void atomic_store_relaxed(T& a, T val) | ||
{ | ||
a = val; | ||
} | ||
|
||
} // namespace detail | ||
} // namespace filesystem | ||
} // namespace boost | ||
|
||
#endif // !defined(BOOST_FILESYSTEM_SINGLE_THREADED) | ||
|
||
#endif // BOOST_FILESYSTEM_SRC_ATOMIC_TOOLS_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.