Ver Fonte

Generate missing inclusion of common.h.

FileGenerator::GenerateBuildDescriptors() emits
"::google::protobuf::internal::OnShutdown(&$shutdownfilename$);" which is
declared in common.h.

Although Protobuf is very well tested a compilation error was triggered while
rolling Protobuf r423:426. There might be something wrong in the Chromium roll
(still in progress).

It seems safer anyway not to rely on indirect headers inclusion.
pliard@google.com há 13 anos atrás
pai
commit
75575df086

+ 1 - 0
src/google/protobuf/compiler/cpp/cpp_file.cc

@@ -310,6 +310,7 @@ void FileGenerator::GenerateSource(io::Printer* printer) {
     "\n"
     "#include <algorithm>\n"    // for swap()
     "\n"
+    "#include <google/protobuf/stubs/common.h>\n"
     "#include <google/protobuf/stubs/once.h>\n"
     "#include <google/protobuf/io/coded_stream.h>\n"
     "#include <google/protobuf/wire_format_lite_inl.h>\n",

+ 1 - 0
src/google/protobuf/compiler/plugin.pb.cc

@@ -6,6 +6,7 @@
 
 #include <algorithm>
 
+#include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/wire_format_lite_inl.h>

+ 1 - 0
src/google/protobuf/descriptor.pb.cc

@@ -6,6 +6,7 @@
 
 #include <algorithm>
 
+#include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/once.h>
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/wire_format_lite_inl.h>