From 816c1e30ca73615c75fc208ddcc4b05012b30951 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 16 Dec 2016 11:17:26 -0800 Subject: [PATCH] gcc-7 requires include for std::function Summary: Fixes compile error: In file included from ./util/statistics.h:17:0, from ./util/stop_watch.h:8, from ./util/perf_step_timer.h:9, from ./util/iostats_context_imp.h:8, from ./util/posix_logger.h:27, from ./port/util_logger.h:18, from ./db/auto_roll_logger.h:15, from db/auto_roll_logger.cc:6: ./util/thread_local.h:65:16: error: 'function' in namespace 'std' does not name a template type typedef std::function FoldFunc; Closes https://github.com/facebook/rocksdb/pull/1656 Differential Revision: D4318702 Pulled By: yiwu-arbug fbshipit-source-id: 8c5d17a --- db/db_iterator_test.cc | 2 ++ db/external_sst_file_test.cc | 2 ++ db/file_indexer.cc | 3 ++- db/version_builder.cc | 1 + db/write_callback_test.cc | 1 + include/rocksdb/env.h | 1 + java/rocksjni/portal.h | 1 + java/rocksjni/rocksjni.cc | 3 ++- tools/ldb_cmd.cc | 3 ++- util/dynamic_bloom_test.cc | 3 ++- util/fault_injection_test_env.cc | 1 + util/sync_point.cc | 1 + util/sync_point.h | 1 + util/thread_local.h | 1 + util/xfunc.h | 1 + utilities/backupable/backupable_db.cc | 1 + utilities/persistent_cache/block_cache_tier_file.cc | 1 + utilities/persistent_cache/hash_table_evictable.h | 2 ++ utilities/transactions/optimistic_transaction_test.cc | 1 + utilities/transactions/transaction_test.cc | 1 + 20 files changed, 27 insertions(+), 4 deletions(-) diff --git a/db/db_iterator_test.cc b/db/db_iterator_test.cc index 5292e9377..2eee94459 100644 --- a/db/db_iterator_test.cc +++ b/db/db_iterator_test.cc @@ -7,6 +7,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. +#include + #include "db/db_test_util.h" #include "port/port.h" #include "port/stack_trace.h" diff --git a/db/external_sst_file_test.cc b/db/external_sst_file_test.cc index 731282b5e..458f26a0c 100644 --- a/db/external_sst_file_test.cc +++ b/db/external_sst_file_test.cc @@ -3,6 +3,8 @@ // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. +#include + #include "db/db_test_util.h" #include "port/port.h" #include "port/stack_trace.h" diff --git a/db/file_indexer.cc b/db/file_indexer.cc index 9b31c2bd6..bce0e96fb 100644 --- a/db/file_indexer.cc +++ b/db/file_indexer.cc @@ -9,8 +9,9 @@ #include "db/file_indexer.h" #include -#include "rocksdb/comparator.h" +#include #include "db/version_edit.h" +#include "rocksdb/comparator.h" namespace rocksdb { diff --git a/db/version_builder.cc b/db/version_builder.cc index 7add24fa5..09b449a58 100644 --- a/db/version_builder.cc +++ b/db/version_builder.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/db/write_callback_test.cc b/db/write_callback_test.cc index 33aaab7f4..8e167b4ba 100644 --- a/db/write_callback_test.cc +++ b/db/write_callback_test.cc @@ -5,6 +5,7 @@ #ifndef ROCKSDB_LITE +#include #include #include #include diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index 87e375aaa..e24c15d83 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/java/rocksjni/portal.h b/java/rocksjni/portal.h index d075a1507..dc6dcf507 100644 --- a/java/rocksjni/portal.h +++ b/java/rocksjni/portal.h @@ -11,6 +11,7 @@ #define JAVA_ROCKSJNI_PORTAL_H_ #include +#include #include #include #include diff --git a/java/rocksjni/rocksjni.cc b/java/rocksjni/rocksjni.cc index b86cf63f0..4c5d2b8ae 100644 --- a/java/rocksjni/rocksjni.cc +++ b/java/rocksjni/rocksjni.cc @@ -9,11 +9,12 @@ #include #include #include +#include +#include #include #include #include #include -#include #include "include/org_rocksdb_RocksDB.h" #include "rocksdb/cache.h" diff --git a/tools/ldb_cmd.cc b/tools/ldb_cmd.cc index eed8f2099..a39dfc496 100644 --- a/tools/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -34,12 +34,13 @@ #include #include +#include +#include #include #include #include #include #include -#include namespace rocksdb { diff --git a/util/dynamic_bloom_test.cc b/util/dynamic_bloom_test.cc index 5b8ec7493..fcce2a6d7 100644 --- a/util/dynamic_bloom_test.cc +++ b/util/dynamic_bloom_test.cc @@ -15,13 +15,14 @@ int main() { #define __STDC_FORMAT_MACROS #endif +#include #include #include #include +#include #include #include #include -#include #include "dynamic_bloom.h" #include "port/port.h" diff --git a/util/fault_injection_test_env.cc b/util/fault_injection_test_env.cc index 9898a0d3c..e0a39c5c7 100644 --- a/util/fault_injection_test_env.cc +++ b/util/fault_injection_test_env.cc @@ -12,6 +12,7 @@ // file data (or entire files) not protected by a "sync". #include "util/fault_injection_test_env.h" +#include #include namespace rocksdb { diff --git a/util/sync_point.cc b/util/sync_point.cc index 5f3a726ae..307cde767 100644 --- a/util/sync_point.cc +++ b/util/sync_point.cc @@ -4,6 +4,7 @@ // of patent rights can be found in the PATENTS file in the same directory. #include "util/sync_point.h" +#include #include #include "port/port.h" #include "util/random.h" diff --git a/util/sync_point.h b/util/sync_point.h index 0201ec72b..9b3b7533d 100644 --- a/util/sync_point.h +++ b/util/sync_point.h @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/util/thread_local.h b/util/thread_local.h index 7d762a888..3777ad60d 100644 --- a/util/thread_local.h +++ b/util/thread_local.h @@ -10,6 +10,7 @@ #pragma once #include +#include #include #include #include diff --git a/util/xfunc.h b/util/xfunc.h index e19a03f1c..e300f580c 100644 --- a/util/xfunc.h +++ b/util/xfunc.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include "rocksdb/options.h" diff --git a/utilities/backupable/backupable_db.cc b/utilities/backupable/backupable_db.cc index d6d9feded..139b44c3d 100644 --- a/utilities/backupable/backupable_db.cc +++ b/utilities/backupable/backupable_db.cc @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/utilities/persistent_cache/block_cache_tier_file.cc b/utilities/persistent_cache/block_cache_tier_file.cc index a24321bd2..be847cc34 100644 --- a/utilities/persistent_cache/block_cache_tier_file.cc +++ b/utilities/persistent_cache/block_cache_tier_file.cc @@ -9,6 +9,7 @@ #ifndef OS_WIN #include #endif +#include #include #include diff --git a/utilities/persistent_cache/hash_table_evictable.h b/utilities/persistent_cache/hash_table_evictable.h index da13c0e9d..0b68385de 100644 --- a/utilities/persistent_cache/hash_table_evictable.h +++ b/utilities/persistent_cache/hash_table_evictable.h @@ -7,6 +7,8 @@ #ifndef ROCKSDB_LITE +#include + #include "util/random.h" #include "utilities/persistent_cache/hash_table.h" #include "utilities/persistent_cache/lrulist.h" diff --git a/utilities/transactions/optimistic_transaction_test.cc b/utilities/transactions/optimistic_transaction_test.cc index 0b540471d..4842b7aac 100644 --- a/utilities/transactions/optimistic_transaction_test.cc +++ b/utilities/transactions/optimistic_transaction_test.cc @@ -5,6 +5,7 @@ #ifndef ROCKSDB_LITE +#include #include #include diff --git a/utilities/transactions/transaction_test.cc b/utilities/transactions/transaction_test.cc index 349e5a5f0..41b624114 100644 --- a/utilities/transactions/transaction_test.cc +++ b/utilities/transactions/transaction_test.cc @@ -6,6 +6,7 @@ #ifndef ROCKSDB_LITE #include +#include #include #include