Update to LibConf system, added loading of dynamic libraries (only Linux for now) and some more fixes.

This commit is contained in:
2023-05-31 23:41:22 +02:00
parent da781b87f2
commit 920e83d4da
7 changed files with 106 additions and 52 deletions

View File

@@ -4,6 +4,9 @@
#if !defined(MIJIN_UTIL_OS_HPP_INCLUDED)
#define MIJIN_UTIL_OS_HPP_INCLUDED 1
#include <string>
#include <string_view>
namespace mijin
{
@@ -19,11 +22,23 @@ namespace mijin
// public types
//
struct LibraryHandle
{
void* data = nullptr;
constexpr operator bool() const noexcept { return data != nullptr; }
constexpr bool operator!() const noexcept { return data == nullptr; }
};
//
// public functions
//
void setCurrentThreadName(const char* threadName);
[[nodiscard]] LibraryHandle openSharedLibrary(std::string_view libraryFile) noexcept;
[[nodiscard]] void* loadSymbolFromLibrary(const LibraryHandle library, const char* symbolName) noexcept;
void setCurrentThreadName(const char* threadName) noexcept;
[[nodiscard]] std::string makeLibraryFilename(std::string_view libraryName) noexcept;
} // namespace mijin