Added clang-tidy config and cleaned up the code a little.

This commit is contained in:
2024-08-18 13:30:40 +02:00
parent 9f011952c2
commit 6d111904d4
7 changed files with 142 additions and 65 deletions

View File

@@ -51,13 +51,13 @@ Result<LibraryHandle> openSharedLibrary(std::string_view libraryFile) noexcept
{
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
const std::unique_lock dlErrorLock(gDlErrorMutex);
dlerror();
dlerror(); // NOLINT(concurrency-mt-unsafe) we take care of that
const fs::path libraryPath = fs::absolute(libraryFile);
void* ptr = dlopen(libraryPath.c_str(), RTLD_NOW);
if (ptr == nullptr)
{
return ResultError(dlerror());
return ResultError(dlerror()); // NOLINT(concurrency-mt-unsafe) we take care of that
}
return LibraryHandle{.data = dlopen(libraryPath.c_str(), RTLD_NOW)};
#elif MIJIN_TARGET_OS == MIJIN_OS_WINDOWS