diff --git a/CMakeLists.txt b/CMakeLists.txt index c4416025f..a68b16056 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,20 +129,19 @@ endif() string(REGEX REPLACE "[^0-9a-f]+" "" GIT_SHA "${GIT_SHA}") -if(NOT WIN32) - execute_process(COMMAND - "./build_tools/version.sh" "full" - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE ROCKSDB_VERSION - ) - string(STRIP "${ROCKSDB_VERSION}" ROCKSDB_VERSION) - execute_process(COMMAND - "./build_tools/version.sh" "major" - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE ROCKSDB_VERSION_MAJOR - ) - string(STRIP "${ROCKSDB_VERSION_MAJOR}" ROCKSDB_VERSION_MAJOR) -endif() +set(SH_CMD "sh") +execute_process(COMMAND + ${SH_CMD} -c "build_tools/version.sh full" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE ROCKSDB_VERSION +) +string(STRIP "${ROCKSDB_VERSION}" ROCKSDB_VERSION) +execute_process(COMMAND + ${SH_CMD} -c "build_tools/version.sh major" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE ROCKSDB_VERSION_MAJOR +) +string(STRIP "${ROCKSDB_VERSION_MAJOR}" ROCKSDB_VERSION_MAJOR) option(WITH_MD_LIBRARY "build with MD" ON) if(WIN32 AND MSVC) diff --git a/db/memtable.cc b/db/memtable.cc index af3ae8f83..66bf55920 100644 --- a/db/memtable.cc +++ b/db/memtable.cc @@ -236,6 +236,14 @@ int MemTable::KeyComparator::operator()(const char* prefix_len_key, return comparator.Compare(a, key); } +void MemTableRep::InsertConcurrently(KeyHandle handle) { +#ifndef ROCKSDB_LITE + throw std::runtime_error("concurrent insert not supported"); +#else + abort(); +#endif + } + Slice MemTableRep::UserKey(const char* key) const { Slice slice = GetLengthPrefixedSlice(key); return Slice(slice.data(), slice.size() - 8); diff --git a/include/rocksdb/memtablerep.h b/include/rocksdb/memtablerep.h index 347dd3096..1385a83cb 100644 --- a/include/rocksdb/memtablerep.h +++ b/include/rocksdb/memtablerep.h @@ -96,13 +96,7 @@ class MemTableRep { // Like Insert(handle), but may be called concurrent with other calls // to InsertConcurrently for other handles - virtual void InsertConcurrently(KeyHandle handle) { -#ifndef ROCKSDB_LITE - throw std::runtime_error("concurrent insert not supported"); -#else - abort(); -#endif - } + virtual void InsertConcurrently(KeyHandle handle); // Returns true iff an entry that compares equal to key is in the collection. virtual bool Contains(const char* key) const = 0;