From bd7d87269f8fa0459cdf7b1877d6e21eb8d5a2cf Mon Sep 17 00:00:00 2001 From: Andy Getz Date: Fri, 7 Aug 2020 22:10:08 -0400 Subject: [PATCH] Change some SplitStringUsing calls to Split. This is done to match an internal Google change necessary to deprecate an old internal API. Nothing needs to change here, however making the change allows the internal code to continue to match the Github code, which is desirable. --- .../protobuf/compiler/objectivec/objectivec_generator.cc | 9 ++++++--- .../protobuf/compiler/objectivec/objectivec_helpers.cc | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/google/protobuf/compiler/objectivec/objectivec_generator.cc b/src/google/protobuf/compiler/objectivec/objectivec_generator.cc index 257e4f9ab..2b564114d 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_generator.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_generator.cc @@ -29,12 +29,12 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include +#include #include #include #include #include #include -#include namespace google { namespace protobuf { @@ -93,8 +93,11 @@ bool ObjectiveCGenerator::GenerateAll(const std::vector& // A semicolon delimited string that lists the paths of .proto files to // exclude from the package prefix validations (expected_prefixes_path). // This is provided as an "out", to skip some files being checked. - SplitStringUsing(options[i].second, ";", - &generation_options.expected_prefixes_suppressions); + for (StringPiece split_piece : Split( + options[i].second, ";", true)) { + generation_options.expected_prefixes_suppressions.push_back( + std::string(split_piece)); + } } else if (options[i].first == "generate_for_named_framework") { // The name of the framework that protos are being generated for. This // will cause the #import statements to be framework based using this diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc index 8b2b719e0..77fe084b7 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc +++ b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc @@ -78,7 +78,8 @@ Options::Options() { } const char* suppressions = getenv("GPB_OBJC_EXPECTED_PACKAGE_PREFIXES_SUPPRESSIONS"); if (suppressions) { - SplitStringUsing(suppressions, ";", &expected_prefixes_suppressions); + expected_prefixes_suppressions = + Split(suppressions, ";", true); } }