From 034e603d2a5e629c1c3fbac405638f8afb3ead51 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Sun, 11 Mar 2018 08:57:46 +0100 Subject: [PATCH] Add std:: to some types This is required for compilation to succeed on debian jessie with g++ 6.3.0. Signed-off-by: Fabrice Fontaine [Retrieved from: https://github.com/protobuf-c/protobuf-c/pull/309] --- protoc-c/c_file.h | 2 +- protoc-c/c_generator.cc | 8 ++++---- protoc-c/c_helpers.cc | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/protoc-c/c_file.h b/protoc-c/c_file.h index ed38ce4..84df522 100644 --- a/protoc-c/c_file.h +++ b/protoc-c/c_file.h @@ -104,7 +104,7 @@ class FileGenerator { scoped_array > extension_generators_; // E.g. if the package is foo.bar, package_parts_ is {"foo", "bar"}. - vector package_parts_; + std::vector package_parts_; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator); }; diff --git a/protoc-c/c_generator.cc b/protoc-c/c_generator.cc index a0d0cb6..79a272f 100644 --- a/protoc-c/c_generator.cc +++ b/protoc-c/c_generator.cc @@ -80,13 +80,13 @@ namespace c { // "foo=bar,baz,qux=corge" // parses to the pairs: // ("foo", "bar"), ("baz", ""), ("qux", "corge") -void ParseOptions(const string& text, vector >* output) { - vector parts; +void ParseOptions(const string& text, std::vector >* output) { + std::vector parts; SplitStringUsing(text, ",", &parts); for (unsigned i = 0; i < parts.size(); i++) { string::size_type equals_pos = parts[i].find_first_of('='); - pair value; + std::pair value; if (equals_pos == string::npos) { value.first = parts[i]; value.second = ""; @@ -105,7 +105,7 @@ bool CGenerator::Generate(const FileDescriptor* file, const string& parameter, OutputDirectory* output_directory, string* error) const { - vector > options; + std::vector > options; ParseOptions(parameter, &options); // ----------------------------------------------------------------- diff --git a/protoc-c/c_helpers.cc b/protoc-c/c_helpers.cc index b79b5b0..71b8682 100644 --- a/protoc-c/c_helpers.cc +++ b/protoc-c/c_helpers.cc @@ -177,7 +177,7 @@ string ToCamel(const string &name) { } string FullNameToLower(const string &full_name) { - vector pieces; + std::vector pieces; SplitStringUsing(full_name, ".", &pieces); string rv = ""; for (unsigned i = 0; i < pieces.size(); i++) { @@ -188,7 +188,7 @@ string FullNameToLower(const string &full_name) { return rv; } string FullNameToUpper(const string &full_name) { - vector pieces; + std::vector pieces; SplitStringUsing(full_name, ".", &pieces); string rv = ""; for (unsigned i = 0; i < pieces.size(); i++) { @@ -199,7 +199,7 @@ string FullNameToUpper(const string &full_name) { return rv; } string FullNameToC(const string &full_name) { - vector pieces; + std::vector pieces; SplitStringUsing(full_name, ".", &pieces); string rv = ""; for (unsigned i = 0; i < pieces.size(); i++) { @@ -214,7 +214,7 @@ void PrintComment (io::Printer* printer, string comment) { if (!comment.empty()) { - vector comment_lines; + std::vector comment_lines; SplitStringUsing (comment, "\r\n", &comment_lines); printer->Print ("/*\n"); for (int i = 0; i < comment_lines.size(); i++) @@ -503,8 +503,8 @@ void SplitStringToIteratorUsing(const string& full, void SplitStringUsing(const string& full, const char* delim, - vector* result) { - std::back_insert_iterator< vector > it(*result); + std::vector* result) { + std::back_insert_iterator< std::vector > it(*result); SplitStringToIteratorUsing(full, delim, it); }