From 6ea6a003dc3b55bd9022ab7de2ab81e7217cd61f Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 15 Sep 2021 01:42:21 -0700 Subject: [PATCH] ircd::db: ABI fixes for RocksDB v6.19+. --- ircd/db.cc | 11 ++++++++--- ircd/db_has.h | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ircd/db.cc b/ircd/db.cc index d426d2f2d..fbc1d5ab5 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -33,11 +33,11 @@ ircd::db::version_api } }; +#ifndef IRCD_DB_HAS_VERSION_ABI extern "C" const char * -rocksdb_build_git_sha; - -extern "C" const char * +rocksdb_build_git_sha, rocksdb_build_compile_date; +#endif decltype(ircd::db::version_abi) ircd::db::version_abi @@ -47,9 +47,14 @@ ircd::db::version_abi { fmt::sprintf { + #ifdef IRCD_DB_HAS_VERSION_ABI + buf, "%s", + rocksdb::GetRocksVersionAsString(true), + #else buf, "%s (%s)", lstrip(rocksdb_build_git_sha, "rocksdb_build_git_sha:"), rocksdb_build_compile_date, + #endif }; } }; diff --git a/ircd/db_has.h b/ircd/db_has.h index 30b15a518..4155bba91 100644 --- a/ircd/db_has.h +++ b/ircd/db_has.h @@ -73,6 +73,12 @@ #define IRCD_DB_HAS_MULTIGET_DIRECT #endif +#if ROCKSDB_MAJOR > 6 \ +|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 19) \ +|| (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 19 && ROCKSDB_PATCH >= 3) + #define IRCD_DB_HAS_VERSION_ABI +#endif + #if ROCKSDB_MAJOR > 6 \ || (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR > 22) \ || (ROCKSDB_MAJOR == 6 && ROCKSDB_MINOR == 22 && ROCKSDB_PATCH >= 1)