Fixed a bunch of clang-tidy warnings.

This commit is contained in:
2024-08-18 13:07:38 +02:00
parent d73fa25ed8
commit 9f011952c2
8 changed files with 46 additions and 39 deletions

View File

@@ -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);