From eb4a10e18e7a32d272b5fea30c018b7370b79d32 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Sat, 31 Aug 2019 14:48:02 +0200 Subject: [PATCH] added missing file + code cleanup --- contrib/db/libmdbx/CMakeLists.txt | 8 -------- src/common/db_backend_selector.h | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 src/common/db_backend_selector.h diff --git a/contrib/db/libmdbx/CMakeLists.txt b/contrib/db/libmdbx/CMakeLists.txt index 1b19c0f4..0a1d1044 100644 --- a/contrib/db/libmdbx/CMakeLists.txt +++ b/contrib/db/libmdbx/CMakeLists.txt @@ -14,14 +14,6 @@ endif() include_directories("${CMAKE_CURRENT_SOURCE_DIR}") -if(NOT MSVC) - # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers -Wno-missing-braces -Wno-aggregate-return") -endif() - -if(FREEBSD) - # add_definitions(-DMDB_DSYNC=O_SYNC) -endif() - add_library(mdbx ${mdbx_sources}) target_link_libraries(mdbx PRIVATE ${CMAKE_THREAD_LIBS_INIT}) diff --git a/src/common/db_backend_selector.h b/src/common/db_backend_selector.h new file mode 100644 index 00000000..e2f37bb0 --- /dev/null +++ b/src/common/db_backend_selector.h @@ -0,0 +1,21 @@ +// Copyright (c) 2014-2019 Zano Project +// Copyright (c) 2014-2018 The Louisdor Project +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#pragma once + +#include "db_backend_lmdb.h" +#include "db_backend_mdbx.h" + +namespace tools +{ + namespace db + { +#ifdef DB_ENGINE_LMDB + typedef lmdb_db_backend default_db_backend; +#elif DB_ENGINE_MDBX + typedef mdbx_db_backend default_db_backend; +#endif + } +} \ No newline at end of file