diff --git a/cache/clock_cache.cc b/cache/clock_cache.cc index 9476dba7a8dae5d4857890999526c470344c0e23..9582910bacb29affd34eed450f310520d951795c 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 1b6273d775847ff002f813e86da7cf6fa4b581c7..62af602c62949d2c40dbccac237e8b9ffc199862 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 0000000000000000000000000000000000000000..9771aacb92956aaf8e5613e730058e2b9aead8a3 --- /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 417fbf4f6114d3288e22961f7ed2934beb0a5675..cdb256a6d656241ae818fb1ebe1060560ac65e00 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 989b5620b9bb23d203fd1842ffeb07213c56f9d1..4d9883b63a7297348ee068e34cc5705105ef73ea 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 76027a9520ff61f0d98973c5600478d4249a8d2e..ca369dcb21462e1feb11e261d32be02e9b7ce026 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 95ee5dfe82e818a855889b0ee14f8e0385d106b1..acab56c215e87a51c1152a39d9a4bc34caf47c27 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 b444a115225642123a5fd543a68a9da597116e64..25174aef84c63cc1e954b91b04095a64a9941db7 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 9675a1e2deab86d7a40adfbf6604af7fd259a7b0..1734269cc9465727f1b1dde8874f2c12a81bc4e6 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 d622e9bba05c1b4c01bcf19dbd1b71041457f207..52469cf9f98761fefd71d328d26f806938e14265 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 94066b29ea447ab28cf5e192f522209d672e42c7..a5b7581538907542c15842d77e192bd3921cb531 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 c94c28dfb2b51cbbd3bdce53654e38277a9745c4..7ac6ee19a1b77c63e3415c6b6eb3b1868be0c7bb 100644 --- a/util/random.cc +++ b/util/random.cc @@ -6,6 +6,7 @@ #include "util/random.h" +#include #include #include