From e1d92dfd2eb4bf00cea08ebe0f539eb11ff394fd Mon Sep 17 00:00:00 2001 From: kailiu Date: Wed, 4 Dec 2013 23:00:33 -0800 Subject: [PATCH] Fix a bunch of mac compilation issues in performance branch --- table/plain_table_builder.cc | 3 +-- table/plain_table_builder.h | 1 - table/plain_table_reader.cc | 3 ++- util/env_posix.cc | 4 +++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/table/plain_table_builder.cc b/table/plain_table_builder.cc index 5a6e41df6..30d7e7d6e 100644 --- a/table/plain_table_builder.cc +++ b/table/plain_table_builder.cc @@ -23,8 +23,7 @@ namespace rocksdb { PlainTableBuilder::PlainTableBuilder(const Options& options, WritableFile* file, int user_key_size, int key_prefix_len) : - options_(options), file_(file), user_key_size_(user_key_size), - key_prefix_len_(key_prefix_len) { + options_(options), file_(file), user_key_size_(user_key_size) { std::string version; PutFixed32(&version, 1 | 0x80000000); file_->Append(Slice(version)); diff --git a/table/plain_table_builder.h b/table/plain_table_builder.h index b48552efc..a994b337c 100644 --- a/table/plain_table_builder.h +++ b/table/plain_table_builder.h @@ -75,7 +75,6 @@ private: uint64_t num_entries_ = 0; const size_t user_key_size_; - const size_t key_prefix_len_; bool closed_ = false; // Either Finish() or Abandon() has been called. int GetInternalKeyLength() { diff --git a/table/plain_table_reader.cc b/table/plain_table_reader.cc index e7f48df33..cccaf61c9 100644 --- a/table/plain_table_reader.cc +++ b/table/plain_table_reader.cc @@ -40,7 +40,8 @@ public: class slice_comparator { public: - bool operator()(rocksdb::Slice const& s1, rocksdb::Slice const& s2) { + bool operator()(rocksdb::Slice const& s1, + rocksdb::Slice const& s2) const { return s1.compare(s2) < 0; } }; diff --git a/util/env_posix.cc b/util/env_posix.cc index 28901be3f..1ed8d6960 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -1404,11 +1404,13 @@ class PosixEnv : public Env { (unsigned long)t); // Set the thread name to aid debugging -#if defined(_GNU_SOURCE) && defined(__GLIBC_PREREQ) && (__GLIBC_PREREQ(2, 12)) +#if defined(_GNU_SOURCE) && defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 12) char name_buf[16]; snprintf(name_buf, sizeof name_buf, "rocksdb:bg%zu", bgthreads_.size()); name_buf[sizeof name_buf - 1] = '\0'; pthread_setname_np(t, name_buf); +#endif #endif bgthreads_.push_back(t);