diff --git a/CMakeLists.txt b/CMakeLists.txt index 451e4b62c71..ff8d19447d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,9 @@ if(ENABLE_OPENSSL) target_compile_definitions(kvrocks_objs PUBLIC ENABLE_OPENSSL) endif() if(ENABLE_NEW_ENCODING) - target_compile_definitions(kvrocks_objs PUBLIC ENABLE_NEW_ENCODING) + target_compile_definitions(kvrocks_objs PUBLIC METADATA_ENCODING_VERSION=1) +else() + target_compile_definitions(kvrocks_objs PUBLIC METADATA_ENCODING_VERSION=0) endif() # disable LTO on GCC <= 9 due to an ICE diff --git a/src/storage/redis_metadata.h b/src/storage/redis_metadata.h index d2365b418a7..5407ff80712 100644 --- a/src/storage/redis_metadata.h +++ b/src/storage/redis_metadata.h @@ -29,13 +29,7 @@ #include "encoding.h" #include "types/redis_stream_base.h" -constexpr bool USE_64BIT_COMMON_FIELD_DEFAULT = -#ifdef ENABLE_NEW_ENCODING - true -#else - false -#endif - ; +constexpr bool USE_64BIT_COMMON_FIELD_DEFAULT = METADATA_ENCODING_VERSION != 0; enum RedisType { kRedisNone, diff --git a/tests/cppunit/types/encoding_test.cc b/tests/cppunit/encoding_test.cc similarity index 100% rename from tests/cppunit/types/encoding_test.cc rename to tests/cppunit/encoding_test.cc diff --git a/tests/cppunit/types/metadata_test.cc b/tests/cppunit/metadata_test.cc similarity index 100% rename from tests/cppunit/types/metadata_test.cc rename to tests/cppunit/metadata_test.cc