0001-Add-std-to-some-types.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. From 034e603d2a5e629c1c3fbac405638f8afb3ead51 Mon Sep 17 00:00:00 2001
  2. From: Fredrik Gustafsson <iveqy@iveqy.com>
  3. Date: Sun, 11 Mar 2018 08:57:46 +0100
  4. Subject: [PATCH] Add std:: to some types
  5. This is required for compilation to succeed on debian jessie with g++
  6. 6.3.0.
  7. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  8. [Retrieved from: https://github.com/protobuf-c/protobuf-c/pull/309]
  9. ---
  10. protoc-c/c_file.h | 2 +-
  11. protoc-c/c_generator.cc | 8 ++++----
  12. protoc-c/c_helpers.cc | 12 ++++++------
  13. 3 files changed, 11 insertions(+), 11 deletions(-)
  14. diff --git a/protoc-c/c_file.h b/protoc-c/c_file.h
  15. index ed38ce4..84df522 100644
  16. --- a/protoc-c/c_file.h
  17. +++ b/protoc-c/c_file.h
  18. @@ -104,7 +104,7 @@ class FileGenerator {
  19. scoped_array<scoped_ptr<ExtensionGenerator> > extension_generators_;
  20. // E.g. if the package is foo.bar, package_parts_ is {"foo", "bar"}.
  21. - vector<string> package_parts_;
  22. + std::vector<string> package_parts_;
  23. GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator);
  24. };
  25. diff --git a/protoc-c/c_generator.cc b/protoc-c/c_generator.cc
  26. index a0d0cb6..79a272f 100644
  27. --- a/protoc-c/c_generator.cc
  28. +++ b/protoc-c/c_generator.cc
  29. @@ -80,13 +80,13 @@ namespace c {
  30. // "foo=bar,baz,qux=corge"
  31. // parses to the pairs:
  32. // ("foo", "bar"), ("baz", ""), ("qux", "corge")
  33. -void ParseOptions(const string& text, vector<pair<string, string> >* output) {
  34. - vector<string> parts;
  35. +void ParseOptions(const string& text, std::vector<std::pair<string, string> >* output) {
  36. + std::vector<string> parts;
  37. SplitStringUsing(text, ",", &parts);
  38. for (unsigned i = 0; i < parts.size(); i++) {
  39. string::size_type equals_pos = parts[i].find_first_of('=');
  40. - pair<string, string> value;
  41. + std::pair<string, string> value;
  42. if (equals_pos == string::npos) {
  43. value.first = parts[i];
  44. value.second = "";
  45. @@ -105,7 +105,7 @@ bool CGenerator::Generate(const FileDescriptor* file,
  46. const string& parameter,
  47. OutputDirectory* output_directory,
  48. string* error) const {
  49. - vector<pair<string, string> > options;
  50. + std::vector<std::pair<string, string> > options;
  51. ParseOptions(parameter, &options);
  52. // -----------------------------------------------------------------
  53. diff --git a/protoc-c/c_helpers.cc b/protoc-c/c_helpers.cc
  54. index b79b5b0..71b8682 100644
  55. --- a/protoc-c/c_helpers.cc
  56. +++ b/protoc-c/c_helpers.cc
  57. @@ -177,7 +177,7 @@ string ToCamel(const string &name) {
  58. }
  59. string FullNameToLower(const string &full_name) {
  60. - vector<string> pieces;
  61. + std::vector<string> pieces;
  62. SplitStringUsing(full_name, ".", &pieces);
  63. string rv = "";
  64. for (unsigned i = 0; i < pieces.size(); i++) {
  65. @@ -188,7 +188,7 @@ string FullNameToLower(const string &full_name) {
  66. return rv;
  67. }
  68. string FullNameToUpper(const string &full_name) {
  69. - vector<string> pieces;
  70. + std::vector<string> pieces;
  71. SplitStringUsing(full_name, ".", &pieces);
  72. string rv = "";
  73. for (unsigned i = 0; i < pieces.size(); i++) {
  74. @@ -199,7 +199,7 @@ string FullNameToUpper(const string &full_name) {
  75. return rv;
  76. }
  77. string FullNameToC(const string &full_name) {
  78. - vector<string> pieces;
  79. + std::vector<string> pieces;
  80. SplitStringUsing(full_name, ".", &pieces);
  81. string rv = "";
  82. for (unsigned i = 0; i < pieces.size(); i++) {
  83. @@ -214,7 +214,7 @@ void PrintComment (io::Printer* printer, string comment)
  84. {
  85. if (!comment.empty())
  86. {
  87. - vector<string> comment_lines;
  88. + std::vector<string> comment_lines;
  89. SplitStringUsing (comment, "\r\n", &comment_lines);
  90. printer->Print ("/*\n");
  91. for (int i = 0; i < comment_lines.size(); i++)
  92. @@ -503,8 +503,8 @@ void SplitStringToIteratorUsing(const string& full,
  93. void SplitStringUsing(const string& full,
  94. const char* delim,
  95. - vector<string>* result) {
  96. - std::back_insert_iterator< vector<string> > it(*result);
  97. + std::vector<string>* result) {
  98. + std::back_insert_iterator< std::vector<string> > it(*result);
  99. SplitStringToIteratorUsing(full, delim, it);
  100. }