diff --git a/ircd/Makefile.am b/ircd/Makefile.am index 1a629ed34..95211fb66 100644 --- a/ircd/Makefile.am +++ b/ircd/Makefile.am @@ -144,6 +144,7 @@ if LINUX libircd_la_SOURCES += mods_ldso.cc endif libircd_la_SOURCES += db_write_thread.cc +libircd_la_SOURCES += db_crc32.cc libircd_la_SOURCES += db_port.cc libircd_la_SOURCES += db_env.cc libircd_la_SOURCES += db.cc @@ -175,6 +176,9 @@ db_port.lo: AM_CPPFLAGS := ${ROCKSDB_UNIT_CPPFLAGS} ${AM_CPPFLAGS} db_write_thread.lo: AM_CPPFLAGS := ${ROCKSDB_UNIT_CPPFLAGS} ${AM_CPPFLAGS} db_write_thread.lo: AM_CPPFLAGS += -I$(top_srcdir)/deps/rocksdb/include db_write_thread.lo: AM_CPPFLAGS += -I$(top_srcdir)/deps/rocksdb +db_crc32.lo: AM_CPPFLAGS := ${ROCKSDB_UNIT_CPPFLAGS} ${AM_CPPFLAGS} +db_crc32.lo: AM_CPPFLAGS += -I$(top_srcdir)/deps/rocksdb/include +db_crc32.lo: AM_CPPFLAGS += -I$(top_srcdir)/deps/rocksdb fmt.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} fmt.lo: AM_CXXFLAGS := ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} fs.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} diff --git a/ircd/db_crc32.cc b/ircd/db_crc32.cc new file mode 100644 index 000000000..ac8bda48c --- /dev/null +++ b/ircd/db_crc32.cc @@ -0,0 +1,26 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2019 Jason Volk +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice is present in all copies. The +// full license for this software is available in the LICENSE file. + +#if __has_include("table/block_fetcher.h") + #define ROCKSDB_PLATFORM_POSIX + #define ZSTD_VERSION_NUMBER 0 + #include "table/block_fetcher.h" + //#define IRCD_DB_BYPASS_CHECKSUM +#else + #warning "The RocksDB source code is not available. Cannot interpose bugfixes for db/.h." +#endif + +#if defined(IRCD_DB_BYPASS_CHECKSUM) +void +rocksdb::BlockFetcher::CheckBlockChecksum() +{ + //assert(0); +} +#endif