Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOT FOR MERGE #91

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
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 number Diff line number Diff 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 Down Expand 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
Loading