Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions include/boost/dll/import.hpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,7 @@

#include <memory> // std::addressof
#include <type_traits>
#include <iostream>

#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
Expand DownExpand Up@@ -105,13 +106,17 @@ namespace detail {
* Overload that accepts path also throws std::bad_alloc in case of insufficient memory.
*/
template <class T>
BOOST_DLL_IMPORT_RESULT_TYPE import_symbol(const boost::dll::fs::path& lib, const char* name,
BOOST_DLL_IMPORT_RESULT_TYPE import_symbol(const boost::dll::fs::path& path, const char* name,
load_mode::type mode = load_mode::default_mode)
{
using type = boost::dll::detail::import_type<T>;

auto p = boost::dll::detail::make_shared<boost::dll::shared_library>(lib, mode);
std::cerr << "import_symbol 1\n";
boost::dll::shared_library lib(path, mode);
std::cerr << "import_symbol 1.5\n";
auto p = boost::dll::detail::make_shared<boost::dll::shared_library>(std::move(lib));
std::cerr << "import_symbol 2\n";
auto* addr = std::addressof(p->get<T>(name));
std::cerr << "import_symbol 3\n";
return type(std::move(p), addr);
}

Expand Down