diff --git a/db/db_impl.h b/db/db_impl.h index f065a70f9..711211fa6 100644 --- a/db/db_impl.h +++ b/db/db_impl.h @@ -684,7 +684,7 @@ class DBImpl : public DB { static const int KEEP_LOG_FILE_NUM = 1000; // MSVC version 1800 still does not have constexpr for ::max() - static const uint64_t kNoTimeOut = UINT64_MAX; + static const uint64_t kNoTimeOut = port::kMaxUint64; std::string db_absolute_path_; diff --git a/db/file_indexer.h b/db/file_indexer.h index 617634192..3a335bec5 100644 --- a/db/file_indexer.h +++ b/db/file_indexer.h @@ -60,7 +60,7 @@ class FileIndexer { enum { // MSVC version 1800 still does not have constexpr for ::max() - kLevelMaxIndex = rocksdb::port::LevelMaxIndex + kLevelMaxIndex = rocksdb::port::kMaxInt32 }; private: diff --git a/db/write_thread.h b/db/write_thread.h index 28864eba2..31870d9e1 100644 --- a/db/write_thread.h +++ b/db/write_thread.h @@ -18,7 +18,7 @@ namespace rocksdb { class WriteThread { public: - static const uint64_t kNoTimeOut = UINT64_MAX; + static const uint64_t kNoTimeOut = port::kMaxUint64; // Information kept for every waiting writer struct Writer { Status status; diff --git a/include/rocksdb/db.h b/include/rocksdb/db.h index d6a244ab0..e006fcc52 100644 --- a/include/rocksdb/db.h +++ b/include/rocksdb/db.h @@ -23,7 +23,6 @@ #include "rocksdb/transaction_log.h" #include "rocksdb/listener.h" #include "rocksdb/thread_status.h" -#include "port/port.h" namespace rocksdb { diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index bcbb5a3a8..fedfa8b56 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -25,7 +25,6 @@ #include #include "rocksdb/status.h" #include "rocksdb/thread_status.h" -#include "port/port.h" #ifdef GetCurrentTime #undef GetCurrentTime diff --git a/include/rocksdb/perf_context.h b/include/rocksdb/perf_context.h index 126d16572..bdef04778 100644 --- a/include/rocksdb/perf_context.h +++ b/include/rocksdb/perf_context.h @@ -10,7 +10,6 @@ #include #include "rocksdb/perf_level.h" -#include "port/port.h" namespace rocksdb { diff --git a/port/port_posix.h b/port/port_posix.h index 75ae996c0..ce3387795 100644 --- a/port/port_posix.h +++ b/port/port_posix.h @@ -77,7 +77,8 @@ namespace rocksdb { namespace port { // For use at db/file_indexer.h kLevelMaxIndex -const int LevelMaxIndex = std::numeric_limits::max(); +const int kMaxInt32 = std::numeric_limits::max(); +const uint64_t kMaxUint64 = std::numeric_limits::max(); static const bool kLittleEndian = PLATFORM_IS_LITTLE_ENDIAN; #undef PLATFORM_IS_LITTLE_ENDIAN diff --git a/port/win/port_win.h b/port/win/port_win.h index 6e1a40bcd..f9f7fc613 100644 --- a/port/win/port_win.h +++ b/port/win/port_win.h @@ -81,7 +81,8 @@ namespace port { // For use at db/file_indexer.h kLevelMaxIndex -const int LevelMaxIndex = INT32_MAX; +const int kMaxInt32 = INT32_MAX; +const uint64_t kMaxUint64 = UINT64_MAX; const bool kLittleEndian = true; diff --git a/table/cuckoo_table_builder.h b/table/cuckoo_table_builder.h index 7871833d4..913d50503 100644 --- a/table/cuckoo_table_builder.h +++ b/table/cuckoo_table_builder.h @@ -10,6 +10,7 @@ #include #include #include +#include "port/port.h" #include "rocksdb/status.h" #include "table/table_builder.h" #include "rocksdb/table.h" @@ -68,7 +69,7 @@ class CuckooTableBuilder: public TableBuilder { // We assume number of items is <= 2^32. uint32_t make_space_for_key_call_id; }; - static const uint32_t kMaxVectorIdx = INT32_MAX; + static const uint32_t kMaxVectorIdx = port::kMaxInt32; bool MakeSpaceForKey(const autovector& hash_vals, const uint32_t call_id, diff --git a/util/mutable_cf_options.cc b/util/mutable_cf_options.cc index 93ed33443..887db4001 100644 --- a/util/mutable_cf_options.cc +++ b/util/mutable_cf_options.cc @@ -11,6 +11,7 @@ #include #include #include +#include "port/port.h" #include "rocksdb/env.h" #include "rocksdb/options.h" #include "rocksdb/immutable_options.h"