diff options
-rw-r--r-- | src/common/dynamic_library.cpp | 2 | ||||
-rw-r--r-- | src/common/dynamic_library.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/common/dynamic_library.cpp b/src/common/dynamic_library.cpp index 054277a2b..4fabe7e52 100644 --- a/src/common/dynamic_library.cpp +++ b/src/common/dynamic_library.cpp @@ -22,6 +22,8 @@ DynamicLibrary::DynamicLibrary(const char* filename) { void(Open(filename)); } +DynamicLibrary::DynamicLibrary(void* handle_) : handle{handle_} {} + DynamicLibrary::DynamicLibrary(DynamicLibrary&& rhs) noexcept : handle{std::exchange(rhs.handle, nullptr)} {} diff --git a/src/common/dynamic_library.h b/src/common/dynamic_library.h index f42bdf441..662d454d4 100644 --- a/src/common/dynamic_library.h +++ b/src/common/dynamic_library.h @@ -20,6 +20,9 @@ public: /// Automatically loads the specified library. Call IsOpen() to check validity before use. explicit DynamicLibrary(const char* filename); + /// Initializes the dynamic library with an already opened handle. + explicit DynamicLibrary(void* handle_); + /// Moves the library. DynamicLibrary(DynamicLibrary&&) noexcept; DynamicLibrary& operator=(DynamicLibrary&&) noexcept; |