Fix public API dependency on internal codes and dependency on MAX_INT32

Summary:
Public API depends on port/port.h which is wrong. Fix it.
Also with gcc 4.8.1 build was broken as MAX_INT32 was not recognized. Fix it by using ::max in linux.

Test Plan: Build it and try to build an external project on top of it.

Reviewers: anthony, yhchiang, kradhakrishnan, igor

Reviewed By: igor

Subscribers: yoshinorim, leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D41745
main
sdong 9 years ago
parent 5fd11853cb
commit 76d3cd3286
  1. 2
      db/db_impl.h
  2. 2
      db/file_indexer.h
  3. 2
      db/write_thread.h
  4. 1
      include/rocksdb/db.h
  5. 1
      include/rocksdb/env.h
  6. 1
      include/rocksdb/perf_context.h
  7. 3
      port/port_posix.h
  8. 3
      port/win/port_win.h
  9. 3
      table/cuckoo_table_builder.h
  10. 1
      util/mutable_cf_options.cc

@ -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_;

@ -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:

@ -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;

@ -23,7 +23,6 @@
#include "rocksdb/transaction_log.h"
#include "rocksdb/listener.h"
#include "rocksdb/thread_status.h"
#include "port/port.h"
namespace rocksdb {

@ -25,7 +25,6 @@
#include <vector>
#include "rocksdb/status.h"
#include "rocksdb/thread_status.h"
#include "port/port.h"
#ifdef GetCurrentTime
#undef GetCurrentTime

@ -10,7 +10,6 @@
#include <string>
#include "rocksdb/perf_level.h"
#include "port/port.h"
namespace rocksdb {

@ -77,7 +77,8 @@ namespace rocksdb {
namespace port {
// For use at db/file_indexer.h kLevelMaxIndex
const int LevelMaxIndex = std::numeric_limits<int32_t>::max();
const int kMaxInt32 = std::numeric_limits<int32_t>::max();
const uint64_t kMaxUint64 = std::numeric_limits<uint64_t>::max();
static const bool kLittleEndian = PLATFORM_IS_LITTLE_ENDIAN;
#undef PLATFORM_IS_LITTLE_ENDIAN

@ -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;

@ -10,6 +10,7 @@
#include <string>
#include <utility>
#include <vector>
#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<uint64_t>& hash_vals,
const uint32_t call_id,

@ -11,6 +11,7 @@
#include <limits>
#include <cassert>
#include <string>
#include "port/port.h"
#include "rocksdb/env.h"
#include "rocksdb/options.h"
#include "rocksdb/immutable_options.h"

Loading…
Cancel
Save