Added closeSharedLibrary().
This commit is contained in:
parent
8b55786e77
commit
232e2a3e28
@ -51,6 +51,16 @@ LibraryHandle openSharedLibrary(std::string_view libraryFile) noexcept
|
||||
#endif
|
||||
}
|
||||
|
||||
bool closeSharedLibrary(const LibraryHandle library) noexcept
|
||||
{
|
||||
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
|
||||
return dlclose(library.data) == 0;
|
||||
#elif MIJIN_TARGET_OS == MIJIN_OS_WINDOWS
|
||||
(void) library;
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void* loadSymbolFromLibrary(const LibraryHandle library, const char* symbolName) noexcept
|
||||
{
|
||||
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
|
||||
|
@ -46,6 +46,7 @@ struct LibraryHandle
|
||||
//
|
||||
|
||||
[[nodiscard]] LibraryHandle openSharedLibrary(std::string_view libraryFile) noexcept;
|
||||
bool closeSharedLibrary(const LibraryHandle library) noexcept;
|
||||
[[nodiscard]] void* loadSymbolFromLibrary(const LibraryHandle library, const char* symbolName) noexcept;
|
||||
void setCurrentThreadName(const char* threadName) noexcept;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user