From 5e37bbf924821d65020db2eb2221bc668388ac0f Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Mon, 15 Oct 2018 20:07:07 -0700 Subject: [PATCH] Removed unnecessary includes from stubs/common.h --- .../protobuf/compiler/python/python_generator.h | 1 + src/google/protobuf/stubs/bytestream.cc | 2 ++ src/google/protobuf/stubs/common.cc | 15 ++++++++++----- src/google/protobuf/stubs/common.h | 5 ----- src/google/protobuf/stubs/common_unittest.cc | 2 ++ src/google/protobuf/stubs/int128.cc | 2 ++ src/google/protobuf/stubs/statusor.cc | 2 ++ src/google/protobuf/stubs/stringpiece.cc | 2 ++ src/google/protobuf/stubs/stringprintf.cc | 2 ++ src/google/protobuf/stubs/strutil.cc | 1 + src/google/protobuf/stubs/substitute.cc | 2 ++ src/google/protobuf/testing/file.cc | 1 + src/google/protobuf/testing/googletest.h | 1 + src/google/protobuf/util/internal/datapiece.h | 1 + .../protobuf/util/internal/field_mask_utility.h | 1 + 15 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/google/protobuf/compiler/python/python_generator.h b/src/google/protobuf/compiler/python/python_generator.h index c21c36da38..e90ff74736 100644 --- a/src/google/protobuf/compiler/python/python_generator.h +++ b/src/google/protobuf/compiler/python/python_generator.h @@ -38,6 +38,7 @@ #include #include +#include #include diff --git a/src/google/protobuf/stubs/bytestream.cc b/src/google/protobuf/stubs/bytestream.cc index 8df2566abd..a0f298edb9 100644 --- a/src/google/protobuf/stubs/bytestream.cc +++ b/src/google/protobuf/stubs/bytestream.cc @@ -33,6 +33,8 @@ #include #include +#include + namespace google { namespace protobuf { namespace strings { diff --git a/src/google/protobuf/stubs/common.cc b/src/google/protobuf/stubs/common.cc index 381533218d..7c17d97278 100644 --- a/src/google/protobuf/stubs/common.cc +++ b/src/google/protobuf/stubs/common.cc @@ -31,11 +31,7 @@ // Author: kenton@google.com (Kenton Varda) #include -#include -#include -#include -#include -#include + #include #include #include @@ -54,6 +50,15 @@ #include #endif +#include +#include +#include +#include +#include +#include +#include +#include + #include namespace google { diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index b3cb882d8c..cc7b71c77b 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -47,11 +47,6 @@ #include #include -// TODO(liujisi): Remove the following includes after the include clean-up. -#include -#include -#include - #ifndef PROTOBUF_USE_EXCEPTIONS #if defined(_MSC_VER) && defined(_CPPUNWIND) #define PROTOBUF_USE_EXCEPTIONS 1 diff --git a/src/google/protobuf/stubs/common_unittest.cc b/src/google/protobuf/stubs/common_unittest.cc index 3ce1c49acf..5852458922 100644 --- a/src/google/protobuf/stubs/common_unittest.cc +++ b/src/google/protobuf/stubs/common_unittest.cc @@ -31,8 +31,10 @@ // Author: kenton@google.com (Kenton Varda) #include +#include #include #include +#include #include #include diff --git a/src/google/protobuf/stubs/int128.cc b/src/google/protobuf/stubs/int128.cc index f86ac4a0b8..2119e65505 100644 --- a/src/google/protobuf/stubs/int128.cc +++ b/src/google/protobuf/stubs/int128.cc @@ -34,6 +34,8 @@ #include // NOLINT(readability/streams) #include +#include + #include namespace google { diff --git a/src/google/protobuf/stubs/statusor.cc b/src/google/protobuf/stubs/statusor.cc index 48d1402ae0..c744b8d237 100644 --- a/src/google/protobuf/stubs/statusor.cc +++ b/src/google/protobuf/stubs/statusor.cc @@ -30,6 +30,8 @@ #include +#include + namespace google { namespace protobuf { namespace util { diff --git a/src/google/protobuf/stubs/stringpiece.cc b/src/google/protobuf/stubs/stringpiece.cc index 96a7d3da86..fc2f521059 100644 --- a/src/google/protobuf/stubs/stringpiece.cc +++ b/src/google/protobuf/stubs/stringpiece.cc @@ -35,6 +35,8 @@ #include #include +#include + namespace google { namespace protobuf { std::ostream& operator<<(std::ostream& o, StringPiece piece) { diff --git a/src/google/protobuf/stubs/stringprintf.cc b/src/google/protobuf/stubs/stringprintf.cc index 820bfe7f75..e6019fc664 100644 --- a/src/google/protobuf/stubs/stringprintf.cc +++ b/src/google/protobuf/stubs/stringprintf.cc @@ -36,7 +36,9 @@ #include // For va_list and related operations #include // MSVC requires this for _vsnprintf #include + #include +#include namespace google { namespace protobuf { diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc index 5bf9f2e6a8..cc3c0798bb 100644 --- a/src/google/protobuf/stubs/strutil.cc +++ b/src/google/protobuf/stubs/strutil.cc @@ -40,6 +40,7 @@ #include #include +#include #include #ifdef _WIN32 diff --git a/src/google/protobuf/stubs/substitute.cc b/src/google/protobuf/stubs/substitute.cc index 1ac9ab45a2..a36f2f026c 100644 --- a/src/google/protobuf/stubs/substitute.cc +++ b/src/google/protobuf/stubs/substitute.cc @@ -31,6 +31,8 @@ // Author: kenton@google.com (Kenton Varda) #include + +#include #include #include diff --git a/src/google/protobuf/testing/file.cc b/src/google/protobuf/testing/file.cc index def92a00e4..06cc981c24 100644 --- a/src/google/protobuf/testing/file.cc +++ b/src/google/protobuf/testing/file.cc @@ -46,6 +46,7 @@ #include #include +#include namespace google { namespace protobuf { diff --git a/src/google/protobuf/testing/googletest.h b/src/google/protobuf/testing/googletest.h index 8163748603..4e0cb83a85 100644 --- a/src/google/protobuf/testing/googletest.h +++ b/src/google/protobuf/testing/googletest.h @@ -37,6 +37,7 @@ #include #include #include +#include #include // Disable death tests if we use exceptions in CHECK(). #if !PROTOBUF_USE_EXCEPTIONS && defined(GTEST_HAS_DEATH_TEST) && \ diff --git a/src/google/protobuf/util/internal/datapiece.h b/src/google/protobuf/util/internal/datapiece.h index 556c0ec46f..0551ff5ba8 100644 --- a/src/google/protobuf/util/internal/datapiece.h +++ b/src/google/protobuf/util/internal/datapiece.h @@ -34,6 +34,7 @@ #include #include +#include #include #include diff --git a/src/google/protobuf/util/internal/field_mask_utility.h b/src/google/protobuf/util/internal/field_mask_utility.h index 97755804f5..c2afbd5a3b 100644 --- a/src/google/protobuf/util/internal/field_mask_utility.h +++ b/src/google/protobuf/util/internal/field_mask_utility.h @@ -36,6 +36,7 @@ #include #include +#include #include #include #include