From f84dc6491d9e90f7359affb1aef1299c652f2532 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 17 Dec 2024 15:29:49 +0300 Subject: [PATCH] fixes --- include/boost/dll/alias.hpp | 2 +- include/boost/dll/runtime_symbol_info.hpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/boost/dll/alias.hpp b/include/boost/dll/alias.hpp index 0eac7cee..a30fbb5b 100644 --- a/include/boost/dll/alias.hpp +++ b/include/boost/dll/alias.hpp @@ -184,7 +184,7 @@ namespace boost { namespace dll { #else // Note: we can not use `aggressive_ptr_cast` here, because in that case GCC applies // different permissions to the section and it causes Segmentation fault. -// Note: we can not use `boost::addressof()` here, because in that case GCC +// Note: we can not use `std::addressof()` here, because in that case GCC // may optimize away the FunctionOrVar instance and we'll get a pointer to unexisting symbol. /*! * \brief Same as \forcedmacrolink{BOOST_DLL_ALIAS} but puts alias name into the user specified section. diff --git a/include/boost/dll/runtime_symbol_info.hpp b/include/boost/dll/runtime_symbol_info.hpp index e270a557..bd400c2e 100644 --- a/include/boost/dll/runtime_symbol_info.hpp +++ b/include/boost/dll/runtime_symbol_info.hpp @@ -12,6 +12,7 @@ #include #include #include + #if BOOST_OS_WINDOWS # include # include @@ -20,6 +21,8 @@ # include #endif +#include // std::addressof + #ifdef BOOST_HAS_PRAGMA_ONCE # pragma once #endif @@ -54,7 +57,7 @@ namespace detail { */ template inline boost::dll::fs::path symbol_location_ptr(T ptr_to_symbol, std::error_code& ec) { - static_assert(boost::is_pointer::value, "boost::dll::symbol_location_ptr works only with pointers! `ptr_to_symbol` must be a pointer"); + static_assert(std::is_pointer::value, "boost::dll::symbol_location_ptr works only with pointers! `ptr_to_symbol` must be a pointer"); boost::dll::fs::path ret; if (!ptr_to_symbol) { ec = std::make_error_code( @@ -135,7 +138,7 @@ namespace detail { inline boost::dll::fs::path symbol_location(const T& symbol, std::error_code& ec) { ec.clear(); return boost::dll::symbol_location_ptr( - boost::dll::detail::aggressive_ptr_cast(boost::addressof(symbol)), + boost::dll::detail::aggressive_ptr_cast(std::addressof(symbol)), ec ); } @@ -154,7 +157,7 @@ namespace detail { boost::dll::fs::path ret; std::error_code ec; ret = boost::dll::symbol_location_ptr( - boost::dll::detail::aggressive_ptr_cast(boost::addressof(symbol)), + boost::dll::detail::aggressive_ptr_cast(std::addressof(symbol)), ec );