Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:30:36

0001 // Copyright Antony Polukhin, 2018-2025.
0002 //
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt
0005 // or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 /// \file boost/dll/config.hpp
0008 /// \brief Imports filesystem, error_code, errc, system_error, make_error_code from Boost or C++17 into `boost::dll::fs` namespace.
0009 
0010 #ifndef BOOST_DLL_DETAIL_CONFIG_HPP
0011 #define BOOST_DLL_DETAIL_CONFIG_HPP
0012 
0013 #include <boost/config.hpp>
0014 #ifdef BOOST_HAS_PRAGMA_ONCE
0015 #   pragma once
0016 #endif
0017 
0018 #ifdef BOOST_DLL_DOXYGEN
0019 /// Define this macro to make Boost.DLL use C++17's std::filesystem::path and std::system_error.
0020 #define BOOST_DLL_USE_STD_FS BOOST_DLL_USE_STD_FS
0021 
0022 /// Define this macro to make Boost.DLL use boost::shared_ptr instead of std::shared_ptr. This macro will be removed
0023 /// after a few releases, consider migrating to std::shared_ptr. 
0024 #define BOOST_DLL_USE_BOOST_SHARED_PTR BOOST_DLL_USE_BOOST_SHARED_PTR
0025 
0026 /// This namespace contains aliases to the Boost or C++17 classes. Aliases are configured using BOOST_DLL_USE_STD_FS macro.
0027 namespace boost { namespace dll { namespace fs {
0028 
0029 /// Alias to `std::filesystem::path` if \forcedmacrolink{BOOST_DLL_USE_STD_FS} is defined by user.
0030 /// Alias to `boost::filesystem::path` otherwise.
0031 using path = std::conditional_t<BOOST_DLL_USE_STD_FS, std::filesystem::path, boost::filesystem::path>;
0032 
0033 /// Alias to `std::error_code` if \forcedmacrolink{BOOST_DLL_USE_STD_FS} is defined by user.
0034 /// boost::system::error_code otherwise.
0035 using error_code = std::conditional_t<BOOST_DLL_USE_STD_FS, std::error_code, boost::system::error_code>;
0036 
0037 /// Alias to `std::system_error` if \forcedmacrolink{BOOST_DLL_USE_STD_FS} is defined by user.
0038 /// Alias to `boost::system::system_error` otherwise.
0039 using system_error = std::conditional_t<BOOST_DLL_USE_STD_FS, std::system_error, boost::system::system_error>;
0040 
0041 }}}
0042 
0043 #endif
0044 
0045 
0046 #ifdef BOOST_DLL_USE_STD_FS
0047 #include <filesystem>
0048 
0049 #include <system_error>
0050 
0051 namespace boost { namespace dll { namespace fs {
0052 
0053 using namespace std::filesystem;
0054 using std::error_code;
0055 using std::system_error;
0056 
0057 }}}
0058 
0059 #else // BOOST_DLL_USE_STD_FS
0060 
0061 #include <boost/filesystem/path.hpp>
0062 #include <boost/filesystem/operations.hpp>
0063 #include <boost/system/system_error.hpp>
0064 #include <boost/system/error_code.hpp>
0065 
0066 namespace boost { namespace dll { namespace fs {
0067 
0068 using namespace boost::filesystem;
0069 using boost::system::error_code;
0070 using boost::system::system_error;
0071 
0072 }}}
0073 
0074 #endif // BOOST_DLL_USE_STD_FS
0075 
0076 
0077 #ifdef BOOST_DLL_USE_BOOST_SHARED_PTR
0078 
0079 #include <boost/make_shared.hpp>
0080 
0081 namespace boost { namespace dll { namespace detail {
0082     template <class T>
0083     using shared_ptr = boost::shared_ptr<T>;
0084     using boost::make_shared;
0085 }}}
0086 
0087 #else  // BOOST_DLL_USE_STD_FS
0088 
0089 #include <memory>
0090 
0091 namespace boost { namespace dll { namespace detail {
0092     template <class T>
0093     using shared_ptr = std::shared_ptr<T>;
0094     using std::make_shared;
0095 }}}
0096 
0097 #endif  // BOOST_DLL_USE_STD_FS
0098 
0099 #endif // BOOST_DLL_DETAIL_PUSH_OPTIONS_HPP
0100