From d14d613f0108a2aac0860fbdedba7102e89ddf7a Mon Sep 17 00:00:00 2001 From: Liss Heidrich <31625940+liss-h@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:59:27 +0100 Subject: [PATCH] commit to newer metall versions --- src/dice/ffi/metall.h | 21 ------------------- src/dice/ffi/metall_internal.hpp | 35 ++------------------------------ 2 files changed, 2 insertions(+), 54 deletions(-) diff --git a/src/dice/ffi/metall.h b/src/dice/ffi/metall.h index 67cf2b6..fc12750 100644 --- a/src/dice/ffi/metall.h +++ b/src/dice/ffi/metall.h @@ -3,33 +3,12 @@ #include #include - -#if __has_include() #include -#endif #ifdef __cplusplus extern "C" { #endif -#if !__has_include() -/// \brief Log message level -typedef enum metall_log_level { - /// \brief Critical logger message - metall_critical = 5, - /// \brief Error logger message - metall_error = 4, - /// \brief Warning logger message - metall_warning = 3, - /// \brief Info logger message - metall_info = 2, - /// \brief Debug logger message - metall_debug = 1, - /// \brief Verbose (lowest priority) logger message - metall_verbose = 0, -} metall_log_level; -#endif - typedef struct metall_manager metall_manager; diff --git a/src/dice/ffi/metall_internal.hpp b/src/dice/ffi/metall_internal.hpp index 38925a9..c30da48 100644 --- a/src/dice/ffi/metall_internal.hpp +++ b/src/dice/ffi/metall_internal.hpp @@ -5,42 +5,11 @@ #include namespace dice::metall_ffi::internal { -#if METALL_VERSION >= 2800 - /** - * @brief The metall manager type used internally. - * This object type is whats actually behind the opaque ::metall_manager * in the interface - */ - using metall_manager = metall::manager; -#else - /** * @brief The metall manager type used internally. - * This object type is whats actually behind the opaque ::metall_manager * in the interface. - * This is a wrapper that contains the read_only flag for older versions that do not support read_only() yet. + * This object type is whats actually behind the opaque ::metall_manager * in the interface */ - struct metall_manager : metall::manager { - bool read_only_; - - template - using allocator_type = typename metall::manager::template allocator_type; - - metall_manager(metall::create_only_t op, char const *path) : metall::manager{op, path}, - read_only_{false} { - } - - metall_manager(metall::open_only_t op, char const *path) : metall::manager{op, path}, - read_only_{false} { - } - - metall_manager(metall::open_read_only_t op, char const *path) : metall::manager{op, path}, - read_only_{true} { - } - - [[nodiscard]] bool read_only() const noexcept { - return read_only_; - } - }; -#endif + using metall_manager = metall::manager; } // namespace #endif//DICE_METALLFFI_METALLINTERNAL_HPP