diff --git a/cache/clock_cache.cc b/cache/clock_cache.cc index 9476dba7a..9582910ba 100644 --- a/cache/clock_cache.cc +++ b/cache/clock_cache.cc @@ -9,7 +9,6 @@ #include "cache/clock_cache.h" -#include #include #include @@ -18,6 +17,7 @@ #include "monitoring/perf_context_imp.h" #include "monitoring/statistics.h" #include "port/lang.h" +#include "rocksdb/env.h" #include "util/hash.h" #include "util/math.h" #include "util/random.h" diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index 1b6273d77..62af602c6 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -27,6 +27,7 @@ #include "rocksdb/customizable.h" #include "rocksdb/functor_wrapper.h" +#include "rocksdb/port_defs.h" #include "rocksdb/status.h" #include "rocksdb/thread_status.h" @@ -69,13 +70,6 @@ struct ConfigOptions; const size_t kDefaultPageSize = 4 * 1024; -enum class CpuPriority { - kIdle = 0, - kLow = 1, - kNormal = 2, - kHigh = 3, -}; - // Options while opening a file to read/write struct EnvOptions { // Construct with default Options diff --git a/include/rocksdb/port_defs.h b/include/rocksdb/port_defs.h new file mode 100644 index 000000000..9771aacb9 --- /dev/null +++ b/include/rocksdb/port_defs.h @@ -0,0 +1,22 @@ +// Copyright (c) Meta Platforms, Inc. and affiliates. +// This source code is licensed under both the GPLv2 (found in the +// COPYING file in the root directory) and Apache 2.0 License +// (found in the LICENSE.Apache file in the root directory). +// +// This file includes the common definitions used in the port/, +// the public API (this directory), and other directories + +#pragma once + +#include "rocksdb/rocksdb_namespace.h" + +namespace ROCKSDB_NAMESPACE { + +enum class CpuPriority { + kIdle = 0, + kLow = 1, + kNormal = 2, + kHigh = 3, +}; + +} // namespace ROCKSDB_NAMESPACE diff --git a/port/port_posix.h b/port/port_posix.h index 417fbf4f6..cdb256a6d 100644 --- a/port/port_posix.h +++ b/port/port_posix.h @@ -13,7 +13,7 @@ #include -#include "rocksdb/options.h" +#include "rocksdb/port_defs.h" #include "rocksdb/rocksdb_namespace.h" // size_t printf formatting named in the manner of C99 standard formatting diff --git a/port/win/port_win.h b/port/win/port_win.h index 989b5620b..4d9883b63 100644 --- a/port/win/port_win.h +++ b/port/win/port_win.h @@ -17,21 +17,22 @@ #endif #include -#include -#include -#include -#include -#include -#include -#include +//^^ should be included first before other system lib #include +#include #include - #include +#include -#include "port/win/win_thread.h" +#include +#include +#include +#include +#include +#include -#include "rocksdb/options.h" +#include "port/win/win_thread.h" +#include "rocksdb/port_defs.h" #undef min #undef max diff --git a/table/multiget_context.h b/table/multiget_context.h index 76027a952..ca369dcb2 100644 --- a/table/multiget_context.h +++ b/table/multiget_context.h @@ -12,6 +12,7 @@ #include "db/lookup_key.h" #include "db/merge_context.h" #include "rocksdb/env.h" +#include "rocksdb/options.h" #include "rocksdb/statistics.h" #include "rocksdb/types.h" #include "util/async_file_reader.h" diff --git a/util/aligned_buffer.h b/util/aligned_buffer.h index 95ee5dfe8..acab56c21 100644 --- a/util/aligned_buffer.h +++ b/util/aligned_buffer.h @@ -9,6 +9,7 @@ #pragma once #include +#include #include "port/port.h" diff --git a/util/core_local.h b/util/core_local.h index b444a1152..25174aef8 100644 --- a/util/core_local.h +++ b/util/core_local.h @@ -5,6 +5,7 @@ #pragma once +#include #include #include #include diff --git a/util/distributed_mutex.h b/util/distributed_mutex.h index 9675a1e2d..1734269cc 100644 --- a/util/distributed_mutex.h +++ b/util/distributed_mutex.h @@ -36,6 +36,8 @@ using DMutexLock = std::lock_guard; #else +#include + #include "port/port.h" namespace ROCKSDB_NAMESPACE { diff --git a/util/file_checksum_helper.h b/util/file_checksum_helper.h index d622e9bba..52469cf9f 100644 --- a/util/file_checksum_helper.h +++ b/util/file_checksum_helper.h @@ -8,6 +8,7 @@ #include #include "port/port.h" +#include "rocksdb/env.h" #include "rocksdb/file_checksum.h" #include "rocksdb/status.h" #include "util/coding.h" diff --git a/util/mutexlock.h b/util/mutexlock.h index 94066b29e..a5b758153 100644 --- a/util/mutexlock.h +++ b/util/mutexlock.h @@ -11,6 +11,7 @@ #include #include +#include #include #include diff --git a/util/random.cc b/util/random.cc index c94c28dfb..7ac6ee19a 100644 --- a/util/random.cc +++ b/util/random.cc @@ -6,6 +6,7 @@ #include "util/random.h" +#include #include #include