Fixed a bunch of clang-tidy warnings.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <filesystem>
|
||||
|
||||
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
|
||||
#include <mutex>
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
#elif MIJIN_TARGET_OS == MIJIN_OS_WINDOWS
|
||||
@@ -31,6 +32,13 @@ namespace mijin
|
||||
// internal variables
|
||||
//
|
||||
|
||||
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
|
||||
namespace
|
||||
{
|
||||
std::mutex gDlErrorMutex; // dlerror may not be thread-safe
|
||||
}
|
||||
#endif // MIJIN_TARGET_OS == MIJIN_OS_LINUX
|
||||
|
||||
//
|
||||
// internal functions
|
||||
//
|
||||
@@ -42,6 +50,7 @@ namespace mijin
|
||||
Result<LibraryHandle> openSharedLibrary(std::string_view libraryFile) noexcept
|
||||
{
|
||||
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
|
||||
const std::unique_lock dlErrorLock(gDlErrorMutex);
|
||||
dlerror();
|
||||
|
||||
const fs::path libraryPath = fs::absolute(libraryFile);
|
||||
|
||||
Reference in New Issue
Block a user