Added support for completely disabling noexcept using MIJIN_TEST_NO_NOEXCEPT (for testing).

This commit is contained in:
2024-08-29 00:01:23 +02:00
parent a43f92fb58
commit 9ba097fc2f
41 changed files with 643 additions and 564 deletions

View File

@@ -47,7 +47,7 @@ std::mutex gDlErrorMutex; // dlerror may not be thread-safe
// public functions
//
Result<LibraryHandle> openSharedLibrary(std::string_view libraryFile) noexcept
Result<LibraryHandle> openSharedLibrary(std::string_view libraryFile) MIJIN_NOEXCEPT
{
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
const std::unique_lock dlErrorLock(gDlErrorMutex);
@@ -67,7 +67,7 @@ Result<LibraryHandle> openSharedLibrary(std::string_view libraryFile) noexcept
#endif
}
bool closeSharedLibrary(const LibraryHandle library) noexcept
bool closeSharedLibrary(const LibraryHandle library) MIJIN_NOEXCEPT
{
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
return dlclose(library.data) == 0;
@@ -77,7 +77,7 @@ bool closeSharedLibrary(const LibraryHandle library) noexcept
#endif
}
void* loadSymbolFromLibrary(const LibraryHandle library, const char* symbolName) noexcept
void* loadSymbolFromLibrary(const LibraryHandle library, const char* symbolName) MIJIN_NOEXCEPT
{
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
return dlsym(library.data, symbolName);
@@ -88,7 +88,7 @@ void* loadSymbolFromLibrary(const LibraryHandle library, const char* symbolName)
#endif
}
void setCurrentThreadName(const char* threadName) noexcept
void setCurrentThreadName(const char* threadName) MIJIN_NOEXCEPT
{
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
pthread_setname_np(pthread_self(), threadName);
@@ -97,7 +97,7 @@ void setCurrentThreadName(const char* threadName) noexcept
#endif
}
[[nodiscard]] std::string makeLibraryFilename(std::string_view libraryName) noexcept
[[nodiscard]] std::string makeLibraryFilename(std::string_view libraryName) MIJIN_NOEXCEPT
{
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX
return "lib" + std::string(libraryName) + ".so";