Forráskód Böngészése

Merge branch 'master' into php-wkt

Joshua Haberman 4 éve
szülő
commit
510cdff1f0
89 módosított fájl, 745 hozzáadás és 747 törlés
  1. 2 2
      .github/mergeable.yml
  2. 25 3
      BUILD
  3. 2 2
      WORKSPACE
  4. 1 2
      cmake/CMakeLists.txt
  5. 2 2
      cmake/install.cmake
  6. 3 0
      cmake/libprotobuf-lite.cmake
  7. 3 0
      cmake/libprotobuf.cmake
  8. 1 1
      csharp/src/Google.Protobuf/Google.Protobuf.csproj
  9. 1 1
      java/pom.xml
  10. 9 1
      kokoro/linux/dockerfile/test/python27/Dockerfile
  11. 9 1
      kokoro/linux/dockerfile/test/python35/Dockerfile
  12. 9 1
      kokoro/linux/dockerfile/test/python36/Dockerfile
  13. 9 1
      kokoro/linux/dockerfile/test/python37/Dockerfile
  14. 9 1
      kokoro/linux/dockerfile/test/python38/Dockerfile
  15. 1 1
      kokoro/linux/python27/continuous.cfg
  16. 1 1
      kokoro/linux/python27/presubmit.cfg
  17. 1 1
      kokoro/linux/python27_cpp/continuous.cfg
  18. 1 1
      kokoro/linux/python27_cpp/presubmit.cfg
  19. 1 1
      kokoro/linux/python35/continuous.cfg
  20. 1 1
      kokoro/linux/python35/presubmit.cfg
  21. 1 1
      kokoro/linux/python35_cpp/continuous.cfg
  22. 1 1
      kokoro/linux/python35_cpp/presubmit.cfg
  23. 1 1
      kokoro/linux/python36/continuous.cfg
  24. 1 1
      kokoro/linux/python36/presubmit.cfg
  25. 1 1
      kokoro/linux/python36_cpp/continuous.cfg
  26. 1 1
      kokoro/linux/python36_cpp/presubmit.cfg
  27. 1 1
      kokoro/linux/python37/continuous.cfg
  28. 1 1
      kokoro/linux/python37/presubmit.cfg
  29. 1 1
      kokoro/linux/python37_cpp/continuous.cfg
  30. 1 1
      kokoro/linux/python37_cpp/presubmit.cfg
  31. 1 1
      kokoro/linux/python38/continuous.cfg
  32. 1 1
      kokoro/linux/python38/presubmit.cfg
  33. 1 1
      kokoro/linux/python38_cpp/continuous.cfg
  34. 1 1
      kokoro/linux/python38_cpp/presubmit.cfg
  35. 0 11
      kokoro/macos/php5.6_mac/build.sh
  36. 0 5
      kokoro/macos/php5.6_mac/continuous.cfg
  37. 0 5
      kokoro/macos/php5.6_mac/presubmit.cfg
  38. 2 4
      objectivec/DevTools/full_mac_build.sh
  39. 2 6
      objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj
  40. 1 1
      objectivec/Tests/GPBTestUtilities.m
  41. 2 2
      php/ext/google/protobuf/message.c
  42. 17 3
      php/ext/google/protobuf/package.xml
  43. 2 2
      php/ext/google/protobuf/protobuf.h
  44. 2 2
      php/release.sh
  45. 16 1
      python/protobuf_distutils/README.md
  46. 3 1
      python/protobuf_distutils/protobuf_distutils/generate_py_protobufs.py
  47. 1 65
      python/protobuf_distutils/setup.py
  48. 1 1
      python/setup.py
  49. 4 1
      python/tox.ini
  50. 10 1
      src/google/protobuf/compiler/command_line_interface.cc
  51. 12 12
      src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc
  52. 13 12
      src/google/protobuf/compiler/csharp/csharp_doc_comment.cc
  53. 4 3
      src/google/protobuf/compiler/csharp/csharp_enum.cc
  54. 6 6
      src/google/protobuf/compiler/csharp/csharp_field_base.cc
  55. 4 3
      src/google/protobuf/compiler/csharp/csharp_field_base.h
  56. 6 8
      src/google/protobuf/compiler/csharp/csharp_generator.cc
  57. 2 2
      src/google/protobuf/compiler/csharp/csharp_generator.h
  58. 10 9
      src/google/protobuf/compiler/csharp/csharp_helpers.cc
  59. 1 1
      src/google/protobuf/compiler/csharp/csharp_helpers.h
  60. 5 5
      src/google/protobuf/compiler/csharp/csharp_message.cc
  61. 9 7
      src/google/protobuf/compiler/csharp/csharp_names.h
  62. 5 5
      src/google/protobuf/compiler/objectivec/objectivec_enum.cc
  63. 2 2
      src/google/protobuf/compiler/objectivec/objectivec_enum.h
  64. 4 4
      src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
  65. 2 1
      src/google/protobuf/compiler/objectivec/objectivec_enum_field.h
  66. 10 10
      src/google/protobuf/compiler/objectivec/objectivec_extension.cc
  67. 4 4
      src/google/protobuf/compiler/objectivec/objectivec_extension.h
  68. 9 9
      src/google/protobuf/compiler/objectivec/objectivec_field.cc
  69. 11 8
      src/google/protobuf/compiler/objectivec/objectivec_field.h
  70. 12 11
      src/google/protobuf/compiler/objectivec/objectivec_file.cc
  71. 4 3
      src/google/protobuf/compiler/objectivec/objectivec_file.h
  72. 8 8
      src/google/protobuf/compiler/objectivec/objectivec_generator.cc
  73. 4 7
      src/google/protobuf/compiler/objectivec/objectivec_generator.h
  74. 191 188
      src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
  75. 75 74
      src/google/protobuf/compiler/objectivec/objectivec_helpers.h
  76. 20 20
      src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc
  77. 10 10
      src/google/protobuf/compiler/objectivec/objectivec_map_field.cc
  78. 4 2
      src/google/protobuf/compiler/objectivec/objectivec_map_field.h
  79. 16 15
      src/google/protobuf/compiler/objectivec/objectivec_message.cc
  80. 7 8
      src/google/protobuf/compiler/objectivec/objectivec_message.h
  81. 8 7
      src/google/protobuf/compiler/objectivec/objectivec_message_field.cc
  82. 8 4
      src/google/protobuf/compiler/objectivec/objectivec_message_field.h
  83. 5 5
      src/google/protobuf/compiler/objectivec/objectivec_oneof.cc
  84. 3 3
      src/google/protobuf/compiler/objectivec/objectivec_oneof.h
  85. 2 2
      src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
  86. 68 64
      src/google/protobuf/compiler/php/php_generator.cc
  87. 3 3
      src/google/protobuf/compiler/php/php_generator.h
  88. 8 8
      src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
  89. 2 45
      tests.sh

+ 2 - 2
.github/mergeable.yml

@@ -11,8 +11,8 @@ mergeable:
                 regex: 'release notes: yes'
                 regex: 'release notes: yes'
                 message: 'Please include release notes: yes'
                 message: 'Please include release notes: yes'
             - must_include:
             - must_include:
-                regex: '^(c#|c\+\+|cleanup|conformance tests|integration|java|javascript|go|objective-c|php|python|ruby|bazel)'
-                message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: bazel, cleanup, conformance tests, integration.'
+                regex: '^(c#|c\+\+|cleanup|conformance tests|integration|java|javascript|go|objective-c|php|python|ruby|bazel|cmake|protoc)'
+                message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: bazel, cmake, cleanup, conformance tests, integration, protoc.'
           - must_include:
           - must_include:
               regex: 'release notes: no'
               regex: 'release notes: no'
               message: 'Please include release notes: no'
               message: 'Please include release notes: no'

+ 25 - 3
BUILD

@@ -14,10 +14,10 @@ exports_files(["LICENSE"])
 # build configuration
 # build configuration
 ################################################################################
 ################################################################################
 
 
+# TODO(yannic): Remove in 3.14.0.
 string_flag(
 string_flag(
     name = "incompatible_use_com_google_googletest",
     name = "incompatible_use_com_google_googletest",
-    # TODO(yannic): Flip to `true` for `3.13.0`.
-    build_setting_default = "false",
+    build_setting_default = "true",
     values = ["true", "false"]
     values = ["true", "false"]
 )
 )
 
 
@@ -368,7 +368,15 @@ cc_library(
 
 
 cc_proto_blacklist_test(
 cc_proto_blacklist_test(
     name = "cc_proto_blacklist_test",
     name = "cc_proto_blacklist_test",
-    deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()]
+    deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
+    tags = [
+        # Exclude this target from wildcard expansion (//...). Due to
+        # https://github.com/bazelbuild/bazel/issues/10590, this test has to
+        # be nominated using the `@com_google_protobuf//` prefix. We do that,
+        # e.g., in kokoro/linux/bazel/build.sh.
+        # See also https://github.com/protocolbuffers/protobuf/pull/7096.
+        "manual",
+    ],
 )
 )
 
 
 ################################################################################
 ################################################################################
@@ -756,6 +764,13 @@ cc_binary(
     copts = COPTS + [
     copts = COPTS + [
         "-DPYTHON_PROTO2_CPP_IMPL_V2",
         "-DPYTHON_PROTO2_CPP_IMPL_V2",
     ],
     ],
+    tags = [
+        # Exclude this target from wildcard expansion (//...) because it may
+        # not even be buildable. It will be built if it is needed according
+        # to :use_fast_cpp_protos.
+        # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes
+        "manual",
+    ],
     linkshared = 1,
     linkshared = 1,
     linkstatic = 1,
     linkstatic = 1,
     deps = select({
     deps = select({
@@ -780,6 +795,13 @@ cc_binary(
         "python/",
         "python/",
         "src/",
         "src/",
     ],
     ],
+    tags = [
+        # Exclude this target from wildcard expansion (//...) because it may
+        # not even be buildable. It will be built if it is needed according
+        # to :use_fast_cpp_protos.
+        # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes
+        "manual",
+    ],
     linkshared = 1,
     linkshared = 1,
     linkstatic = 1,
     linkstatic = 1,
     deps = [
     deps = [

+ 2 - 2
WORKSPACE

@@ -29,13 +29,13 @@ bind(
     actual = "//util/python:python_headers",
     actual = "//util/python:python_headers",
 )
 )
 
 
-# TODO(yannic): Remove in 3.13.0.
+# TODO(yannic): Remove in 3.14.0.
 bind(
 bind(
     name = "gtest",
     name = "gtest",
     actual = "@com_google_googletest//:gtest",
     actual = "@com_google_googletest//:gtest",
 )
 )
 
 
-# TODO(yannic): Remove in 3.13.0.
+# TODO(yannic): Remove in 3.14.0.
 bind(
 bind(
     name = "gtest_main",
     name = "gtest_main",
     actual = "@com_google_googletest//:gtest_main",
     actual = "@com_google_googletest//:gtest_main",

+ 1 - 2
cmake/CMakeLists.txt

@@ -44,6 +44,7 @@ option(protobuf_BUILD_TESTS "Build tests" ON)
 option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF)
 option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF)
 option(protobuf_BUILD_EXAMPLES "Build examples" OFF)
 option(protobuf_BUILD_EXAMPLES "Build examples" OFF)
 option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON)
 option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON)
+option(protobuf_BUILD_LIBPROTOC "Build libprotoc" OFF)
 if (BUILD_SHARED_LIBS)
 if (BUILD_SHARED_LIBS)
   set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON)
   set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON)
 else (BUILD_SHARED_LIBS)
 else (BUILD_SHARED_LIBS)
@@ -64,8 +65,6 @@ include(protobuf-options.cmake)
 # Overrides for option dependencies
 # Overrides for option dependencies
 if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS)
 if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS)
   set(protobuf_BUILD_LIBPROTOC ON)
   set(protobuf_BUILD_LIBPROTOC ON)
-else()
-  set(protobuf_BUILD_LIBPROTOC OFF)
 endif ()
 endif ()
 # Path to main configure script
 # Path to main configure script
 set(protobuf_CONFIGURE_SCRIPT "../configure.ac")
 set(protobuf_CONFIGURE_SCRIPT "../configure.ac")

+ 2 - 2
cmake/install.cmake

@@ -6,9 +6,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake
                ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
                ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
 
 
 set(_protobuf_libraries libprotobuf-lite libprotobuf)
 set(_protobuf_libraries libprotobuf-lite libprotobuf)
-if (protobuf_BUILD_PROTOC_BINARIES)
+if (protobuf_BUILD_LIBPROTOC)
     list(APPEND _protobuf_libraries libprotoc)
     list(APPEND _protobuf_libraries libprotoc)
-endif (protobuf_BUILD_PROTOC_BINARIES)
+endif (protobuf_BUILD_LIBPROTOC)
 
 
 foreach(_library ${_protobuf_libraries})
 foreach(_library ${_protobuf_libraries})
   set_property(TARGET ${_library}
   set_property(TARGET ${_library}

+ 3 - 0
cmake/libprotobuf-lite.cmake

@@ -68,6 +68,9 @@ target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT})
 if(protobuf_LINK_LIBATOMIC)
 if(protobuf_LINK_LIBATOMIC)
   target_link_libraries(libprotobuf-lite atomic)
   target_link_libraries(libprotobuf-lite atomic)
 endif()
 endif()
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+	target_link_libraries(libprotobuf-lite log)
+endif()
 target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src)
 target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src)
 if(MSVC AND protobuf_BUILD_SHARED_LIBS)
 if(MSVC AND protobuf_BUILD_SHARED_LIBS)
   target_compile_definitions(libprotobuf-lite
   target_compile_definitions(libprotobuf-lite

+ 3 - 0
cmake/libprotobuf.cmake

@@ -121,6 +121,9 @@ endif()
 if(protobuf_LINK_LIBATOMIC)
 if(protobuf_LINK_LIBATOMIC)
   target_link_libraries(libprotobuf atomic)
   target_link_libraries(libprotobuf atomic)
 endif()
 endif()
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+	target_link_libraries(libprotobuf log)
+endif()
 target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src)
 target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src)
 if(MSVC AND protobuf_BUILD_SHARED_LIBS)
 if(MSVC AND protobuf_BUILD_SHARED_LIBS)
   target_compile_definitions(libprotobuf
   target_compile_definitions(libprotobuf

+ 1 - 1
csharp/src/Google.Protobuf/Google.Protobuf.csproj

@@ -30,7 +30,7 @@
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="System.Memory" Version="4.5.2"/>
+    <PackageReference Include="System.Memory" Version="4.5.3"/>
     <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Version="1.0.0"/>
     <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Version="1.0.0"/>
     <!-- Needed for the net45 build to work on Unix. See https://github.com/dotnet/designs/pull/33 -->
     <!-- Needed for the net45 build to work on Unix. See https://github.com/dotnet/designs/pull/33 -->
     <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0"/>
     <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0"/>

+ 1 - 1
java/pom.xml

@@ -75,7 +75,7 @@
       <dependency>
       <dependency>
         <groupId>junit</groupId>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <artifactId>junit</artifactId>
-        <version>4.13</version>
+        <version>4.13.1</version>
         <scope>test</scope>
         <scope>test</scope>
       </dependency>
       </dependency>
       <dependency>
       <dependency>

+ 9 - 1
kokoro/linux/dockerfile/test/python27/Dockerfile

@@ -20,4 +20,12 @@ RUN apt-get update && apt-get install -y \
   parallel \
   parallel \
   time \
   time \
   wget \
   wget \
-  && apt-get clean
+  && apt-get clean \
+  && rm -rf /var/lib/apt/lists/*
+
+# Install Python libraries.
+RUN python -m pip install --no-cache-dir --upgrade \
+  pip \
+  setuptools \
+  tox \
+  wheel

+ 9 - 1
kokoro/linux/dockerfile/test/python35/Dockerfile

@@ -20,4 +20,12 @@ RUN apt-get update && apt-get install -y \
   parallel \
   parallel \
   time \
   time \
   wget \
   wget \
-  && apt-get clean
+  && apt-get clean \
+  && rm -rf /var/lib/apt/lists/*
+
+# Install Python libraries.
+RUN python -m pip install --no-cache-dir --upgrade \
+  pip \
+  setuptools \
+  tox \
+  wheel

+ 9 - 1
kokoro/linux/dockerfile/test/python36/Dockerfile

@@ -20,4 +20,12 @@ RUN apt-get update && apt-get install -y \
   parallel \
   parallel \
   time \
   time \
   wget \
   wget \
-  && apt-get clean
+  && apt-get clean \
+  && rm -rf /var/lib/apt/lists/*
+
+# Install Python libraries.
+RUN python -m pip install --no-cache-dir --upgrade \
+  pip \
+  setuptools \
+  tox \
+  wheel

+ 9 - 1
kokoro/linux/dockerfile/test/python37/Dockerfile

@@ -20,4 +20,12 @@ RUN apt-get update && apt-get install -y \
   parallel \
   parallel \
   time \
   time \
   wget \
   wget \
-  && apt-get clean
+  && apt-get clean \
+  && rm -rf /var/lib/apt/lists/*
+
+# Install Python libraries.
+RUN python -m pip install --no-cache-dir --upgrade \
+  pip \
+  setuptools \
+  tox \
+  wheel

+ 9 - 1
kokoro/linux/dockerfile/test/python38/Dockerfile

@@ -20,4 +20,12 @@ RUN apt-get update && apt-get install -y \
   parallel \
   parallel \
   time \
   time \
   wget \
   wget \
-  && apt-get clean
+  && apt-get clean \
+  && rm -rf /var/lib/apt/lists/*
+
+# Install Python libraries.
+RUN python -m pip install --no-cache-dir --upgrade \
+  pip \
+  setuptools \
+  tox \
+  wheel

+ 1 - 1
kokoro/linux/python27/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python27/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python27/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python27/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python27_cpp/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python27_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python27_cpp/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python27_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python35/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python35/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python35/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python35/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python35_cpp/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python35_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python35_cpp/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python35_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python36/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python36/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python36/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python36/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python36_cpp/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python36_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python36_cpp/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python36_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python37/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python37/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python37/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python37/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python37_cpp/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python37_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python37_cpp/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python37_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python38/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python38/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python38/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python/build.sh"
+build_file: "protobuf/kokoro/linux/python38/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python38_cpp/continuous.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python38_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 1 - 1
kokoro/linux/python38_cpp/presubmit.cfg

@@ -1,7 +1,7 @@
 # Config file for running tests in Kokoro
 # Config file for running tests in Kokoro
 
 
 # Location of the build script in repository
 # Location of the build script in repository
-build_file: "protobuf/kokoro/linux/python_cpp/build.sh"
+build_file: "protobuf/kokoro/linux/python38_cpp/build.sh"
 timeout_mins: 120
 timeout_mins: 120
 
 
 action {
 action {

+ 0 - 11
kokoro/macos/php5.6_mac/build.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-#
-# Build file to set up and run tests
-
-# Change to repo root
-cd $(dirname $0)/../../..
-
-# Prepare worker environment to run tests
-source kokoro/macos/prepare_build_macos_rc
-
-./tests.sh php5.6_mac

+ 0 - 5
kokoro/macos/php5.6_mac/continuous.cfg

@@ -1,5 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/macos/php5.6_mac/build.sh"
-timeout_mins: 1440

+ 0 - 5
kokoro/macos/php5.6_mac/presubmit.cfg

@@ -1,5 +0,0 @@
-# Config file for running tests in Kokoro
-
-# Location of the build script in repository
-build_file: "protobuf/kokoro/macos/php5.6_mac/build.sh"
-timeout_mins: 1440

+ 2 - 4
objectivec/DevTools/full_mac_build.sh

@@ -289,7 +289,7 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
           -disable-concurrent-destination-testing
           -disable-concurrent-destination-testing
       )
       )
       ;;
       ;;
-    11.*)
+    11.* | 12.*)
       # Dropped 32bit as Apple doesn't seem support the simulators either.
       # Dropped 32bit as Apple doesn't seem support the simulators either.
       XCODEBUILD_TEST_BASE_IOS+=(
       XCODEBUILD_TEST_BASE_IOS+=(
           -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" # 64bit
           -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" # 64bit
@@ -352,10 +352,8 @@ if [[ "${DO_XCODE_TVOS_TESTS}" == "yes" ]] ; then
       echo "ERROR: Xcode 10.0 or higher is required to build the test suite." 1>&2
       echo "ERROR: Xcode 10.0 or higher is required to build the test suite." 1>&2
       exit 11
       exit 11
       ;;
       ;;
-    10.* | 11.* )
+    10.* | 11.* | 12.*)
       XCODEBUILD_TEST_BASE_TVOS+=(
       XCODEBUILD_TEST_BASE_TVOS+=(
-        # Test on the oldest and current.
-        -destination "platform=tvOS Simulator,name=Apple TV,OS=11.0"
         -destination "platform=tvOS Simulator,name=Apple TV 4K,OS=latest"
         -destination "platform=tvOS Simulator,name=Apple TV 4K,OS=latest"
       )
       )
       ;;
       ;;

+ 2 - 6
objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj

@@ -856,13 +856,11 @@
 			buildSettings = {
 			buildSettings = {
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_OBJC_WEAK = YES;
 				CLANG_ENABLE_OBJC_WEAK = YES;
-				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 				FRAMEWORK_SEARCH_PATHS = (
 					"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
 					"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
 					"$(inherited)",
 					"$(inherited)",
 				);
 				);
 				INFOPLIST_FILE = "Tests/UnitTests-Info.plist";
 				INFOPLIST_FILE = "Tests/UnitTests-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = (
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(inherited)",
@@ -889,13 +887,11 @@
 			buildSettings = {
 			buildSettings = {
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_OBJC_WEAK = YES;
 				CLANG_ENABLE_OBJC_WEAK = YES;
-				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 				FRAMEWORK_SEARCH_PATHS = (
 					"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
 					"\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"",
 					"$(inherited)",
 					"$(inherited)",
 				);
 				);
 				INFOPLIST_FILE = "Tests/UnitTests-Info.plist";
 				INFOPLIST_FILE = "Tests/UnitTests-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = (
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(inherited)",
@@ -972,7 +968,7 @@
 				GCC_WARN_UNUSED_PARAMETER = YES;
 				GCC_WARN_UNUSED_PARAMETER = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				GENERATE_PROFILING_CODE = NO;
 				GENERATE_PROFILING_CODE = NO;
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
 				ONLY_ACTIVE_ARCH = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				RUN_CLANG_STATIC_ANALYZER = YES;
 				RUN_CLANG_STATIC_ANALYZER = YES;
 				SDKROOT = iphoneos;
 				SDKROOT = iphoneos;
@@ -1041,7 +1037,7 @@
 				GCC_WARN_UNUSED_PARAMETER = YES;
 				GCC_WARN_UNUSED_PARAMETER = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				GENERATE_PROFILING_CODE = NO;
 				GENERATE_PROFILING_CODE = NO;
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
 				RUN_CLANG_STATIC_ANALYZER = YES;
 				RUN_CLANG_STATIC_ANALYZER = YES;
 				SDKROOT = iphoneos;
 				SDKROOT = iphoneos;
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";

+ 1 - 1
objectivec/Tests/GPBTestUtilities.m

@@ -779,7 +779,7 @@ const uint32_t kGPBDefaultRepeatCount = 2;
     [message.repeatedSfixed64Array addValue:210 + i * 100];
     [message.repeatedSfixed64Array addValue:210 + i * 100];
     [message.repeatedFloatArray addValue:211 + i * 100];
     [message.repeatedFloatArray addValue:211 + i * 100];
     [message.repeatedDoubleArray addValue:212 + i * 100];
     [message.repeatedDoubleArray addValue:212 + i * 100];
-    [message.repeatedBoolArray addValue:(i % 2)];
+    [message.repeatedBoolArray addValue:(BOOL)(i % 2)];
     NSString *string = [[NSString alloc] initWithFormat:@"%d", 215 + i * 100];
     NSString *string = [[NSString alloc] initWithFormat:@"%d", 215 + i * 100];
     [message.repeatedStringArray addObject:string];
     [message.repeatedStringArray addObject:string];
     [string release];
     [string release];

+ 2 - 2
php/ext/google/protobuf/message.c

@@ -365,13 +365,13 @@ static PROTO_RETURN_VAL Message_write_property(
   const upb_fielddef *f = get_field(intern, member);
   const upb_fielddef *f = get_field(intern, member);
 
 
   if (f && Message_set(intern, f, val)) {
   if (f && Message_set(intern, f, val)) {
-#if PHP_VERSION_ID < 704000
+#if PHP_VERSION_ID < 70400
     return;
     return;
 #else
 #else
     return val;
     return val;
 #endif
 #endif
   } else {
   } else {
-#if PHP_VERSION_ID < 704000
+#if PHP_VERSION_ID < 70400
     return;
     return;
 #else
 #else
     return &EG(error_zval);
     return &EG(error_zval);

+ 17 - 3
php/ext/google/protobuf/package.xml

@@ -10,11 +10,11 @@
   <email>protobuf-opensource@google.com</email>
   <email>protobuf-opensource@google.com</email>
   <active>yes</active>
   <active>yes</active>
  </lead>
  </lead>
- <date>2020-08-14</date>
+ <date>2020-10-08</date>
  <time>14:07:59</time>
  <time>14:07:59</time>
  <version>
  <version>
-  <release>3.13.0</release>
-  <api>3.13.0</api>
+  <release>3.13.0.1</release>
+  <api>3.13.0.1</api>
  </version>
  </version>
  <stability>
  <stability>
   <release>stable</release>
   <release>stable</release>
@@ -675,5 +675,19 @@ G  A release.
    <license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
    <license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
    <notes>GA release.</notes>
    <notes>GA release.</notes>
   </release>
   </release>
+  <release>
+   <version>
+    <release>3.13.0.1</release>
+    <api>3.13.0.1</api>
+   </version>
+   <stability>
+    <release>stable</release>
+    <api>stable</api>
+   </stability>
+   <date>2020-10-08</date>
+   <time>14:07:59</time>
+   <license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
+   <notes>GA release.</notes>
+  </release>
  </changelog>
  </changelog>
 </package>
 </package>

+ 2 - 2
php/ext/google/protobuf/protobuf.h

@@ -56,7 +56,7 @@ const zval *get_generated_pool();
 // instead of zval* and zend_string* instead of zval* for property names.
 // instead of zval* and zend_string* instead of zval* for property names.
 // https://github.com/php/php-src/blob/php-8.0.0beta1/UPGRADING.INTERNALS#L37-L39
 // https://github.com/php/php-src/blob/php-8.0.0beta1/UPGRADING.INTERNALS#L37-L39
 #if PHP_VERSION_ID < 80000
 #if PHP_VERSION_ID < 80000
-#define PROTO_VAL zval 
+#define PROTO_VAL zval
 #define PROTO_STR zval
 #define PROTO_STR zval
 #define PROTO_MSG_P(obj) (Message*)Z_OBJ_P(obj)
 #define PROTO_MSG_P(obj) (Message*)Z_OBJ_P(obj)
 #define PROTO_STRVAL_P(obj) Z_STRVAL_P(obj)
 #define PROTO_STRVAL_P(obj) Z_STRVAL_P(obj)
@@ -69,7 +69,7 @@ const zval *get_generated_pool();
 #define PROTO_STRLEN_P(obj) ZSTR_LEN(obj)
 #define PROTO_STRLEN_P(obj) ZSTR_LEN(obj)
 #endif
 #endif
 
 
-#define PHP_PROTOBUF_VERSION "3.13.0"
+#define PHP_PROTOBUF_VERSION "3.13.0.1"
 
 
 // ptr -> PHP object cache. This is a weak map that caches lazily-created
 // ptr -> PHP object cache. This is a weak map that caches lazily-created
 // wrapper objects around upb types:
 // wrapper objects around upb types:

+ 2 - 2
php/release.sh

@@ -10,8 +10,8 @@ set -ex
 
 
 VERSION=$1
 VERSION=$1
 
 
-git clone git@github.com:protocolbuffers/protobuf-php.git
-git clone git@github.com:protocolbuffers/protobuf.git
+git clone https://github.com/protocolbuffers/protobuf-php.git
+git clone https://github.com/protocolbuffers/protobuf.git
 
 
 # Clean old files
 # Clean old files
 pushd protobuf-php
 pushd protobuf-php

+ 16 - 1
python/protobuf_distutils/README.md

@@ -103,4 +103,19 @@ $ python -m pip install .
 
 
   By default, the protoc binary (the Protobuf compiler) is found by
   By default, the protoc binary (the Protobuf compiler) is found by
   searching the environment path. To use a specific protoc binary, its
   searching the environment path. To use a specific protoc binary, its
-  path can be specified.
+  path can be specified. Resolution of the `protoc` value is as follows:
+  1. If the `--protoc=VALUE` flag is passed to `generate_py_protobufs`,
+     then `VALUE` will be used.
+     For example:
+     ```shell
+     $ python setup.py generate_py_protobufs --protoc=/path/to/protoc
+     ```
+  2. Otherwise, if a value was set in the `options`, it will be used.
+     (See "Example setup.py configuration," above.)
+  3. Otherwise, if the `PROTOC` environment variable is set, it will be
+     used. For example:
+     For example:
+     ```shell
+     $ PROTOC=/path/to/protoc python setup.py generate_py_protobufs
+     ```
+  4. Otherwise, `$PATH` will be searched.

+ 3 - 1
python/protobuf_distutils/protobuf_distutils/generate_py_protobufs.py

@@ -47,7 +47,7 @@ class generate_py_protobufs(Command):
         ('extra-proto-paths=', None,
         ('extra-proto-paths=', None,
          'Additional paths to resolve imports in .proto files.'),
          'Additional paths to resolve imports in .proto files.'),
 
 
-        ('protoc', None,
+        ('protoc=', None,
          'Path to a specific `protoc` command to use.'),
          'Path to a specific `protoc` command to use.'),
     ]
     ]
     boolean_options = ['recurse']
     boolean_options = ['recurse']
@@ -127,6 +127,8 @@ class generate_py_protobufs(Command):
 
 
         self.ensure_string_list('proto_files')
         self.ensure_string_list('proto_files')
 
 
+        if self.protoc is None:
+            self.protoc = os.getenv('PROTOC')
         if self.protoc is None:
         if self.protoc is None:
             self.protoc = spawn.find_executable('protoc')
             self.protoc = spawn.find_executable('protoc')
 
 

+ 1 - 65
python/protobuf_distutils/setup.py

@@ -28,71 +28,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-"""Setuptools/distutils extension for generating Python protobuf code.
-
-This extension uses a prebuilt 'protoc' binary to generate Python types for
-protobuf sources. By default, it will use a system-installed protoc binary, but
-a custom protoc can be specified by flag.
-
-This command should usually be run before the 'build' command, so that the
-generated sources are treated the same way as the rest of the Python
-sources.
-
-Options:
-
-    source_dir:
-        This is the directory holding .proto files to be processed.
-
-        The default behavior is to generate sources for all .proto files found
-        under `source_dir`, recursively. This behavior can be controlled with
-        options below.
-
-    proto_root_path:
-        This is the root path for resolving imports in source .proto files.
-
-        The default is the shortest prefix of `source_dir` among:
-            [source_dir] + self.extra_proto_paths
-
-    extra_proto_paths:
-        Specifies additional paths that should be used to find imports, in
-        addition to `source_dir`.
-
-        This option can be used to specify the path to other protobuf sources,
-        which are imported by files under `source_dir`.  No Python code will be
-        generated for .proto files under `extra_proto_paths`.
-
-    output_dir:
-        Specifies where generated code should be placed.
-
-        Typically, this should be the root package that generated Python modules
-        should be below.
-
-        The generated files will be named according to the relative source paths
-        under `proto_root_path`. For example, this source .proto file:
-            ${proto_root_path}/subdir/message.proto
-        will correspond to this generated Python module:
-            ${output_dir}/subdir/message_pb2.py
-
-    proto_files:
-        Specific .proto files can be specified for generating code, instead of
-        searching for all .proto files under `source_path`.
-
-        These paths are relative to `source_dir`. For example, to generate code
-        for just ${source_dir}/subdir/message.proto, specify
-        ['subdir/message.proto'].
-
-    protoc:
-        By default, the protoc binary (the Protobuf compiler) is found by
-        searching the environment path. To use a specific protoc binary, its
-        path can be specified.
-
-    recurse:
-        If `proto_files` are not specified, then the default behavior is to
-        search `source_dir` recursively. This option controls the recursive
-        search; if it is False, only .proto files immediately under `source_dir`
-        will be used to generate sources.
-
-"""
+"""Setuptools/distutils extension for generating Python protobuf code."""
 
 
 __author__ = 'dlj@google.com (David L. Jones)'
 __author__ = 'dlj@google.com (David L. Jones)'
 
 

+ 1 - 1
python/setup.py

@@ -254,7 +254,7 @@ if __name__ == '__main__':
     os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp'
     os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp'
 
 
   # Keep this list of dependencies in sync with tox.ini.
   # Keep this list of dependencies in sync with tox.ini.
-  install_requires = ['six>=1.9', 'setuptools']
+  install_requires = ['six>=1.9']
   if sys.version_info <= (2,7):
   if sys.version_info <= (2,7):
     install_requires.append('ordereddict')
     install_requires.append('ordereddict')
     install_requires.append('unittest2')
     install_requires.append('unittest2')

+ 4 - 1
python/tox.ini

@@ -14,7 +14,10 @@ setenv =
 commands =
 commands =
     python setup.py -q build_py
     python setup.py -q build_py
     python: python setup.py -q build
     python: python setup.py -q build
-    cpp: python setup.py -q build --cpp_implementation --warnings_as_errors --compile_static_extension
+    # --warnings_as_errors disabled until we update the Python C extension. See:
+    # https://github.com/protocolbuffers/protobuf/issues/7930
+    # cpp: python setup.py -q build --cpp_implementation --warnings_as_errors --compile_static_extension
+    cpp: python setup.py -q build --cpp_implementation --compile_static_extension
     python: python setup.py -q test -q
     python: python setup.py -q test -q
     cpp: python setup.py -q test -q --cpp_implementation
     cpp: python setup.py -q test -q --cpp_implementation
     python: python setup.py -q test_conformance
     python: python setup.py -q test_conformance

+ 10 - 1
src/google/protobuf/compiler/command_line_interface.cc

@@ -58,8 +58,10 @@
 
 
 #include <memory>
 #include <memory>
 
 
-#ifdef __APPLE__
+#if defined(__APPLE__)
 #include <mach-o/dyld.h>
 #include <mach-o/dyld.h>
+#elif defined(__FreeBSD__)
+#include <sys/sysctl.h>
 #endif
 #endif
 
 
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/common.h>
@@ -202,6 +204,13 @@ bool GetProtocAbsolutePath(std::string* path) {
     realpath(dirtybuffer, buffer);
     realpath(dirtybuffer, buffer);
     len = strlen(buffer);
     len = strlen(buffer);
   }
   }
+#elif defined(__FreeBSD__)
+  char buffer[PATH_MAX];
+  size_t len = PATH_MAX;
+  int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+  if (sysctl(mib, 4, &buffer, &len, NULL, 0) != 0) {
+    len = 0;
+  }
 #else
 #else
   char buffer[PATH_MAX];
   char buffer[PATH_MAX];
   int len = readlink("/proc/self/exe", buffer, PATH_MAX);
   int len = readlink("/proc/self/exe", buffer, PATH_MAX);

+ 12 - 12
src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc

@@ -65,11 +65,11 @@ class MockErrorCollector : public MultiFileErrorCollector {
   MockErrorCollector() {}
   MockErrorCollector() {}
   ~MockErrorCollector() {}
   ~MockErrorCollector() {}
 
 
-  string text_;
+  std::string text_;
 
 
   // implements ErrorCollector ---------------------------------------
   // implements ErrorCollector ---------------------------------------
-  void AddError(const string& filename, int line, int column,
-                const string& message) {
+  void AddError(const std::string& filename, int line, int column,
+                const std::string& message) {
     strings::SubstituteAndAppend(&text_, "$0:$1:$2: $3\n",
     strings::SubstituteAndAppend(&text_, "$0:$1:$2: $3\n",
                                  filename, line, column, message);
                                  filename, line, column, message);
   }
   }
@@ -77,14 +77,14 @@ class MockErrorCollector : public MultiFileErrorCollector {
 
 
 class MockGeneratorContext : public GeneratorContext {
 class MockGeneratorContext : public GeneratorContext {
  public:
  public:
-  void ExpectFileMatches(const string& virtual_filename,
-                         const string& physical_filename) {
+  void ExpectFileMatches(const std::string& virtual_filename,
+                         const std::string& physical_filename) {
     auto it = files_.find(virtual_filename);
     auto it = files_.find(virtual_filename);
     ASSERT_TRUE(it != files_.end())
     ASSERT_TRUE(it != files_.end())
       << "Generator failed to generate file: " << virtual_filename;
       << "Generator failed to generate file: " << virtual_filename;
-    string expected_contents = *it->second;
+    std::string expected_contents = *it->second;
 
 
-    string actual_contents;
+    std::string actual_contents;
     GOOGLE_CHECK_OK(
     GOOGLE_CHECK_OK(
         File::GetContentsAsText(TestSourceDir() + "/" + physical_filename,
         File::GetContentsAsText(TestSourceDir() + "/" + physical_filename,
                           &actual_contents, true))
                           &actual_contents, true))
@@ -97,7 +97,7 @@ class MockGeneratorContext : public GeneratorContext {
 
 
   // implements GeneratorContext --------------------------------------
   // implements GeneratorContext --------------------------------------
 
 
-  virtual io::ZeroCopyOutputStream* Open(const string& filename) {
+  virtual io::ZeroCopyOutputStream* Open(const std::string& filename) {
     auto& map_slot = files_[filename];
     auto& map_slot = files_[filename];
     map_slot.reset(new std::string);
     map_slot.reset(new std::string);
     return new io::StringOutputStream(map_slot.get());
     return new io::StringOutputStream(map_slot.get());
@@ -110,7 +110,7 @@ class MockGeneratorContext : public GeneratorContext {
 class GenerateAndTest {
 class GenerateAndTest {
  public:
  public:
   GenerateAndTest() {}
   GenerateAndTest() {}
-  void Run(const FileDescriptor* proto_file, string file1, string file2) {
+  void Run(const FileDescriptor* proto_file, std::string file1, std::string file2) {
     ASSERT_TRUE(proto_file != NULL) << TestSourceDir();
     ASSERT_TRUE(proto_file != NULL) << TestSourceDir();
     ASSERT_TRUE(generator_.Generate(proto_file, parameter_,
     ASSERT_TRUE(generator_.Generate(proto_file, parameter_,
                                     &context_, &error_));
                                     &context_, &error_));
@@ -123,14 +123,14 @@ class GenerateAndTest {
  private:
  private:
   Generator generator_;
   Generator generator_;
   MockGeneratorContext context_;
   MockGeneratorContext context_;
-  string error_;
-  string parameter_;
+  std::string error_;
+  std::string parameter_;
 };
 };
 
 
 TEST(CsharpBootstrapTest, GeneratedCsharpDescriptorMatches) {
 TEST(CsharpBootstrapTest, GeneratedCsharpDescriptorMatches) {
   // Skip this whole test if the csharp directory doesn't exist (i.e., a C++11
   // Skip this whole test if the csharp directory doesn't exist (i.e., a C++11
   // only distribution).
   // only distribution).
-  string descriptor_file_name =
+  std::string descriptor_file_name =
       "../csharp/src/Google.Protobuf/Reflection/Descriptor.cs";
       "../csharp/src/Google.Protobuf/Reflection/Descriptor.cs";
   if (!File::Exists(TestSourceDir() + "/" + descriptor_file_name)) {
   if (!File::Exists(TestSourceDir() + "/" + descriptor_file_name)) {
     return;
     return;

+ 13 - 12
src/google/protobuf/compiler/csharp/csharp_doc_comment.cc

@@ -47,7 +47,7 @@ namespace csharp {
 // is inlined in the relevant code. If more control is required, that code can be moved here.
 // is inlined in the relevant code. If more control is required, that code can be moved here.
 
 
 void WriteDocCommentBodyImpl(io::Printer* printer, SourceLocation location) {
 void WriteDocCommentBodyImpl(io::Printer* printer, SourceLocation location) {
-    string comments = location.leading_comments.empty() ?
+    std::string comments = location.leading_comments.empty() ?
         location.trailing_comments : location.leading_comments;
         location.trailing_comments : location.leading_comments;
     if (comments.empty()) {
     if (comments.empty()) {
         return;
         return;
@@ -56,7 +56,7 @@ void WriteDocCommentBodyImpl(io::Printer* printer, SourceLocation location) {
     // node of a summary element, not part of an attribute.
     // node of a summary element, not part of an attribute.
     comments = StringReplace(comments, "&", "&amp;", true);
     comments = StringReplace(comments, "&", "&amp;", true);
     comments = StringReplace(comments, "<", "&lt;", true);
     comments = StringReplace(comments, "<", "&lt;", true);
-    std::vector<string> lines;
+    std::vector<std::string> lines;
     lines = Split(comments, "\n", false);
     lines = Split(comments, "\n", false);
     // TODO: We really should work out which part to put in the summary and which to put in the remarks...
     // TODO: We really should work out which part to put in the summary and which to put in the remarks...
     // but that needs to be part of a bigger effort to understand the markdown better anyway.
     // but that needs to be part of a bigger effort to understand the markdown better anyway.
@@ -66,17 +66,18 @@ void WriteDocCommentBodyImpl(io::Printer* printer, SourceLocation location) {
     // to preserve the blank lines themselves, as this is relevant in the markdown.
     // to preserve the blank lines themselves, as this is relevant in the markdown.
     // Note that we can't remove leading or trailing whitespace as *that's* relevant in markdown too.
     // Note that we can't remove leading or trailing whitespace as *that's* relevant in markdown too.
     // (We don't skip "just whitespace" lines, either.)
     // (We don't skip "just whitespace" lines, either.)
-    for (std::vector<string>::iterator it = lines.begin(); it != lines.end(); ++it) {
-        string line = *it;
-        if (line.empty()) {
-            last_was_empty = true;
-        } else {
-            if (last_was_empty) {
-                printer->Print("///\n");
-            }
-            last_was_empty = false;
-            printer->Print("///$line$\n", "line", *it);
+    for (std::vector<std::string>::iterator it = lines.begin();
+         it != lines.end(); ++it) {
+      std::string line = *it;
+      if (line.empty()) {
+        last_was_empty = true;
+      } else {
+        if (last_was_empty) {
+          printer->Print("///\n");
         }
         }
+        last_was_empty = false;
+        printer->Print("///$line$\n", "line", *it);
+      }
     }
     }
     printer->Print("/// </summary>\n");
     printer->Print("/// </summary>\n");
 }
 }

+ 4 - 3
src/google/protobuf/compiler/csharp/csharp_enum.cc

@@ -61,12 +61,13 @@ void EnumGenerator::Generate(io::Printer* printer) {
                  "access_level", class_access_level(),
                  "access_level", class_access_level(),
                  "name", descriptor_->name());
                  "name", descriptor_->name());
   printer->Indent();
   printer->Indent();
-  std::set<string> used_names;
+  std::set<std::string> used_names;
   std::set<int> used_number;
   std::set<int> used_number;
   for (int i = 0; i < descriptor_->value_count(); i++) {
   for (int i = 0; i < descriptor_->value_count(); i++) {
       WriteEnumValueDocComment(printer, descriptor_->value(i));
       WriteEnumValueDocComment(printer, descriptor_->value(i));
-      string original_name = descriptor_->value(i)->name();
-      string name = GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name());
+      std::string original_name = descriptor_->value(i)->name();
+      std::string name =
+          GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name());
       // Make sure we don't get any duplicate names due to prefix removal.
       // Make sure we don't get any duplicate names due to prefix removal.
       while (!used_names.insert(name).second) {
       while (!used_names.insert(name).second) {
         // It's possible we'll end up giving this warning multiple times, but that's better than not at all.
         // It's possible we'll end up giving this warning multiple times, but that's better than not at all.

+ 6 - 6
src/google/protobuf/compiler/csharp/csharp_field_base.cc

@@ -51,7 +51,7 @@ namespace compiler {
 namespace csharp {
 namespace csharp {
 
 
 void FieldGeneratorBase::SetCommonFieldVariables(
 void FieldGeneratorBase::SetCommonFieldVariables(
-    std::map<string, string>* variables) {
+    std::map<std::string, std::string>* variables) {
   // Note: this will be valid even though the tag emitted for packed and unpacked versions of
   // Note: this will be valid even though the tag emitted for packed and unpacked versions of
   // repeated fields varies by wire format. The wire format is encoded in the bottom 3 bits, which
   // repeated fields varies by wire format. The wire format is encoded in the bottom 3 bits, which
   // never effects the tag size.
   // never effects the tag size.
@@ -63,7 +63,7 @@ void FieldGeneratorBase::SetCommonFieldVariables(
   uint tag = internal::WireFormat::MakeTag(descriptor_);
   uint tag = internal::WireFormat::MakeTag(descriptor_);
   uint8 tag_array[5];
   uint8 tag_array[5];
   io::CodedOutputStream::WriteTagToArray(tag, tag_array);
   io::CodedOutputStream::WriteTagToArray(tag, tag_array);
-  string tag_bytes = StrCat(tag_array[0]);
+  std::string tag_bytes = StrCat(tag_array[0]);
   for (int i = 1; i < part_tag_size; i++) {
   for (int i = 1; i < part_tag_size; i++) {
     tag_bytes += ", " + StrCat(tag_array[i]);
     tag_bytes += ", " + StrCat(tag_array[i]);
   }
   }
@@ -108,8 +108,8 @@ void FieldGeneratorBase::SetCommonFieldVariables(
     (*variables)["has_not_property_check"] = "!" + (*variables)["has_property_check"];
     (*variables)["has_not_property_check"] = "!" + (*variables)["has_property_check"];
     (*variables)["other_has_not_property_check"] = "!" + (*variables)["other_has_property_check"];
     (*variables)["other_has_not_property_check"] = "!" + (*variables)["other_has_property_check"];
     if (presenceIndex_ != -1) {
     if (presenceIndex_ != -1) {
-      string hasBitsNumber = StrCat(presenceIndex_ / 32);
-      string hasBitsMask = StrCat(1 << (presenceIndex_ % 32));
+      std::string hasBitsNumber = StrCat(presenceIndex_ / 32);
+      std::string hasBitsMask = StrCat(1 << (presenceIndex_ % 32));
       (*variables)["has_field_check"] = "(_hasBits" + hasBitsNumber + " & " + hasBitsMask + ") != 0";
       (*variables)["has_field_check"] = "(_hasBits" + hasBitsNumber + " & " + hasBitsMask + ") != 0";
       (*variables)["set_has_field"] = "_hasBits" + hasBitsNumber + " |= " + hasBitsMask;
       (*variables)["set_has_field"] = "_hasBits" + hasBitsNumber + " |= " + hasBitsMask;
       (*variables)["clear_has_field"] = "_hasBits" + hasBitsNumber + " &= ~" + hasBitsMask;
       (*variables)["clear_has_field"] = "_hasBits" + hasBitsNumber + " &= ~" + hasBitsMask;
@@ -123,7 +123,7 @@ void FieldGeneratorBase::SetCommonFieldVariables(
 }
 }
 
 
 void FieldGeneratorBase::SetCommonOneofFieldVariables(
 void FieldGeneratorBase::SetCommonOneofFieldVariables(
-    std::map<string, string>* variables) {
+    std::map<std::string, std::string>* variables) {
   (*variables)["oneof_name"] = oneof_name();
   (*variables)["oneof_name"] = oneof_name();
   if (SupportsPresenceApi(descriptor_)) {
   if (SupportsPresenceApi(descriptor_)) {
     (*variables)["has_property_check"] = "Has" + property_name();
     (*variables)["has_property_check"] = "Has" + property_name();
@@ -216,7 +216,7 @@ std::string FieldGeneratorBase::type_name(const FieldDescriptor* descriptor) {
       if (IsWrapperType(descriptor)) {
       if (IsWrapperType(descriptor)) {
         const FieldDescriptor* wrapped_field =
         const FieldDescriptor* wrapped_field =
             descriptor->message_type()->field(0);
             descriptor->message_type()->field(0);
-        string wrapped_field_type_name = type_name(wrapped_field);
+        std::string wrapped_field_type_name = type_name(wrapped_field);
         // String and ByteString go to the same type; other wrapped types
         // String and ByteString go to the same type; other wrapped types
         // go to the nullable equivalent.
         // go to the nullable equivalent.
         if (wrapped_field->type() == FieldDescriptor::TYPE_STRING ||
         if (wrapped_field->type() == FieldDescriptor::TYPE_STRING ||

+ 4 - 3
src/google/protobuf/compiler/csharp/csharp_field_base.h

@@ -74,14 +74,15 @@ class FieldGeneratorBase : public SourceGeneratorBase {
  protected:
  protected:
   const FieldDescriptor* descriptor_;
   const FieldDescriptor* descriptor_;
   const int presenceIndex_;
   const int presenceIndex_;
-  std::map<string, string> variables_;
+  std::map<std::string, std::string> variables_;
 
 
   void AddDeprecatedFlag(io::Printer* printer);
   void AddDeprecatedFlag(io::Printer* printer);
   void AddNullCheck(io::Printer* printer);
   void AddNullCheck(io::Printer* printer);
   void AddNullCheck(io::Printer* printer, const std::string& name);
   void AddNullCheck(io::Printer* printer, const std::string& name);
 
 
   void AddPublicMemberAttributes(io::Printer* printer);
   void AddPublicMemberAttributes(io::Printer* printer);
-  void SetCommonOneofFieldVariables(std::map<string, string>* variables);
+  void SetCommonOneofFieldVariables(
+      std::map<std::string, std::string>* variables);
 
 
   std::string oneof_property_name();
   std::string oneof_property_name();
   std::string oneof_name();
   std::string oneof_name();
@@ -96,7 +97,7 @@ class FieldGeneratorBase : public SourceGeneratorBase {
   std::string capitalized_type_name();
   std::string capitalized_type_name();
 
 
  private:
  private:
-  void SetCommonFieldVariables(std::map<string, string>* variables);
+  void SetCommonFieldVariables(std::map<std::string, std::string>* variables);
   std::string GetStringDefaultValueInternal(const FieldDescriptor* descriptor);
   std::string GetStringDefaultValueInternal(const FieldDescriptor* descriptor);
   std::string GetBytesDefaultValueInternal(const FieldDescriptor* descriptor);
   std::string GetBytesDefaultValueInternal(const FieldDescriptor* descriptor);
 };
 };

+ 6 - 8
src/google/protobuf/compiler/csharp/csharp_generator.cc

@@ -61,13 +61,11 @@ void GenerateFile(const FileDescriptor* file, io::Printer* printer,
   reflectionClassGenerator.Generate(printer);
   reflectionClassGenerator.Generate(printer);
 }
 }
 
 
-bool Generator::Generate(
-    const FileDescriptor* file,
-    const string& parameter,
-    GeneratorContext* generator_context,
-    string* error) const {
-
-  std::vector<std::pair<string, string> > options;
+bool Generator::Generate(const FileDescriptor* file,
+                         const std::string& parameter,
+                         GeneratorContext* generator_context,
+                         std::string* error) const {
+  std::vector<std::pair<std::string, std::string> > options;
   ParseGeneratorParameter(parameter, &options);
   ParseGeneratorParameter(parameter, &options);
 
 
   struct Options cli_options;
   struct Options cli_options;
@@ -88,7 +86,7 @@ bool Generator::Generate(
     }
     }
   }
   }
 
 
-  string filename_error = "";
+  std::string filename_error = "";
   std::string filename = GetOutputFile(file,
   std::string filename = GetOutputFile(file,
       cli_options.file_extension,
       cli_options.file_extension,
       cli_options.base_namespace_specified,
       cli_options.base_namespace_specified,

+ 2 - 2
src/google/protobuf/compiler/csharp/csharp_generator.h

@@ -54,9 +54,9 @@ class PROTOC_EXPORT Generator : public CodeGenerator {
   ~Generator();
   ~Generator();
   bool Generate(
   bool Generate(
     const FileDescriptor* file,
     const FileDescriptor* file,
-    const string& parameter,
+    const std::string& parameter,
     GeneratorContext* generator_context,
     GeneratorContext* generator_context,
-    string* error) const override;
+    std::string* error) const override;
   uint64_t GetSupportedFeatures() const override;
   uint64_t GetSupportedFeatures() const override;
 };
 };
 
 

+ 10 - 9
src/google/protobuf/compiler/csharp/csharp_helpers.cc

@@ -143,7 +143,7 @@ std::string GetExtensionClassUnqualifiedName(const FileDescriptor* descriptor) {
 std::string UnderscoresToCamelCase(const std::string& input,
 std::string UnderscoresToCamelCase(const std::string& input,
                                    bool cap_next_letter,
                                    bool cap_next_letter,
                                    bool preserve_period) {
                                    bool preserve_period) {
-  string result;
+  std::string result;
   // Note:  I distrust ctype.h due to locales.
   // Note:  I distrust ctype.h due to locales.
   for (int i = 0; i < input.size(); i++) {
   for (int i = 0; i < input.size(); i++) {
     if ('a' <= input[i] && input[i] <= 'z') {
     if ('a' <= input[i] && input[i] <= 'z') {
@@ -195,7 +195,7 @@ std::string UnderscoresToPascalCase(const std::string& input) {
 // Lower letter                  Alphanumeric              Same as current
 // Lower letter                  Alphanumeric              Same as current
 // Upper letter                  Alphanumeric              Lower
 // Upper letter                  Alphanumeric              Lower
 std::string ShoutyToPascalCase(const std::string& input) {
 std::string ShoutyToPascalCase(const std::string& input) {
-  string result;
+  std::string result;
   // Simple way of implementing "always start with upper"
   // Simple way of implementing "always start with upper"
   char previous = '_';
   char previous = '_';
   for (int i = 0; i < input.size(); i++) {
   for (int i = 0; i < input.size(); i++) {
@@ -325,7 +325,7 @@ std::string ToCSharpName(const std::string& name, const FileDescriptor* file) {
   if (!result.empty()) {
   if (!result.empty()) {
     result += '.';
     result += '.';
   }
   }
-  string classname;
+  std::string classname;
   if (file->package().empty()) {
   if (file->package().empty()) {
     classname = name;
     classname = name;
   } else {
   } else {
@@ -396,19 +396,20 @@ std::string GetPropertyName(const FieldDescriptor* descriptor) {
 std::string GetOutputFile(const FileDescriptor* descriptor,
 std::string GetOutputFile(const FileDescriptor* descriptor,
                           const std::string file_extension,
                           const std::string file_extension,
                           const bool generate_directories,
                           const bool generate_directories,
-                          const std::string base_namespace, string* error) {
-  string relative_filename = GetFileNameBase(descriptor) + file_extension;
+                          const std::string base_namespace,
+                          std::string* error) {
+  std::string relative_filename = GetFileNameBase(descriptor) + file_extension;
   if (!generate_directories) {
   if (!generate_directories) {
     return relative_filename;
     return relative_filename;
   }
   }
-  string ns = GetFileNamespace(descriptor);
-  string namespace_suffix = ns;
+  std::string ns = GetFileNamespace(descriptor);
+  std::string namespace_suffix = ns;
   if (!base_namespace.empty()) {
   if (!base_namespace.empty()) {
     // Check that the base_namespace is either equal to or a leading part of
     // Check that the base_namespace is either equal to or a leading part of
     // the file namespace. This isn't just a simple prefix; "Foo.B" shouldn't
     // the file namespace. This isn't just a simple prefix; "Foo.B" shouldn't
     // be regarded as a prefix of "Foo.Bar". The simplest option is to add "."
     // be regarded as a prefix of "Foo.Bar". The simplest option is to add "."
     // to both.
     // to both.
-    string extended_ns = ns + ".";
+    std::string extended_ns = ns + ".";
     if (extended_ns.find(base_namespace + ".") != 0) {
     if (extended_ns.find(base_namespace + ".") != 0) {
       *error = "Namespace " + ns + " is not a prefix namespace of base namespace " + base_namespace;
       *error = "Namespace " + ns + " is not a prefix namespace of base namespace " + base_namespace;
       return ""; // This will be ignored, because we've set an error.
       return ""; // This will be ignored, because we've set an error.
@@ -419,7 +420,7 @@ std::string GetOutputFile(const FileDescriptor* descriptor,
     }
     }
   }
   }
 
 
-  string namespace_dir = StringReplace(namespace_suffix, ".", "/", true);
+  std::string namespace_dir = StringReplace(namespace_suffix, ".", "/", true);
   if (!namespace_dir.empty()) {
   if (!namespace_dir.empty()) {
     namespace_dir += "/";
     namespace_dir += "/";
   }
   }

+ 1 - 1
src/google/protobuf/compiler/csharp/csharp_helpers.h

@@ -138,7 +138,7 @@ inline bool IsDescriptorOptionMessage(const Descriptor* descriptor) {
   if (!IsDescriptorProto(descriptor->file())) {
   if (!IsDescriptorProto(descriptor->file())) {
     return false;
     return false;
   }
   }
-  const string name = descriptor->full_name();
+  const std::string name = descriptor->full_name();
   return name == "google.protobuf.FileOptions" ||
   return name == "google.protobuf.FileOptions" ||
       name == "google.protobuf.MessageOptions" ||
       name == "google.protobuf.MessageOptions" ||
       name == "google.protobuf.FieldOptions" ||
       name == "google.protobuf.FieldOptions" ||

+ 5 - 5
src/google/protobuf/compiler/csharp/csharp_message.cc

@@ -112,7 +112,7 @@ void MessageGenerator::AddSerializableAttribute(io::Printer* printer) {
 }
 }
 
 
 void MessageGenerator::Generate(io::Printer* printer) {
 void MessageGenerator::Generate(io::Printer* printer) {
-  std::map<string, string> vars;
+  std::map<std::string, std::string> vars;
   vars["class_name"] = class_name();
   vars["class_name"] = class_name();
   vars["access_level"] = class_access_level();
   vars["access_level"] = class_access_level();
 
 
@@ -374,7 +374,7 @@ bool MessageGenerator::HasNestedGeneratedTypes()
 }
 }
 
 
 void MessageGenerator::GenerateCloningCode(io::Printer* printer) {
 void MessageGenerator::GenerateCloningCode(io::Printer* printer) {
-  std::map<string, string> vars;
+  std::map<std::string, std::string> vars;
   WriteGeneratedCodeAttributes(printer);
   WriteGeneratedCodeAttributes(printer);
   vars["class_name"] = class_name();
   vars["class_name"] = class_name();
     printer->Print(
     printer->Print(
@@ -438,7 +438,7 @@ void MessageGenerator::GenerateFreezingCode(io::Printer* printer) {
 }
 }
 
 
 void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
 void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
-    std::map<string, string> vars;
+    std::map<std::string, std::string> vars;
     vars["class_name"] = class_name();
     vars["class_name"] = class_name();
 
 
     // Equality
     // Equality
@@ -605,7 +605,7 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
   // Note:  These are separate from GenerateMessageSerializationMethods()
   // Note:  These are separate from GenerateMessageSerializationMethods()
   //   because they need to be generated even for messages that are optimized
   //   because they need to be generated even for messages that are optimized
   //   for code size.
   //   for code size.
-  std::map<string, string> vars;
+  std::map<std::string, std::string> vars;
   vars["class_name"] = class_name();
   vars["class_name"] = class_name();
 
 
   WriteGeneratedCodeAttributes(printer);
   WriteGeneratedCodeAttributes(printer);
@@ -685,7 +685,7 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
 }
 }
 
 
 void MessageGenerator::GenerateMainParseLoop(io::Printer* printer, bool use_parse_context) {
 void MessageGenerator::GenerateMainParseLoop(io::Printer* printer, bool use_parse_context) {
-  std::map<string, string> vars;
+  std::map<std::string, std::string> vars;
   vars["maybe_ref_input"] = use_parse_context ? "ref input" : "input";
   vars["maybe_ref_input"] = use_parse_context ? "ref input" : "input";
 
 
   printer->Print(
   printer->Print(

+ 9 - 7
src/google/protobuf/compiler/csharp/csharp_names.h

@@ -60,14 +60,14 @@ namespace csharp {
 //
 //
 // Returns:
 // Returns:
 //   The namespace to use for given file descriptor.
 //   The namespace to use for given file descriptor.
-string PROTOC_EXPORT GetFileNamespace(const FileDescriptor* descriptor);
+std::string PROTOC_EXPORT GetFileNamespace(const FileDescriptor* descriptor);
 
 
 // Requires:
 // Requires:
 //   descriptor != NULL
 //   descriptor != NULL
 //
 //
 // Returns:
 // Returns:
 //   The fully-qualified C# class name.
 //   The fully-qualified C# class name.
-string PROTOC_EXPORT GetClassName(const Descriptor* descriptor);
+std::string PROTOC_EXPORT GetClassName(const Descriptor* descriptor);
 
 
 // Requires:
 // Requires:
 //   descriptor != NULL
 //   descriptor != NULL
@@ -76,7 +76,8 @@ string PROTOC_EXPORT GetClassName(const Descriptor* descriptor);
 //   The fully-qualified name of the C# class that provides
 //   The fully-qualified name of the C# class that provides
 //   access to the file descriptor. Proto compiler generates
 //   access to the file descriptor. Proto compiler generates
 //   such class for each .proto file processed.
 //   such class for each .proto file processed.
-string PROTOC_EXPORT GetReflectionClassName(const FileDescriptor* descriptor);
+std::string PROTOC_EXPORT
+GetReflectionClassName(const FileDescriptor* descriptor);
 
 
 // Generates output file name for given file descriptor. If generate_directories
 // Generates output file name for given file descriptor. If generate_directories
 // is true, the output file will be put under directory corresponding to file's
 // is true, the output file will be put under directory corresponding to file's
@@ -92,10 +93,11 @@ string PROTOC_EXPORT GetReflectionClassName(const FileDescriptor* descriptor);
 //    The file name to use as output file for given file descriptor. In case
 //    The file name to use as output file for given file descriptor. In case
 //    of failure, this function will return empty string and error parameter
 //    of failure, this function will return empty string and error parameter
 //    will contain the error message.
 //    will contain the error message.
-string PROTOC_EXPORT GetOutputFile(const FileDescriptor* descriptor,
-                                   const string file_extension,
-                                   const bool generate_directories,
-                                   const string base_namespace, string* error);
+std::string PROTOC_EXPORT GetOutputFile(const FileDescriptor* descriptor,
+                                        const std::string file_extension,
+                                        const bool generate_directories,
+                                        const std::string base_namespace,
+                                        std::string* error);
 
 
 }  // namespace csharp
 }  // namespace csharp
 }  // namespace compiler
 }  // namespace compiler

+ 5 - 5
src/google/protobuf/compiler/objectivec/objectivec_enum.cc

@@ -65,7 +65,7 @@ EnumGenerator::EnumGenerator(const EnumDescriptor* descriptor)
       base_values_.push_back(value);
       base_values_.push_back(value);
       value_names.insert(EnumValueName(value));
       value_names.insert(EnumValueName(value));
     } else {
     } else {
-      string value_name(EnumValueName(value));
+      std::string value_name(EnumValueName(value));
       if (value_names.find(value_name) != value_names.end()) {
       if (value_names.find(value_name) != value_names.end()) {
         alias_values_to_skip_.insert(value);
         alias_values_to_skip_.insert(value);
       } else {
       } else {
@@ -79,7 +79,7 @@ EnumGenerator::EnumGenerator(const EnumDescriptor* descriptor)
 EnumGenerator::~EnumGenerator() {}
 EnumGenerator::~EnumGenerator() {}
 
 
 void EnumGenerator::GenerateHeader(io::Printer* printer) {
 void EnumGenerator::GenerateHeader(io::Printer* printer) {
-  string enum_comments;
+  std::string enum_comments;
   SourceLocation location;
   SourceLocation location;
   if (descriptor_->GetSourceLocation(&location)) {
   if (descriptor_->GetSourceLocation(&location)) {
     enum_comments = BuildCommentsString(location, true);
     enum_comments = BuildCommentsString(location, true);
@@ -129,7 +129,7 @@ void EnumGenerator::GenerateHeader(io::Printer* printer) {
     }
     }
     SourceLocation location;
     SourceLocation location;
     if (all_values_[i]->GetSourceLocation(&location)) {
     if (all_values_[i]->GetSourceLocation(&location)) {
-      string comments = BuildCommentsString(location, true).c_str();
+      std::string comments = BuildCommentsString(location, true).c_str();
       if (comments.length() > 0) {
       if (comments.length() > 0) {
         if (i > 0) {
         if (i > 0) {
           printer->Print("\n");
           printer->Print("\n");
@@ -172,11 +172,11 @@ void EnumGenerator::GenerateSource(io::Printer* printer) {
   // will be zero.
   // will be zero.
   TextFormatDecodeData text_format_decode_data;
   TextFormatDecodeData text_format_decode_data;
   int enum_value_description_key = -1;
   int enum_value_description_key = -1;
-  string text_blob;
+  std::string text_blob;
 
 
   for (int i = 0; i < all_values_.size(); i++) {
   for (int i = 0; i < all_values_.size(); i++) {
     ++enum_value_description_key;
     ++enum_value_description_key;
-    string short_name(EnumValueShortName(all_values_[i]));
+    std::string short_name(EnumValueShortName(all_values_[i]));
     text_blob += short_name + '\0';
     text_blob += short_name + '\0';
     if (UnCamelCaseEnumShortName(short_name) != all_values_[i]->name()) {
     if (UnCamelCaseEnumShortName(short_name) != all_values_[i]->name()) {
       text_format_decode_data.AddString(enum_value_description_key, short_name,
       text_format_decode_data.AddString(enum_value_description_key, short_name,

+ 2 - 2
src/google/protobuf/compiler/objectivec/objectivec_enum.h

@@ -53,14 +53,14 @@ class EnumGenerator {
   void GenerateHeader(io::Printer* printer);
   void GenerateHeader(io::Printer* printer);
   void GenerateSource(io::Printer* printer);
   void GenerateSource(io::Printer* printer);
 
 
-  const string& name() const { return name_; }
+  const std::string& name() const { return name_; }
 
 
  private:
  private:
   const EnumDescriptor* descriptor_;
   const EnumDescriptor* descriptor_;
   std::vector<const EnumValueDescriptor*> base_values_;
   std::vector<const EnumValueDescriptor*> base_values_;
   std::vector<const EnumValueDescriptor*> all_values_;
   std::vector<const EnumValueDescriptor*> all_values_;
   std::set<const EnumValueDescriptor*> alias_values_to_skip_;
   std::set<const EnumValueDescriptor*> alias_values_to_skip_;
-  const string name_;
+  const std::string name_;
 };
 };
 
 
 }  // namespace objectivec
 }  // namespace objectivec

+ 4 - 4
src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc

@@ -44,8 +44,8 @@ namespace objectivec {
 namespace {
 namespace {
 
 
 void SetEnumVariables(const FieldDescriptor* descriptor,
 void SetEnumVariables(const FieldDescriptor* descriptor,
-                      std::map<string, string>* variables) {
-  string type = EnumName(descriptor->enum_type());
+                      std::map<std::string, std::string>* variables) {
+  std::string type = EnumName(descriptor->enum_type());
   (*variables)["storage_type"] = type;
   (*variables)["storage_type"] = type;
   // For non repeated fields, if it was defined in a different file, the
   // For non repeated fields, if it was defined in a different file, the
   // property decls need to use "enum NAME" rather than just "NAME" to support
   // property decls need to use "enum NAME" rather than just "NAME" to support
@@ -116,14 +116,14 @@ void EnumFieldGenerator::GenerateCFunctionImplementations(
 }
 }
 
 
 void EnumFieldGenerator::DetermineForwardDeclarations(
 void EnumFieldGenerator::DetermineForwardDeclarations(
-    std::set<string>* fwd_decls) const {
+    std::set<std::string>* fwd_decls) const {
   SingleFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   SingleFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   // If it is an enum defined in a different file, then we'll need a forward
   // If it is an enum defined in a different file, then we'll need a forward
   // declaration for it.  When it is in our file, all the enums are output
   // declaration for it.  When it is in our file, all the enums are output
   // before the message, so it will be declared before it is needed.
   // before the message, so it will be declared before it is needed.
   if (descriptor_->file() != descriptor_->enum_type()->file()) {
   if (descriptor_->file() != descriptor_->enum_type()->file()) {
     // Enum name is already in "storage_type".
     // Enum name is already in "storage_type".
-    const string& name = variable("storage_type");
+    const std::string& name = variable("storage_type");
     fwd_decls->insert("GPB_ENUM_FWD_DECLARE(" + name + ")");
     fwd_decls->insert("GPB_ENUM_FWD_DECLARE(" + name + ")");
   }
   }
 }
 }

+ 2 - 1
src/google/protobuf/compiler/objectivec/objectivec_enum_field.h

@@ -50,7 +50,8 @@ class EnumFieldGenerator : public SingleFieldGenerator {
  public:
  public:
   virtual void GenerateCFunctionDeclarations(io::Printer* printer) const;
   virtual void GenerateCFunctionDeclarations(io::Printer* printer) const;
   virtual void GenerateCFunctionImplementations(io::Printer* printer) const;
   virtual void GenerateCFunctionImplementations(io::Printer* printer) const;
-  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(
+      std::set<std::string>* fwd_decls) const;
 
 
  protected:
  protected:
   EnumFieldGenerator(const FieldDescriptor* descriptor, const Options& options);
   EnumFieldGenerator(const FieldDescriptor* descriptor, const Options& options);

+ 10 - 10
src/google/protobuf/compiler/objectivec/objectivec_extension.cc

@@ -41,7 +41,7 @@ namespace protobuf {
 namespace compiler {
 namespace compiler {
 namespace objectivec {
 namespace objectivec {
 
 
-ExtensionGenerator::ExtensionGenerator(const string& root_class_name,
+ExtensionGenerator::ExtensionGenerator(const std::string& root_class_name,
                                        const FieldDescriptor* descriptor)
                                        const FieldDescriptor* descriptor)
     : method_name_(ExtensionMethodName(descriptor)),
     : method_name_(ExtensionMethodName(descriptor)),
       root_class_and_method_name_(root_class_name + "_" + method_name_),
       root_class_and_method_name_(root_class_name + "_" + method_name_),
@@ -59,7 +59,7 @@ ExtensionGenerator::ExtensionGenerator(const string& root_class_name,
 ExtensionGenerator::~ExtensionGenerator() {}
 ExtensionGenerator::~ExtensionGenerator() {}
 
 
 void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) {
 void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) {
-  std::map<string, string> vars;
+  std::map<std::string, std::string> vars;
   vars["method_name"] = method_name_;
   vars["method_name"] = method_name_;
   if (IsRetainedName(method_name_)) {
   if (IsRetainedName(method_name_)) {
     vars["storage_attribute"] = " NS_RETURNS_NOT_RETAINED";
     vars["storage_attribute"] = " NS_RETURNS_NOT_RETAINED";
@@ -82,13 +82,13 @@ void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) {
 
 
 void ExtensionGenerator::GenerateStaticVariablesInitialization(
 void ExtensionGenerator::GenerateStaticVariablesInitialization(
     io::Printer* printer) {
     io::Printer* printer) {
-  std::map<string, string> vars;
+  std::map<std::string, std::string> vars;
   vars["root_class_and_method_name"] = root_class_and_method_name_;
   vars["root_class_and_method_name"] = root_class_and_method_name_;
-  const string containing_type = ClassName(descriptor_->containing_type());
+  const std::string containing_type = ClassName(descriptor_->containing_type());
   vars["extended_type"] = ObjCClass(containing_type);
   vars["extended_type"] = ObjCClass(containing_type);
   vars["number"] = StrCat(descriptor_->number());
   vars["number"] = StrCat(descriptor_->number());
 
 
-  std::vector<string> options;
+  std::vector<std::string> options;
   if (descriptor_->is_repeated()) options.push_back("GPBExtensionRepeated");
   if (descriptor_->is_repeated()) options.push_back("GPBExtensionRepeated");
   if (descriptor_->is_packed()) options.push_back("GPBExtensionPacked");
   if (descriptor_->is_packed()) options.push_back("GPBExtensionPacked");
   if (descriptor_->containing_type()->options().message_set_wire_format()) {
   if (descriptor_->containing_type()->options().message_set_wire_format()) {
@@ -110,8 +110,8 @@ void ExtensionGenerator::GenerateStaticVariablesInitialization(
   } else {
   } else {
     vars["default"] = DefaultValue(descriptor_);
     vars["default"] = DefaultValue(descriptor_);
   }
   }
-  string type = GetCapitalizedType(descriptor_);
-  vars["extension_type"] = string("GPBDataType") + type;
+  std::string type = GetCapitalizedType(descriptor_);
+  vars["extension_type"] = std::string("GPBDataType") + type;
 
 
   if (objc_type == OBJECTIVECTYPE_ENUM) {
   if (objc_type == OBJECTIVECTYPE_ENUM) {
     vars["enum_desc_func_name"] =
     vars["enum_desc_func_name"] =
@@ -134,12 +134,12 @@ void ExtensionGenerator::GenerateStaticVariablesInitialization(
 }
 }
 
 
 void ExtensionGenerator::DetermineObjectiveCClassDefinitions(
 void ExtensionGenerator::DetermineObjectiveCClassDefinitions(
-    std::set<string>* fwd_decls) {
-  string extended_type = ClassName(descriptor_->containing_type());
+    std::set<std::string>* fwd_decls) {
+  std::string extended_type = ClassName(descriptor_->containing_type());
   fwd_decls->insert(ObjCClassDeclaration(extended_type));
   fwd_decls->insert(ObjCClassDeclaration(extended_type));
   ObjectiveCType objc_type = GetObjectiveCType(descriptor_);
   ObjectiveCType objc_type = GetObjectiveCType(descriptor_);
   if (objc_type == OBJECTIVECTYPE_MESSAGE) {
   if (objc_type == OBJECTIVECTYPE_MESSAGE) {
-    string message_type = ClassName(descriptor_->message_type());
+    std::string message_type = ClassName(descriptor_->message_type());
     fwd_decls->insert(ObjCClassDeclaration(message_type));
     fwd_decls->insert(ObjCClassDeclaration(message_type));
   }
   }
 }
 }

+ 4 - 4
src/google/protobuf/compiler/objectivec/objectivec_extension.h

@@ -41,7 +41,7 @@ namespace objectivec {
 
 
 class ExtensionGenerator {
 class ExtensionGenerator {
  public:
  public:
-  ExtensionGenerator(const string& root_class_name,
+  ExtensionGenerator(const std::string& root_class_name,
                      const FieldDescriptor* descriptor);
                      const FieldDescriptor* descriptor);
   ~ExtensionGenerator();
   ~ExtensionGenerator();
 
 
@@ -51,11 +51,11 @@ class ExtensionGenerator {
   void GenerateMembersHeader(io::Printer* printer);
   void GenerateMembersHeader(io::Printer* printer);
   void GenerateStaticVariablesInitialization(io::Printer* printer);
   void GenerateStaticVariablesInitialization(io::Printer* printer);
   void GenerateRegistrationSource(io::Printer* printer);
   void GenerateRegistrationSource(io::Printer* printer);
-  void DetermineObjectiveCClassDefinitions(std::set<string>* fwd_decls);
+  void DetermineObjectiveCClassDefinitions(std::set<std::string>* fwd_decls);
 
 
  private:
  private:
-  string method_name_;
-  string root_class_and_method_name_;
+  std::string method_name_;
+  std::string root_class_and_method_name_;
   const FieldDescriptor* descriptor_;
   const FieldDescriptor* descriptor_;
 };
 };
 
 

+ 9 - 9
src/google/protobuf/compiler/objectivec/objectivec_field.cc

@@ -48,16 +48,16 @@ namespace objectivec {
 namespace {
 namespace {
 
 
 void SetCommonFieldVariables(const FieldDescriptor* descriptor,
 void SetCommonFieldVariables(const FieldDescriptor* descriptor,
-                             std::map<string, string>* variables) {
-  string camel_case_name = FieldName(descriptor);
-  string raw_field_name;
+                             std::map<std::string, std::string>* variables) {
+  std::string camel_case_name = FieldName(descriptor);
+  std::string raw_field_name;
   if (descriptor->type() == FieldDescriptor::TYPE_GROUP) {
   if (descriptor->type() == FieldDescriptor::TYPE_GROUP) {
     raw_field_name = descriptor->message_type()->name();
     raw_field_name = descriptor->message_type()->name();
   } else {
   } else {
     raw_field_name = descriptor->name();
     raw_field_name = descriptor->name();
   }
   }
   // The logic here has to match -[GGPBFieldDescriptor textFormatName].
   // The logic here has to match -[GGPBFieldDescriptor textFormatName].
-  const string un_camel_case_name(
+  const std::string un_camel_case_name(
       UnCamelCaseFieldName(camel_case_name, descriptor));
       UnCamelCaseFieldName(camel_case_name, descriptor));
   const bool needs_custom_name = (raw_field_name != un_camel_case_name);
   const bool needs_custom_name = (raw_field_name != un_camel_case_name);
 
 
@@ -67,10 +67,10 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor,
   } else {
   } else {
     (*variables)["comments"] = "\n";
     (*variables)["comments"] = "\n";
   }
   }
-  const string& classname = ClassName(descriptor->containing_type());
+  const std::string& classname = ClassName(descriptor->containing_type());
   (*variables)["classname"] = classname;
   (*variables)["classname"] = classname;
   (*variables)["name"] = camel_case_name;
   (*variables)["name"] = camel_case_name;
-  const string& capitalized_name = FieldNameCapitalized(descriptor);
+  const std::string& capitalized_name = FieldNameCapitalized(descriptor);
   (*variables)["capitalized_name"] = capitalized_name;
   (*variables)["capitalized_name"] = capitalized_name;
   (*variables)["raw_field_name"] = raw_field_name;
   (*variables)["raw_field_name"] = raw_field_name;
   (*variables)["field_number_name"] =
   (*variables)["field_number_name"] =
@@ -78,7 +78,7 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor,
   (*variables)["field_number"] = StrCat(descriptor->number());
   (*variables)["field_number"] = StrCat(descriptor->number());
   (*variables)["field_type"] = GetCapitalizedType(descriptor);
   (*variables)["field_type"] = GetCapitalizedType(descriptor);
   (*variables)["deprecated_attribute"] = GetOptionalDeprecatedAttribute(descriptor);
   (*variables)["deprecated_attribute"] = GetOptionalDeprecatedAttribute(descriptor);
-  std::vector<string> field_flags;
+  std::vector<std::string> field_flags;
   if (descriptor->is_repeated()) field_flags.push_back("GPBFieldRepeated");
   if (descriptor->is_repeated()) field_flags.push_back("GPBFieldRepeated");
   if (descriptor->is_required()) field_flags.push_back("GPBFieldRequired");
   if (descriptor->is_required()) field_flags.push_back("GPBFieldRequired");
   if (descriptor->is_optional()) field_flags.push_back("GPBFieldOptional");
   if (descriptor->is_optional()) field_flags.push_back("GPBFieldOptional");
@@ -185,12 +185,12 @@ void FieldGenerator::GenerateCFunctionImplementations(
 }
 }
 
 
 void FieldGenerator::DetermineForwardDeclarations(
 void FieldGenerator::DetermineForwardDeclarations(
-    std::set<string>* fwd_decls) const {
+    std::set<std::string>* fwd_decls) const {
   // Nothing
   // Nothing
 }
 }
 
 
 void FieldGenerator::DetermineObjectiveCClassDefinitions(
 void FieldGenerator::DetermineObjectiveCClassDefinitions(
-    std::set<string>* fwd_decls) const {
+    std::set<std::string>* fwd_decls) const {
   // Nothing
   // Nothing
 }
 }
 
 

+ 11 - 8
src/google/protobuf/compiler/objectivec/objectivec_field.h

@@ -65,8 +65,10 @@ class FieldGenerator {
   virtual void GenerateCFunctionImplementations(io::Printer* printer) const;
   virtual void GenerateCFunctionImplementations(io::Printer* printer) const;
 
 
   // Exposed for subclasses, should always call it on the parent class also.
   // Exposed for subclasses, should always call it on the parent class also.
-  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
-  virtual void DetermineObjectiveCClassDefinitions(std::set<string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(
+      std::set<std::string>* fwd_decls) const;
+  virtual void DetermineObjectiveCClassDefinitions(
+      std::set<std::string>* fwd_decls) const;
 
 
   // Used during generation, not intended to be extended by subclasses.
   // Used during generation, not intended to be extended by subclasses.
   void GenerateFieldDescription(
   void GenerateFieldDescription(
@@ -81,16 +83,17 @@ class FieldGenerator {
   virtual void SetExtraRuntimeHasBitsBase(int index_base);
   virtual void SetExtraRuntimeHasBitsBase(int index_base);
   void SetOneofIndexBase(int index_base);
   void SetOneofIndexBase(int index_base);
 
 
-  string variable(const char* key) const {
+  std::string variable(const char* key) const {
     return variables_.find(key)->second;
     return variables_.find(key)->second;
   }
   }
 
 
   bool needs_textformat_name_support() const {
   bool needs_textformat_name_support() const {
-    const string& field_flags = variable("fieldflags");
-    return field_flags.find("GPBFieldTextFormatNameCustom") != string::npos;
+    const std::string& field_flags = variable("fieldflags");
+    return field_flags.find("GPBFieldTextFormatNameCustom") !=
+           std::string::npos;
   }
   }
-  string generated_objc_name() const { return variable("name"); }
-  string raw_field_name() const { return variable("raw_field_name"); }
+  std::string generated_objc_name() const { return variable("name"); }
+  std::string raw_field_name() const { return variable("raw_field_name"); }
 
 
  protected:
  protected:
   FieldGenerator(const FieldDescriptor* descriptor, const Options& options);
   FieldGenerator(const FieldDescriptor* descriptor, const Options& options);
@@ -99,7 +102,7 @@ class FieldGenerator {
   bool WantsHasProperty(void) const;
   bool WantsHasProperty(void) const;
 
 
   const FieldDescriptor* descriptor_;
   const FieldDescriptor* descriptor_;
-  std::map<string, string> variables_;
+  std::map<std::string, std::string> variables_;
 };
 };
 
 
 class SingleFieldGenerator : public FieldGenerator {
 class SingleFieldGenerator : public FieldGenerator {

+ 12 - 11
src/google/protobuf/compiler/objectivec/objectivec_file.cc

@@ -209,7 +209,7 @@ FileGenerator::FileGenerator(const FileDescriptor *file, const Options& options)
 FileGenerator::~FileGenerator() {}
 FileGenerator::~FileGenerator() {}
 
 
 void FileGenerator::GenerateHeader(io::Printer *printer) {
 void FileGenerator::GenerateHeader(io::Printer *printer) {
-  std::vector<string> headers;
+  std::vector<std::string> headers;
   // Generated files bundled with the library get minimal imports, everything
   // Generated files bundled with the library get minimal imports, everything
   // else gets the wrapper so everything is usable.
   // else gets the wrapper so everything is usable.
   if (is_bundled_proto_) {
   if (is_bundled_proto_) {
@@ -244,7 +244,7 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
         options_.named_framework_to_proto_path_mappings_path,
         options_.named_framework_to_proto_path_mappings_path,
         options_.runtime_import_prefix,
         options_.runtime_import_prefix,
         is_bundled_proto_);
         is_bundled_proto_);
-    const string header_extension(kHeaderExtension);
+    const std::string header_extension(kHeaderExtension);
     for (int i = 0; i < file_->public_dependency_count(); i++) {
     for (int i = 0; i < file_->public_dependency_count(); i++) {
       import_writer.AddFile(file_->public_dependency(i), header_extension);
       import_writer.AddFile(file_->public_dependency(i), header_extension);
     }
     }
@@ -264,11 +264,11 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
       "CF_EXTERN_C_BEGIN\n"
       "CF_EXTERN_C_BEGIN\n"
       "\n");
       "\n");
 
 
-  std::set<string> fwd_decls;
+  std::set<std::string> fwd_decls;
   for (const auto& generator : message_generators_) {
   for (const auto& generator : message_generators_) {
     generator->DetermineForwardDeclarations(&fwd_decls);
     generator->DetermineForwardDeclarations(&fwd_decls);
   }
   }
-  for (std::set<string>::const_iterator i(fwd_decls.begin());
+  for (std::set<std::string>::const_iterator i(fwd_decls.begin());
        i != fwd_decls.end(); ++i) {
        i != fwd_decls.end(); ++i) {
     printer->Print("$value$;\n", "value", *i);
     printer->Print("$value$;\n", "value", *i);
   }
   }
@@ -338,7 +338,7 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
 
 
 void FileGenerator::GenerateSource(io::Printer *printer) {
 void FileGenerator::GenerateSource(io::Printer *printer) {
   // #import the runtime support.
   // #import the runtime support.
-  std::vector<string> headers;
+  std::vector<std::string> headers;
   headers.push_back("GPBProtocolBuffers_RuntimeSupport.h");
   headers.push_back("GPBProtocolBuffers_RuntimeSupport.h");
   PrintFileRuntimePreamble(printer, headers);
   PrintFileRuntimePreamble(printer, headers);
 
 
@@ -358,14 +358,14 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
         options_.named_framework_to_proto_path_mappings_path,
         options_.named_framework_to_proto_path_mappings_path,
         options_.runtime_import_prefix,
         options_.runtime_import_prefix,
         is_bundled_proto_);
         is_bundled_proto_);
-    const string header_extension(kHeaderExtension);
+    const std::string header_extension(kHeaderExtension);
 
 
     // #import the header for this proto file.
     // #import the header for this proto file.
     import_writer.AddFile(file_, header_extension);
     import_writer.AddFile(file_, header_extension);
 
 
     // #import the headers for anything that a plain dependency of this proto
     // #import the headers for anything that a plain dependency of this proto
     // file (that means they were just an include, not a "public" include).
     // file (that means they were just an include, not a "public" include).
-    std::set<string> public_import_names;
+    std::set<std::string> public_import_names;
     for (int i = 0; i < file_->public_dependency_count(); i++) {
     for (int i = 0; i < file_->public_dependency_count(); i++) {
       public_import_names.insert(file_->public_dependency(i)->name());
       public_import_names.insert(file_->public_dependency(i)->name());
     }
     }
@@ -400,7 +400,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
     }
     }
   }
   }
 
 
-  std::set<string> fwd_decls;
+  std::set<std::string> fwd_decls;
   for (const auto& generator : message_generators_) {
   for (const auto& generator : message_generators_) {
     generator->DetermineObjectiveCClassDefinitions(&fwd_decls);
     generator->DetermineObjectiveCClassDefinitions(&fwd_decls);
   }
   }
@@ -501,7 +501,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
       for (std::vector<const FileDescriptor *>::iterator iter =
       for (std::vector<const FileDescriptor *>::iterator iter =
                deps_with_extensions.begin();
                deps_with_extensions.begin();
            iter != deps_with_extensions.end(); ++iter) {
            iter != deps_with_extensions.end(); ++iter) {
-        const string root_class_name(FileClassName((*iter)));
+        const std::string root_class_name(FileClassName((*iter)));
         printer->Print(
         printer->Print(
             "[registry addExtensions:[$dependency$ extensionRegistry]];\n",
             "[registry addExtensions:[$dependency$ extensionRegistry]];\n",
             "dependency", root_class_name);
             "dependency", root_class_name);
@@ -531,7 +531,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
 
 
   // File descriptor only needed if there are messages to use it.
   // File descriptor only needed if there are messages to use it.
   if (!message_generators_.empty()) {
   if (!message_generators_.empty()) {
-    std::map<string, string> vars;
+    std::map<std::string, std::string> vars;
     vars["root_class_name"] = root_class_name_;
     vars["root_class_name"] = root_class_name_;
     vars["package"] = file_->package();
     vars["package"] = file_->package();
     vars["objc_prefix"] = FileClassPrefix(file_);
     vars["objc_prefix"] = FileClassPrefix(file_);
@@ -592,7 +592,8 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
 // files. This currently only supports the runtime coming from a framework
 // files. This currently only supports the runtime coming from a framework
 // as defined by the official CocoaPod.
 // as defined by the official CocoaPod.
 void FileGenerator::PrintFileRuntimePreamble(
 void FileGenerator::PrintFileRuntimePreamble(
-    io::Printer* printer, const std::vector<string>& headers_to_import) const {
+    io::Printer* printer,
+    const std::vector<std::string>& headers_to_import) const {
   printer->Print(
   printer->Print(
       "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n"
       "// Generated by the protocol buffer compiler.  DO NOT EDIT!\n"
       "// source: $filename$\n"
       "// source: $filename$\n"

+ 4 - 3
src/google/protobuf/compiler/objectivec/objectivec_file.h

@@ -58,11 +58,11 @@ class FileGenerator {
   void GenerateSource(io::Printer* printer);
   void GenerateSource(io::Printer* printer);
   void GenerateHeader(io::Printer* printer);
   void GenerateHeader(io::Printer* printer);
 
 
-  const string& RootClassName() const { return root_class_name_; }
+  const std::string& RootClassName() const { return root_class_name_; }
 
 
  private:
  private:
   const FileDescriptor* file_;
   const FileDescriptor* file_;
-  string root_class_name_;
+  std::string root_class_name_;
   bool is_bundled_proto_;
   bool is_bundled_proto_;
 
 
   std::vector<std::unique_ptr<EnumGenerator>> enum_generators_;
   std::vector<std::unique_ptr<EnumGenerator>> enum_generators_;
@@ -72,7 +72,8 @@ class FileGenerator {
   const Options options_;
   const Options options_;
 
 
   void PrintFileRuntimePreamble(
   void PrintFileRuntimePreamble(
-      io::Printer* printer, const std::vector<string>& headers_to_import) const;
+      io::Printer* printer,
+      const std::vector<std::string>& headers_to_import) const;
 };
 };
 
 
 }  // namespace objectivec
 }  // namespace objectivec

+ 8 - 8
src/google/protobuf/compiler/objectivec/objectivec_generator.cc

@@ -50,17 +50,17 @@ bool ObjectiveCGenerator::HasGenerateAll() const {
 }
 }
 
 
 bool ObjectiveCGenerator::Generate(const FileDescriptor* file,
 bool ObjectiveCGenerator::Generate(const FileDescriptor* file,
-                                   const string& parameter,
+                                   const std::string& parameter,
                                    GeneratorContext* context,
                                    GeneratorContext* context,
-                                   string* error) const {
+                                   std::string* error) const {
   *error = "Unimplemented Generate() method. Call GenerateAll() instead.";
   *error = "Unimplemented Generate() method. Call GenerateAll() instead.";
   return false;
   return false;
 }
 }
 
 
-bool ObjectiveCGenerator::GenerateAll(const std::vector<const FileDescriptor*>& files,
-                                      const string& parameter,
-                                      GeneratorContext* context,
-                                      string* error) const {
+bool ObjectiveCGenerator::GenerateAll(
+    const std::vector<const FileDescriptor*>& files,
+    const std::string& parameter, GeneratorContext* context,
+    std::string* error) const {
   // -----------------------------------------------------------------
   // -----------------------------------------------------------------
   // Parse generator options. These options are passed to the compiler using the
   // Parse generator options. These options are passed to the compiler using the
   // --objc_opt flag. The options are passed as a comma separated list of
   // --objc_opt flag. The options are passed as a comma separated list of
@@ -71,7 +71,7 @@ bool ObjectiveCGenerator::GenerateAll(const std::vector<const FileDescriptor*>&
 
 
   Options generation_options;
   Options generation_options;
 
 
-  std::vector<std::pair<string, string> > options;
+  std::vector<std::pair<std::string, std::string> > options;
   ParseGeneratorParameter(parameter, &options);
   ParseGeneratorParameter(parameter, &options);
   for (int i = 0; i < options.size(); i++) {
   for (int i = 0; i < options.size(); i++) {
     if (options[i].first == "expected_prefixes_path") {
     if (options[i].first == "expected_prefixes_path") {
@@ -154,7 +154,7 @@ bool ObjectiveCGenerator::GenerateAll(const std::vector<const FileDescriptor*>&
   for (int i = 0; i < files.size(); i++) {
   for (int i = 0; i < files.size(); i++) {
     const FileDescriptor* file = files[i];
     const FileDescriptor* file = files[i];
     FileGenerator file_generator(file, generation_options);
     FileGenerator file_generator(file, generation_options);
-    string filepath = FilePath(file);
+    std::string filepath = FilePath(file);
 
 
     // Generate header.
     // Generate header.
     {
     {

+ 4 - 7
src/google/protobuf/compiler/objectivec/objectivec_generator.h

@@ -58,14 +58,11 @@ class PROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator {
 
 
   // implements CodeGenerator ----------------------------------------
   // implements CodeGenerator ----------------------------------------
   bool HasGenerateAll() const override;
   bool HasGenerateAll() const override;
-  bool Generate(const FileDescriptor* file,
-                const string& parameter,
-                GeneratorContext* context,
-                string* error) const override;
+  bool Generate(const FileDescriptor* file, const std::string& parameter,
+                GeneratorContext* context, std::string* error) const override;
   bool GenerateAll(const std::vector<const FileDescriptor*>& files,
   bool GenerateAll(const std::vector<const FileDescriptor*>& files,
-                   const string& parameter,
-                   GeneratorContext* context,
-                   string* error) const override;
+                   const std::string& parameter, GeneratorContext* context,
+                   std::string* error) const override;
 
 
   uint64_t GetSupportedFeatures() const override {
   uint64_t GetSupportedFeatures() const override {
     return FEATURE_PROTO3_OPTIONAL;
     return FEATURE_PROTO3_OPTIONAL;

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 191 - 188
src/google/protobuf/compiler/objectivec/objectivec_helpers.cc


+ 75 - 74
src/google/protobuf/compiler/objectivec/objectivec_helpers.h

@@ -49,83 +49,83 @@ namespace objectivec {
 // Generator options (see objectivec_generator.cc for a description of each):
 // Generator options (see objectivec_generator.cc for a description of each):
 struct Options {
 struct Options {
   Options();
   Options();
-  string expected_prefixes_path;
-  std::vector<string> expected_prefixes_suppressions;
-  string generate_for_named_framework;
-  string named_framework_to_proto_path_mappings_path;
-  string runtime_import_prefix;
+  std::string expected_prefixes_path;
+  std::vector<std::string> expected_prefixes_suppressions;
+  std::string generate_for_named_framework;
+  std::string named_framework_to_proto_path_mappings_path;
+  std::string runtime_import_prefix;
 };
 };
 
 
 // Escape C++ trigraphs by escaping question marks to "\?".
 // Escape C++ trigraphs by escaping question marks to "\?".
-string PROTOC_EXPORT EscapeTrigraphs(const string& to_escape);
+std::string PROTOC_EXPORT EscapeTrigraphs(const std::string& to_escape);
 
 
 // Strips ".proto" or ".protodevel" from the end of a filename.
 // Strips ".proto" or ".protodevel" from the end of a filename.
-string PROTOC_EXPORT StripProto(const string& filename);
+std::string PROTOC_EXPORT StripProto(const std::string& filename);
 
 
 // Remove white space from either end of a StringPiece.
 // Remove white space from either end of a StringPiece.
 void PROTOC_EXPORT TrimWhitespace(StringPiece* input);
 void PROTOC_EXPORT TrimWhitespace(StringPiece* input);
 
 
 // Returns true if the name requires a ns_returns_not_retained attribute applied
 // Returns true if the name requires a ns_returns_not_retained attribute applied
 // to it.
 // to it.
-bool PROTOC_EXPORT IsRetainedName(const string& name);
+bool PROTOC_EXPORT IsRetainedName(const std::string& name);
 
 
 // Returns true if the name starts with "init" and will need to have special
 // Returns true if the name starts with "init" and will need to have special
 // handling under ARC.
 // handling under ARC.
-bool PROTOC_EXPORT IsInitName(const string& name);
+bool PROTOC_EXPORT IsInitName(const std::string& name);
 
 
 // Gets the objc_class_prefix.
 // Gets the objc_class_prefix.
-string PROTOC_EXPORT FileClassPrefix(const FileDescriptor* file);
+std::string PROTOC_EXPORT FileClassPrefix(const FileDescriptor* file);
 
 
 // Gets the path of the file we're going to generate (sans the .pb.h
 // Gets the path of the file we're going to generate (sans the .pb.h
 // extension).  The path will be dependent on the objectivec package
 // extension).  The path will be dependent on the objectivec package
 // declared in the proto package.
 // declared in the proto package.
-string PROTOC_EXPORT FilePath(const FileDescriptor* file);
+std::string PROTOC_EXPORT FilePath(const FileDescriptor* file);
 
 
 // Just like FilePath(), but without the directory part.
 // Just like FilePath(), but without the directory part.
-string PROTOC_EXPORT FilePathBasename(const FileDescriptor* file);
+std::string PROTOC_EXPORT FilePathBasename(const FileDescriptor* file);
 
 
 // Gets the name of the root class we'll generate in the file.  This class
 // Gets the name of the root class we'll generate in the file.  This class
 // is not meant for external consumption, but instead contains helpers that
 // is not meant for external consumption, but instead contains helpers that
 // the rest of the classes need
 // the rest of the classes need
-string PROTOC_EXPORT FileClassName(const FileDescriptor* file);
+std::string PROTOC_EXPORT FileClassName(const FileDescriptor* file);
 
 
 // These return the fully-qualified class name corresponding to the given
 // These return the fully-qualified class name corresponding to the given
 // descriptor.
 // descriptor.
-string PROTOC_EXPORT ClassName(const Descriptor* descriptor);
-string PROTOC_EXPORT ClassName(const Descriptor* descriptor,
-                               string* out_suffix_added);
-string PROTOC_EXPORT EnumName(const EnumDescriptor* descriptor);
+std::string PROTOC_EXPORT ClassName(const Descriptor* descriptor);
+std::string PROTOC_EXPORT ClassName(const Descriptor* descriptor,
+                               std::string* out_suffix_added);
+std::string PROTOC_EXPORT EnumName(const EnumDescriptor* descriptor);
 
 
 // Returns the fully-qualified name of the enum value corresponding to the
 // Returns the fully-qualified name of the enum value corresponding to the
 // the descriptor.
 // the descriptor.
-string PROTOC_EXPORT EnumValueName(const EnumValueDescriptor* descriptor);
+std::string PROTOC_EXPORT EnumValueName(const EnumValueDescriptor* descriptor);
 
 
 // Returns the name of the enum value corresponding to the descriptor.
 // Returns the name of the enum value corresponding to the descriptor.
-string PROTOC_EXPORT EnumValueShortName(const EnumValueDescriptor* descriptor);
+std::string PROTOC_EXPORT EnumValueShortName(const EnumValueDescriptor* descriptor);
 
 
 // Reverse what an enum does.
 // Reverse what an enum does.
-string PROTOC_EXPORT UnCamelCaseEnumShortName(const string& name);
+std::string PROTOC_EXPORT UnCamelCaseEnumShortName(const std::string& name);
 
 
 // Returns the name to use for the extension (used as the method off the file's
 // Returns the name to use for the extension (used as the method off the file's
 // Root class).
 // Root class).
-string PROTOC_EXPORT ExtensionMethodName(const FieldDescriptor* descriptor);
+std::string PROTOC_EXPORT ExtensionMethodName(const FieldDescriptor* descriptor);
 
 
 // Returns the transformed field name.
 // Returns the transformed field name.
-string PROTOC_EXPORT FieldName(const FieldDescriptor* field);
-string PROTOC_EXPORT FieldNameCapitalized(const FieldDescriptor* field);
+std::string PROTOC_EXPORT FieldName(const FieldDescriptor* field);
+std::string PROTOC_EXPORT FieldNameCapitalized(const FieldDescriptor* field);
 
 
 // Returns the transformed oneof name.
 // Returns the transformed oneof name.
-string PROTOC_EXPORT OneofEnumName(const OneofDescriptor* descriptor);
-string PROTOC_EXPORT OneofName(const OneofDescriptor* descriptor);
-string PROTOC_EXPORT OneofNameCapitalized(const OneofDescriptor* descriptor);
+std::string PROTOC_EXPORT OneofEnumName(const OneofDescriptor* descriptor);
+std::string PROTOC_EXPORT OneofName(const OneofDescriptor* descriptor);
+std::string PROTOC_EXPORT OneofNameCapitalized(const OneofDescriptor* descriptor);
 
 
 // Returns a symbol that can be used in C code to refer to an Objective C
 // Returns a symbol that can be used in C code to refer to an Objective C
 // class without initializing the class.
 // class without initializing the class.
-string PROTOC_EXPORT ObjCClass(const string& class_name);
+std::string PROTOC_EXPORT ObjCClass(const std::string& class_name);
 
 
 // Declares an Objective C class without initializing the class so that it can
 // Declares an Objective C class without initializing the class so that it can
 // be refrerred to by ObjCClass.
 // be refrerred to by ObjCClass.
-string PROTOC_EXPORT ObjCClassDeclaration(const string& class_name);
+std::string PROTOC_EXPORT ObjCClassDeclaration(const std::string& class_name);
 
 
 inline bool HasPreservingUnknownEnumSemantics(const FileDescriptor* file) {
 inline bool HasPreservingUnknownEnumSemantics(const FileDescriptor* file) {
   return file->syntax() == FileDescriptor::SYNTAX_PROTO3;
   return file->syntax() == FileDescriptor::SYNTAX_PROTO3;
@@ -136,8 +136,8 @@ inline bool IsMapEntryMessage(const Descriptor* descriptor) {
 }
 }
 
 
 // Reverse of the above.
 // Reverse of the above.
-string PROTOC_EXPORT UnCamelCaseFieldName(const string& name,
-                                          const FieldDescriptor* field);
+std::string PROTOC_EXPORT UnCamelCaseFieldName(const std::string& name,
+                                               const FieldDescriptor* field);
 
 
 enum ObjectiveCType {
 enum ObjectiveCType {
   OBJECTIVECTYPE_INT32,
   OBJECTIVECTYPE_INT32,
@@ -159,11 +159,11 @@ enum FlagType {
   FLAGTYPE_FIELD
   FLAGTYPE_FIELD
 };
 };
 
 
-template<class TDescriptor>
-string GetOptionalDeprecatedAttribute(
-    const TDescriptor* descriptor,
-    const FileDescriptor* file = NULL,
-    bool preSpace = true, bool postNewline = false) {
+template <class TDescriptor>
+std::string GetOptionalDeprecatedAttribute(const TDescriptor* descriptor,
+                                           const FileDescriptor* file = NULL,
+                                           bool preSpace = true,
+                                           bool postNewline = false) {
   bool isDeprecated = descriptor->options().deprecated();
   bool isDeprecated = descriptor->options().deprecated();
   // The file is only passed when checking Messages & Enums, so those types
   // The file is only passed when checking Messages & Enums, so those types
   // get tagged. At the moment, it doesn't seem to make sense to tag every
   // get tagged. At the moment, it doesn't seem to make sense to tag every
@@ -174,7 +174,7 @@ string GetOptionalDeprecatedAttribute(
     isDeprecated = isFileLevelDeprecation;
     isDeprecated = isFileLevelDeprecation;
   }
   }
   if (isDeprecated) {
   if (isDeprecated) {
-    string message;
+    std::string message;
     const FileDescriptor* sourceFile = descriptor->file();
     const FileDescriptor* sourceFile = descriptor->file();
     if (isFileLevelDeprecation) {
     if (isFileLevelDeprecation) {
       message = sourceFile->name() + " is deprecated.";
       message = sourceFile->name() + " is deprecated.";
@@ -183,7 +183,7 @@ string GetOptionalDeprecatedAttribute(
                 sourceFile->name() + ").";
                 sourceFile->name() + ").";
     }
     }
 
 
-    string result = string("GPB_DEPRECATED_MSG(\"") + message + "\")";
+    std::string result = std::string("GPB_DEPRECATED_MSG(\"") + message + "\")";
     if (preSpace) {
     if (preSpace) {
       result.insert(0, " ");
       result.insert(0, " ");
     }
     }
@@ -196,7 +196,7 @@ string GetOptionalDeprecatedAttribute(
   }
   }
 }
 }
 
 
-string PROTOC_EXPORT GetCapitalizedType(const FieldDescriptor* field);
+std::string PROTOC_EXPORT GetCapitalizedType(const FieldDescriptor* field);
 
 
 ObjectiveCType PROTOC_EXPORT
 ObjectiveCType PROTOC_EXPORT
 GetObjectiveCType(FieldDescriptor::Type field_type);
 GetObjectiveCType(FieldDescriptor::Type field_type);
@@ -208,25 +208,26 @@ inline ObjectiveCType GetObjectiveCType(const FieldDescriptor* field) {
 bool PROTOC_EXPORT IsPrimitiveType(const FieldDescriptor* field);
 bool PROTOC_EXPORT IsPrimitiveType(const FieldDescriptor* field);
 bool PROTOC_EXPORT IsReferenceType(const FieldDescriptor* field);
 bool PROTOC_EXPORT IsReferenceType(const FieldDescriptor* field);
 
 
-string PROTOC_EXPORT GPBGenericValueFieldName(const FieldDescriptor* field);
-string PROTOC_EXPORT DefaultValue(const FieldDescriptor* field);
+std::string PROTOC_EXPORT
+GPBGenericValueFieldName(const FieldDescriptor* field);
+std::string PROTOC_EXPORT DefaultValue(const FieldDescriptor* field);
 bool PROTOC_EXPORT HasNonZeroDefaultValue(const FieldDescriptor* field);
 bool PROTOC_EXPORT HasNonZeroDefaultValue(const FieldDescriptor* field);
 
 
-string PROTOC_EXPORT BuildFlagsString(const FlagType type,
-                                      const std::vector<string>& strings);
+std::string PROTOC_EXPORT
+BuildFlagsString(const FlagType type, const std::vector<std::string>& strings);
 
 
 // Builds HeaderDoc/appledoc style comments out of the comments in the .proto
 // Builds HeaderDoc/appledoc style comments out of the comments in the .proto
 // file.
 // file.
-string PROTOC_EXPORT BuildCommentsString(const SourceLocation& location,
-                                         bool prefer_single_line);
+std::string PROTOC_EXPORT BuildCommentsString(const SourceLocation& location,
+                                              bool prefer_single_line);
 
 
 // The name the commonly used by the library when built as a framework.
 // The name the commonly used by the library when built as a framework.
 // This lines up to the name used in the CocoaPod.
 // This lines up to the name used in the CocoaPod.
 extern PROTOC_EXPORT const char* const ProtobufLibraryFrameworkName;
 extern PROTOC_EXPORT const char* const ProtobufLibraryFrameworkName;
 // Returns the CPP symbol name to use as the gate for framework style imports
 // Returns the CPP symbol name to use as the gate for framework style imports
 // for the given framework name to use.
 // for the given framework name to use.
-string PROTOC_EXPORT
-ProtobufFrameworkImportSymbol(const string& framework_name);
+std::string PROTOC_EXPORT
+ProtobufFrameworkImportSymbol(const std::string& framework_name);
 
 
 // Checks if the file is one of the proto's bundled with the library.
 // Checks if the file is one of the proto's bundled with the library.
 bool PROTOC_EXPORT
 bool PROTOC_EXPORT
@@ -235,9 +236,9 @@ IsProtobufLibraryBundledProtoFile(const FileDescriptor* file);
 // Checks the prefix for the given files and outputs any warnings as needed. If
 // Checks the prefix for the given files and outputs any warnings as needed. If
 // there are flat out errors, then out_error is filled in with the first error
 // there are flat out errors, then out_error is filled in with the first error
 // and the result is false.
 // and the result is false.
-bool PROTOC_EXPORT
-ValidateObjCClassPrefixes(const std::vector<const FileDescriptor*>& files,
-                          const Options& generation_options, string* out_error);
+bool PROTOC_EXPORT ValidateObjCClassPrefixes(
+    const std::vector<const FileDescriptor*>& files,
+    const Options& generation_options, std::string* out_error);
 
 
 // Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform
 // Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform
 // the input into the expected output.
 // the input into the expected output.
@@ -249,16 +250,16 @@ class PROTOC_EXPORT TextFormatDecodeData {
   TextFormatDecodeData(const TextFormatDecodeData&) = delete;
   TextFormatDecodeData(const TextFormatDecodeData&) = delete;
   TextFormatDecodeData& operator=(const TextFormatDecodeData&) = delete;
   TextFormatDecodeData& operator=(const TextFormatDecodeData&) = delete;
 
 
-  void AddString(int32 key, const string& input_for_decode,
-                 const string& desired_output);
+  void AddString(int32 key, const std::string& input_for_decode,
+                 const std::string& desired_output);
   size_t num_entries() const { return entries_.size(); }
   size_t num_entries() const { return entries_.size(); }
-  string Data() const;
+  std::string Data() const;
 
 
-  static string DecodeDataForString(const string& input_for_decode,
-                                    const string& desired_output);
+  static std::string DecodeDataForString(const std::string& input_for_decode,
+                                         const std::string& desired_output);
 
 
  private:
  private:
-  typedef std::pair<int32, string> DataEntry;
+  typedef std::pair<int32, std::string> DataEntry;
   std::vector<DataEntry> entries_;
   std::vector<DataEntry> entries_;
 };
 };
 
 
@@ -267,55 +268,55 @@ class PROTOC_EXPORT LineConsumer {
  public:
  public:
   LineConsumer();
   LineConsumer();
   virtual ~LineConsumer();
   virtual ~LineConsumer();
-  virtual bool ConsumeLine(const StringPiece& line, string* out_error) = 0;
+  virtual bool ConsumeLine(const StringPiece& line, std::string* out_error) = 0;
 };
 };
 
 
-bool PROTOC_EXPORT ParseSimpleFile(const string& path,
+bool PROTOC_EXPORT ParseSimpleFile(const std::string& path,
                                    LineConsumer* line_consumer,
                                    LineConsumer* line_consumer,
-                                   string* out_error);
+                                   std::string* out_error);
 
 
 // Helper class for parsing framework import mappings and generating
 // Helper class for parsing framework import mappings and generating
 // import statements.
 // import statements.
 class PROTOC_EXPORT ImportWriter {
 class PROTOC_EXPORT ImportWriter {
  public:
  public:
-  ImportWriter(const string& generate_for_named_framework,
-               const string& named_framework_to_proto_path_mappings_path,
-               const string& runtime_import_prefix,
+  ImportWriter(const std::string& generate_for_named_framework,
+               const std::string& named_framework_to_proto_path_mappings_path,
+               const std::string& runtime_import_prefix,
                bool include_wkt_imports);
                bool include_wkt_imports);
   ~ImportWriter();
   ~ImportWriter();
 
 
-  void AddFile(const FileDescriptor* file, const string& header_extension);
+  void AddFile(const FileDescriptor* file, const std::string& header_extension);
   void Print(io::Printer *printer) const;
   void Print(io::Printer *printer) const;
 
 
   static void PrintRuntimeImports(io::Printer *printer,
   static void PrintRuntimeImports(io::Printer *printer,
-                                  const std::vector<string>& header_to_import,
-                                  const string& runtime_import_prefix,
+                                  const std::vector<std::string>& header_to_import,
+                                  const std::string& runtime_import_prefix,
                                   bool default_cpp_symbol = false);
                                   bool default_cpp_symbol = false);
 
 
  private:
  private:
   class ProtoFrameworkCollector : public LineConsumer {
   class ProtoFrameworkCollector : public LineConsumer {
    public:
    public:
-    ProtoFrameworkCollector(std::map<string, string>* inout_proto_file_to_framework_name)
+    ProtoFrameworkCollector(std::map<std::string, std::string>* inout_proto_file_to_framework_name)
         : map_(inout_proto_file_to_framework_name) {}
         : map_(inout_proto_file_to_framework_name) {}
 
 
-    virtual bool ConsumeLine(const StringPiece& line, string* out_error);
+    virtual bool ConsumeLine(const StringPiece& line, std::string* out_error);
 
 
    private:
    private:
-    std::map<string, string>* map_;
+    std::map<std::string, std::string>* map_;
   };
   };
 
 
   void ParseFrameworkMappings();
   void ParseFrameworkMappings();
 
 
-  const string generate_for_named_framework_;
-  const string named_framework_to_proto_path_mappings_path_;
-  const string runtime_import_prefix_;
+  const std::string generate_for_named_framework_;
+  const std::string named_framework_to_proto_path_mappings_path_;
+  const std::string runtime_import_prefix_;
   const bool include_wkt_imports_;
   const bool include_wkt_imports_;
-  std::map<string, string> proto_file_to_framework_name_;
+  std::map<std::string, std::string> proto_file_to_framework_name_;
   bool need_to_parse_mapping_file_;
   bool need_to_parse_mapping_file_;
 
 
-  std::vector<string> protobuf_imports_;
-  std::vector<string> other_framework_imports_;
-  std::vector<string> other_imports_;
+  std::vector<std::string> protobuf_imports_;
+  std::vector<std::string> other_framework_imports_;
+  std::vector<std::string> other_imports_;
 };
 };
 
 
 }  // namespace objectivec
 }  // namespace objectivec

+ 20 - 20
src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc

@@ -39,21 +39,21 @@ namespace objectivec {
 namespace {
 namespace {
 
 
 TEST(ObjCHelper, TextFormatDecodeData_DecodeDataForString_RawStrings) {
 TEST(ObjCHelper, TextFormatDecodeData_DecodeDataForString_RawStrings) {
-  string input_for_decode("abcdefghIJ");
-  string desired_output_for_decode;
-  string expected;
-  string result;
+  std::string input_for_decode("abcdefghIJ");
+  std::string desired_output_for_decode;
+  std::string expected;
+  std::string result;
 
 
   // Different data, can't transform.
   // Different data, can't transform.
 
 
   desired_output_for_decode = "zbcdefghIJ";
   desired_output_for_decode = "zbcdefghIJ";
-  expected = string("\0zbcdefghIJ\0", 12);
+  expected = std::string("\0zbcdefghIJ\0", 12);
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
                                                      desired_output_for_decode);
                                                      desired_output_for_decode);
   EXPECT_EQ(expected, result);
   EXPECT_EQ(expected, result);
 
 
   desired_output_for_decode = "abcdezghIJ";
   desired_output_for_decode = "abcdezghIJ";
-  expected = string("\0abcdezghIJ\0", 12);
+  expected = std::string("\0abcdezghIJ\0", 12);
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
                                                      desired_output_for_decode);
                                                      desired_output_for_decode);
   EXPECT_EQ(expected, result);
   EXPECT_EQ(expected, result);
@@ -61,7 +61,7 @@ TEST(ObjCHelper, TextFormatDecodeData_DecodeDataForString_RawStrings) {
   // Shortened data, can't transform.
   // Shortened data, can't transform.
 
 
   desired_output_for_decode = "abcdefghI";
   desired_output_for_decode = "abcdefghI";
-  expected = string("\0abcdefghI\0", 11);
+  expected = std::string("\0abcdefghI\0", 11);
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
                                                      desired_output_for_decode);
                                                      desired_output_for_decode);
   EXPECT_EQ(expected, result);
   EXPECT_EQ(expected, result);
@@ -69,32 +69,32 @@ TEST(ObjCHelper, TextFormatDecodeData_DecodeDataForString_RawStrings) {
   // Extra data, can't transform.
   // Extra data, can't transform.
 
 
   desired_output_for_decode = "abcdefghIJz";
   desired_output_for_decode = "abcdefghIJz";
-  expected = string("\0abcdefghIJz\0", 13);
+  expected = std::string("\0abcdefghIJz\0", 13);
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
                                                      desired_output_for_decode);
                                                      desired_output_for_decode);
   EXPECT_EQ(expected, result);
   EXPECT_EQ(expected, result);
 }
 }
 
 
 TEST(ObjCHelper, TextFormatDecodeData_DecodeDataForString_ByteCodes) {
 TEST(ObjCHelper, TextFormatDecodeData_DecodeDataForString_ByteCodes) {
-  string input_for_decode("abcdefghIJ");
-  string desired_output_for_decode;
-  string expected;
-  string result;
+  std::string input_for_decode("abcdefghIJ");
+  std::string desired_output_for_decode;
+  std::string expected;
+  std::string result;
 
 
   desired_output_for_decode = "abcdefghIJ";
   desired_output_for_decode = "abcdefghIJ";
-  expected = string("\x0A\x0", 2);
+  expected = std::string("\x0A\x0", 2);
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
                                                      desired_output_for_decode);
                                                      desired_output_for_decode);
   EXPECT_EQ(expected, result);
   EXPECT_EQ(expected, result);
 
 
   desired_output_for_decode = "_AbcdefghIJ";
   desired_output_for_decode = "_AbcdefghIJ";
-  expected = string("\xCA\x0", 2);
+  expected = std::string("\xCA\x0", 2);
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
                                                      desired_output_for_decode);
                                                      desired_output_for_decode);
   EXPECT_EQ(expected, result);
   EXPECT_EQ(expected, result);
 
 
   desired_output_for_decode = "ABCD__EfghI_j";
   desired_output_for_decode = "ABCD__EfghI_j";
-  expected = string("\x64\x80\xC5\xA1\x0", 5);
+  expected = std::string("\x64\x80\xC5\xA1\x0", 5);
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
                                                      desired_output_for_decode);
                                                      desired_output_for_decode);
   EXPECT_EQ(expected, result);
   EXPECT_EQ(expected, result);
@@ -105,7 +105,7 @@ TEST(ObjCHelper, TextFormatDecodeData_DecodeDataForString_ByteCodes) {
       "longFieldNameIsLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong1000";
       "longFieldNameIsLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong1000";
   desired_output_for_decode =
   desired_output_for_decode =
       "long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1000";
       "long_field_name_is_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_1000";
-  expected = string("\x04\xA5\xA4\xA2\xBF\x1F\x0E\x84\x0", 9);
+  expected = std::string("\x04\xA5\xA4\xA2\xBF\x1F\x0E\x84\x0", 9);
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
   result = TextFormatDecodeData::DecodeDataForString(input_for_decode,
                                                      desired_output_for_decode);
                                                      desired_output_for_decode);
   EXPECT_EQ(expected, result);
   EXPECT_EQ(expected, result);
@@ -128,7 +128,7 @@ TEST(ObjCHelperDeathTest, TextFormatDecodeData_DecodeDataForString_Failures) {
 
 
   // Null char in the string.
   // Null char in the string.
 
 
-  string str_with_null_char("ab\0c", 4);
+  std::string str_with_null_char("ab\0c", 4);
   EXPECT_EXIT(
   EXPECT_EXIT(
       TextFormatDecodeData::DecodeDataForString(str_with_null_char, "def"),
       TextFormatDecodeData::DecodeDataForString(str_with_null_char, "def"),
       ::testing::KilledBySignal(SIGABRT),
       ::testing::KilledBySignal(SIGABRT),
@@ -160,7 +160,7 @@ TEST(ObjCHelper, TextFormatDecodeData_RawStrings) {
       0x2, 0x0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'I', 0x0,
       0x2, 0x0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'I', 0x0,
       0x4, 0x0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'I', 'J', 'z', 0x0,
       0x4, 0x0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'I', 'J', 'z', 0x0,
   };
   };
-  string expected((const char*)expected_data, sizeof(expected_data));
+  std::string expected((const char*)expected_data, sizeof(expected_data));
 
 
   EXPECT_EQ(expected, decode_data.Data());
   EXPECT_EQ(expected, decode_data.Data());
 }
 }
@@ -196,7 +196,7 @@ TEST(ObjCHelper, TextFormatDecodeData_ByteCodes) {
       //   underscore, as is + 3 (00 op)
       //   underscore, as is + 3 (00 op)
       0xE8, 0x07, 0x04, 0xA5, 0xA4, 0xA2, 0xBF, 0x1F, 0x0E, 0x84, 0x0,
       0xE8, 0x07, 0x04, 0xA5, 0xA4, 0xA2, 0xBF, 0x1F, 0x0E, 0x84, 0x0,
   };
   };
-  string expected((const char*)expected_data, sizeof(expected_data));
+  std::string expected((const char*)expected_data, sizeof(expected_data));
 
 
   EXPECT_EQ(expected, decode_data.Data());
   EXPECT_EQ(expected, decode_data.Data());
 }
 }
@@ -221,7 +221,7 @@ TEST(ObjCHelperDeathTest, TextFormatDecodeData_Failures) {
 
 
   // Null char in the string.
   // Null char in the string.
 
 
-  string str_with_null_char("ab\0c", 4);
+  std::string str_with_null_char("ab\0c", 4);
   EXPECT_EXIT(
   EXPECT_EXIT(
       decode_data.AddString(1, str_with_null_char, "def"),
       decode_data.AddString(1, str_with_null_char, "def"),
       ::testing::KilledBySignal(SIGABRT),
       ::testing::KilledBySignal(SIGABRT),

+ 10 - 10
src/google/protobuf/compiler/objectivec/objectivec_map_field.cc

@@ -96,20 +96,21 @@ MapFieldGenerator::MapFieldGenerator(const FieldDescriptor* descriptor,
   variables_["default_name"] = value_field_generator_->variable("default_name");
   variables_["default_name"] = value_field_generator_->variable("default_name");
 
 
   // Build custom field flags.
   // Build custom field flags.
-  std::vector<string> field_flags;
+  std::vector<std::string> field_flags;
   field_flags.push_back("GPBFieldMapKey" + GetCapitalizedType(key_descriptor));
   field_flags.push_back("GPBFieldMapKey" + GetCapitalizedType(key_descriptor));
   // Pull over the current text format custom name values that was calculated.
   // Pull over the current text format custom name values that was calculated.
   if (variables_["fieldflags"].find("GPBFieldTextFormatNameCustom") !=
   if (variables_["fieldflags"].find("GPBFieldTextFormatNameCustom") !=
-      string::npos) {
+      std::string::npos) {
     field_flags.push_back("GPBFieldTextFormatNameCustom");
     field_flags.push_back("GPBFieldTextFormatNameCustom");
   }
   }
   // Pull over some info from the value's flags.
   // Pull over some info from the value's flags.
-  const string& value_field_flags =
+  const std::string& value_field_flags =
       value_field_generator_->variable("fieldflags");
       value_field_generator_->variable("fieldflags");
-  if (value_field_flags.find("GPBFieldHasDefaultValue") != string::npos) {
+  if (value_field_flags.find("GPBFieldHasDefaultValue") != std::string::npos) {
     field_flags.push_back("GPBFieldHasDefaultValue");
     field_flags.push_back("GPBFieldHasDefaultValue");
   }
   }
-  if (value_field_flags.find("GPBFieldHasEnumDescriptor") != string::npos) {
+  if (value_field_flags.find("GPBFieldHasEnumDescriptor") !=
+      std::string::npos) {
     field_flags.push_back("GPBFieldHasEnumDescriptor");
     field_flags.push_back("GPBFieldHasEnumDescriptor");
   }
   }
 
 
@@ -127,7 +128,7 @@ MapFieldGenerator::MapFieldGenerator(const FieldDescriptor* descriptor,
         "NSMutableDictionary<NSString*, " +
         "NSMutableDictionary<NSString*, " +
         value_field_generator_->variable("storage_type") + "*>";
         value_field_generator_->variable("storage_type") + "*>";
   } else {
   } else {
-    string class_name("GPB");
+    std::string class_name("GPB");
     class_name += MapEntryTypeName(key_descriptor, true);
     class_name += MapEntryTypeName(key_descriptor, true);
     class_name += MapEntryTypeName(value_descriptor, false);
     class_name += MapEntryTypeName(value_descriptor, false);
     class_name += "Dictionary";
     class_name += "Dictionary";
@@ -160,19 +161,19 @@ void MapFieldGenerator::FinishInitialization(void) {
 }
 }
 
 
 void MapFieldGenerator::DetermineForwardDeclarations(
 void MapFieldGenerator::DetermineForwardDeclarations(
-    std::set<string>* fwd_decls) const {
+    std::set<std::string>* fwd_decls) const {
   RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   const FieldDescriptor* value_descriptor =
   const FieldDescriptor* value_descriptor =
       descriptor_->message_type()->FindFieldByName("value");
       descriptor_->message_type()->FindFieldByName("value");
   if (GetObjectiveCType(value_descriptor) == OBJECTIVECTYPE_MESSAGE) {
   if (GetObjectiveCType(value_descriptor) == OBJECTIVECTYPE_MESSAGE) {
-    const string& value_storage_type =
+    const std::string& value_storage_type =
         value_field_generator_->variable("storage_type");
         value_field_generator_->variable("storage_type");
     fwd_decls->insert("@class " + value_storage_type);
     fwd_decls->insert("@class " + value_storage_type);
   }
   }
 }
 }
 
 
 void MapFieldGenerator::DetermineObjectiveCClassDefinitions(
 void MapFieldGenerator::DetermineObjectiveCClassDefinitions(
-    std::set<string>* fwd_decls) const {
+    std::set<std::string>* fwd_decls) const {
   // Class name is already in "storage_type".
   // Class name is already in "storage_type".
   const FieldDescriptor* value_descriptor =
   const FieldDescriptor* value_descriptor =
       descriptor_->message_type()->FindFieldByName("value");
       descriptor_->message_type()->FindFieldByName("value");
@@ -182,7 +183,6 @@ void MapFieldGenerator::DetermineObjectiveCClassDefinitions(
   }
   }
 }
 }
 
 
-
 }  // namespace objectivec
 }  // namespace objectivec
 }  // namespace compiler
 }  // namespace compiler
 }  // namespace protobuf
 }  // namespace protobuf

+ 4 - 2
src/google/protobuf/compiler/objectivec/objectivec_map_field.h

@@ -54,8 +54,10 @@ class MapFieldGenerator : public RepeatedFieldGenerator {
   MapFieldGenerator(const FieldDescriptor* descriptor, const Options& options);
   MapFieldGenerator(const FieldDescriptor* descriptor, const Options& options);
   virtual ~MapFieldGenerator();
   virtual ~MapFieldGenerator();
 
 
-  virtual void DetermineObjectiveCClassDefinitions(std::set<string>* fwd_decls) const;
-  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
+  virtual void DetermineObjectiveCClassDefinitions(
+      std::set<std::string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(
+      std::set<std::string>* fwd_decls) const;
 
 
  private:
  private:
   std::unique_ptr<FieldGenerator> value_field_generator_;
   std::unique_ptr<FieldGenerator> value_field_generator_;

+ 16 - 15
src/google/protobuf/compiler/objectivec/objectivec_message.cc

@@ -170,16 +170,15 @@ const FieldDescriptor** SortFieldsByStorageSize(const Descriptor* descriptor) {
 }
 }
 }  // namespace
 }  // namespace
 
 
-MessageGenerator::MessageGenerator(const string& root_classname,
+MessageGenerator::MessageGenerator(const std::string& root_classname,
                                    const Descriptor* descriptor,
                                    const Descriptor* descriptor,
                                    const Options& options)
                                    const Options& options)
     : root_classname_(root_classname),
     : root_classname_(root_classname),
       descriptor_(descriptor),
       descriptor_(descriptor),
       field_generators_(descriptor, options),
       field_generators_(descriptor, options),
       class_name_(ClassName(descriptor_)),
       class_name_(ClassName(descriptor_)),
-      deprecated_attribute_(
-          GetOptionalDeprecatedAttribute(descriptor, descriptor->file(), false, true)) {
-
+      deprecated_attribute_(GetOptionalDeprecatedAttribute(
+          descriptor, descriptor->file(), false, true)) {
   for (int i = 0; i < descriptor_->extension_count(); i++) {
   for (int i = 0; i < descriptor_->extension_count(); i++) {
     extension_generators_.emplace_back(
     extension_generators_.emplace_back(
         new ExtensionGenerator(class_name_, descriptor_->extension(i)));
         new ExtensionGenerator(class_name_, descriptor_->extension(i)));
@@ -217,7 +216,8 @@ void MessageGenerator::GenerateStaticVariablesInitialization(
   }
   }
 }
 }
 
 
-void MessageGenerator::DetermineForwardDeclarations(std::set<string>* fwd_decls) {
+void MessageGenerator::DetermineForwardDeclarations(
+    std::set<std::string>* fwd_decls) {
   if (!IsMapEntryMessage(descriptor_)) {
   if (!IsMapEntryMessage(descriptor_)) {
     for (int i = 0; i < descriptor_->field_count(); i++) {
     for (int i = 0; i < descriptor_->field_count(); i++) {
       const FieldDescriptor* fieldDescriptor = descriptor_->field(i);
       const FieldDescriptor* fieldDescriptor = descriptor_->field(i);
@@ -231,7 +231,8 @@ void MessageGenerator::DetermineForwardDeclarations(std::set<string>* fwd_decls)
   }
   }
 }
 }
 
 
-void MessageGenerator::DetermineObjectiveCClassDefinitions(std::set<string>* fwd_decls) {
+void MessageGenerator::DetermineObjectiveCClassDefinitions(
+    std::set<std::string>* fwd_decls) {
   if (!IsMapEntryMessage(descriptor_)) {
   if (!IsMapEntryMessage(descriptor_)) {
     for (int i = 0; i < descriptor_->field_count(); i++) {
     for (int i = 0; i < descriptor_->field_count(); i++) {
       const FieldDescriptor* fieldDescriptor = descriptor_->field(i);
       const FieldDescriptor* fieldDescriptor = descriptor_->field(i);
@@ -250,7 +251,7 @@ void MessageGenerator::DetermineObjectiveCClassDefinitions(std::set<string>* fwd
 
 
   const Descriptor* containing_descriptor = descriptor_->containing_type();
   const Descriptor* containing_descriptor = descriptor_->containing_type();
   if (containing_descriptor != NULL) {
   if (containing_descriptor != NULL) {
-    string containing_class = ClassName(containing_descriptor);
+    std::string containing_class = ClassName(containing_descriptor);
     fwd_decls->insert(ObjCClassDeclaration(containing_class));
     fwd_decls->insert(ObjCClassDeclaration(containing_class));
   }
   }
 }
 }
@@ -325,7 +326,7 @@ void MessageGenerator::GenerateMessageHeader(io::Printer* printer) {
     generator->GenerateCaseEnum(printer);
     generator->GenerateCaseEnum(printer);
   }
   }
 
 
-  string message_comments;
+  std::string message_comments;
   SourceLocation location;
   SourceLocation location;
   if (descriptor_->GetSourceLocation(&location)) {
   if (descriptor_->GetSourceLocation(&location)) {
     message_comments = BuildCommentsString(location, false);
     message_comments = BuildCommentsString(location, false);
@@ -473,7 +474,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
     TextFormatDecodeData text_format_decode_data;
     TextFormatDecodeData text_format_decode_data;
     bool has_fields = descriptor_->field_count() > 0;
     bool has_fields = descriptor_->field_count() > 0;
     bool need_defaults = field_generators_.DoesAnyFieldHaveNonZeroDefault();
     bool need_defaults = field_generators_.DoesAnyFieldHaveNonZeroDefault();
-    string field_description_type;
+    std::string field_description_type;
     if (need_defaults) {
     if (need_defaults) {
       field_description_type = "GPBMessageFieldDescriptionWithDefault";
       field_description_type = "GPBMessageFieldDescriptionWithDefault";
     } else {
     } else {
@@ -503,7 +504,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
       printer->Outdent();
       printer->Outdent();
     }
     }
 
 
-    std::map<string, string> vars;
+    std::map<std::string, std::string> vars;
     vars["classname"] = class_name_;
     vars["classname"] = class_name_;
     vars["rootclassname"] = root_classname_;
     vars["rootclassname"] = root_classname_;
     vars["fields"] = has_fields ? "fields" : "NULL";
     vars["fields"] = has_fields ? "fields" : "NULL";
@@ -514,7 +515,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
       vars["fields_count"] = "0";
       vars["fields_count"] = "0";
     }
     }
 
 
-    std::vector<string> init_flags;
+    std::vector<std::string> init_flags;
     init_flags.push_back("GPBDescriptorInitializationFlag_UsesClassRefs");
     init_flags.push_back("GPBDescriptorInitializationFlag_UsesClassRefs");
     init_flags.push_back("GPBDescriptorInitializationFlag_Proto3OptionalKnown");
     init_flags.push_back("GPBDescriptorInitializationFlag_Proto3OptionalKnown");
     if (need_defaults) {
     if (need_defaults) {
@@ -551,7 +552,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
           "first_has_index", oneof_generators_[0]->HasIndexAsString());
           "first_has_index", oneof_generators_[0]->HasIndexAsString());
     }
     }
     if (text_format_decode_data.num_entries() != 0) {
     if (text_format_decode_data.num_entries() != 0) {
-      const string text_format_data_str(text_format_decode_data.Data());
+      const std::string text_format_data_str(text_format_decode_data.Data());
       printer->Print(
       printer->Print(
           "#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS\n"
           "#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS\n"
           "    static const char *extraTextFormatInfo =");
           "    static const char *extraTextFormatInfo =");
@@ -581,13 +582,13 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
           "                                    count:(uint32_t)(sizeof(ranges) / sizeof(GPBExtensionRange))];\n");
           "                                    count:(uint32_t)(sizeof(ranges) / sizeof(GPBExtensionRange))];\n");
     }
     }
     if (descriptor_->containing_type() != NULL) {
     if (descriptor_->containing_type() != NULL) {
-      string containing_class = ClassName(descriptor_->containing_type());
-      string parent_class_ref = ObjCClass(containing_class);
+      std::string containing_class = ClassName(descriptor_->containing_type());
+      std::string parent_class_ref = ObjCClass(containing_class);
       printer->Print(
       printer->Print(
           "    [localDescriptor setupContainingMessageClass:$parent_class_ref$];\n",
           "    [localDescriptor setupContainingMessageClass:$parent_class_ref$];\n",
           "parent_class_ref", parent_class_ref);
           "parent_class_ref", parent_class_ref);
     }
     }
-    string suffix_added;
+    std::string suffix_added;
     ClassName(descriptor_, &suffix_added);
     ClassName(descriptor_, &suffix_added);
     if (!suffix_added.empty()) {
     if (!suffix_added.empty()) {
       printer->Print(
       printer->Print(

+ 7 - 8
src/google/protobuf/compiler/objectivec/objectivec_message.h

@@ -50,9 +50,8 @@ class EnumGenerator;
 
 
 class MessageGenerator {
 class MessageGenerator {
  public:
  public:
-  MessageGenerator(const string& root_classname,
-                   const Descriptor* descriptor,
-                   const Options& options);
+  MessageGenerator(const std::string& root_classname,
+                   const Descriptor* descriptor, const Options& options);
   ~MessageGenerator();
   ~MessageGenerator();
 
 
   MessageGenerator(const MessageGenerator&) = delete;
   MessageGenerator(const MessageGenerator&) = delete;
@@ -63,8 +62,8 @@ class MessageGenerator {
   void GenerateMessageHeader(io::Printer* printer);
   void GenerateMessageHeader(io::Printer* printer);
   void GenerateSource(io::Printer* printer);
   void GenerateSource(io::Printer* printer);
   void GenerateExtensionRegistrationSource(io::Printer* printer);
   void GenerateExtensionRegistrationSource(io::Printer* printer);
-  void DetermineObjectiveCClassDefinitions(std::set<string>* fwd_decls);
-  void DetermineForwardDeclarations(std::set<string>* fwd_decls);
+  void DetermineObjectiveCClassDefinitions(std::set<std::string>* fwd_decls);
+  void DetermineForwardDeclarations(std::set<std::string>* fwd_decls);
 
 
   // Checks if the message or a nested message includes a oneof definition.
   // Checks if the message or a nested message includes a oneof definition.
   bool IncludesOneOfDefinition() const;
   bool IncludesOneOfDefinition() const;
@@ -81,11 +80,11 @@ class MessageGenerator {
   void GenerateDescriptionOneFieldSource(io::Printer* printer,
   void GenerateDescriptionOneFieldSource(io::Printer* printer,
                                          const FieldDescriptor* field);
                                          const FieldDescriptor* field);
 
 
-  const string root_classname_;
+  const std::string root_classname_;
   const Descriptor* descriptor_;
   const Descriptor* descriptor_;
   FieldGeneratorMap field_generators_;
   FieldGeneratorMap field_generators_;
-  const string class_name_;
-  const string deprecated_attribute_;
+  const std::string class_name_;
+  const std::string deprecated_attribute_;
   std::vector<std::unique_ptr<ExtensionGenerator>> extension_generators_;
   std::vector<std::unique_ptr<ExtensionGenerator>> extension_generators_;
   std::vector<std::unique_ptr<EnumGenerator>> enum_generators_;
   std::vector<std::unique_ptr<EnumGenerator>> enum_generators_;
   std::vector<std::unique_ptr<MessageGenerator>> nested_message_generators_;
   std::vector<std::unique_ptr<MessageGenerator>> nested_message_generators_;

+ 8 - 7
src/google/protobuf/compiler/objectivec/objectivec_message_field.cc

@@ -44,9 +44,10 @@ namespace objectivec {
 namespace {
 namespace {
 
 
 void SetMessageVariables(const FieldDescriptor* descriptor,
 void SetMessageVariables(const FieldDescriptor* descriptor,
-                         std::map<string, string>* variables) {
-  const string& message_type = ClassName(descriptor->message_type());
-  const string& containing_class = ClassName(descriptor->containing_type());
+                         std::map<std::string, std::string>* variables) {
+  const std::string& message_type = ClassName(descriptor->message_type());
+  const std::string& containing_class =
+      ClassName(descriptor->containing_type());
   (*variables)["type"] = message_type;
   (*variables)["type"] = message_type;
   (*variables)["containing_class"] = containing_class;
   (*variables)["containing_class"] = containing_class;
   (*variables)["storage_type"] = message_type;
   (*variables)["storage_type"] = message_type;
@@ -66,14 +67,14 @@ MessageFieldGenerator::MessageFieldGenerator(const FieldDescriptor* descriptor,
 MessageFieldGenerator::~MessageFieldGenerator() {}
 MessageFieldGenerator::~MessageFieldGenerator() {}
 
 
 void MessageFieldGenerator::DetermineForwardDeclarations(
 void MessageFieldGenerator::DetermineForwardDeclarations(
-    std::set<string>* fwd_decls) const {
+    std::set<std::string>* fwd_decls) const {
   ObjCObjFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   ObjCObjFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   // Class name is already in "storage_type".
   // Class name is already in "storage_type".
   fwd_decls->insert("@class " + variable("storage_type"));
   fwd_decls->insert("@class " + variable("storage_type"));
 }
 }
 
 
 void MessageFieldGenerator::DetermineObjectiveCClassDefinitions(
 void MessageFieldGenerator::DetermineObjectiveCClassDefinitions(
-    std::set<string>* fwd_decls) const {
+    std::set<std::string>* fwd_decls) const {
   fwd_decls->insert(ObjCClassDeclaration(variable("storage_type")));
   fwd_decls->insert(ObjCClassDeclaration(variable("storage_type")));
 }
 }
 
 
@@ -89,14 +90,14 @@ RepeatedMessageFieldGenerator::RepeatedMessageFieldGenerator(
 RepeatedMessageFieldGenerator::~RepeatedMessageFieldGenerator() {}
 RepeatedMessageFieldGenerator::~RepeatedMessageFieldGenerator() {}
 
 
 void RepeatedMessageFieldGenerator::DetermineForwardDeclarations(
 void RepeatedMessageFieldGenerator::DetermineForwardDeclarations(
-    std::set<string>* fwd_decls) const {
+    std::set<std::string>* fwd_decls) const {
   RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   // Class name is already in "storage_type".
   // Class name is already in "storage_type".
   fwd_decls->insert("@class " + variable("storage_type"));
   fwd_decls->insert("@class " + variable("storage_type"));
 }
 }
 
 
 void RepeatedMessageFieldGenerator::DetermineObjectiveCClassDefinitions(
 void RepeatedMessageFieldGenerator::DetermineObjectiveCClassDefinitions(
-    std::set<string>* fwd_decls) const {
+    std::set<std::string>* fwd_decls) const {
   fwd_decls->insert(ObjCClassDeclaration(variable("storage_type")));
   fwd_decls->insert(ObjCClassDeclaration(variable("storage_type")));
 }
 }
 
 

+ 8 - 4
src/google/protobuf/compiler/objectivec/objectivec_message_field.h

@@ -54,8 +54,10 @@ class MessageFieldGenerator : public ObjCObjFieldGenerator {
   virtual ~MessageFieldGenerator();
   virtual ~MessageFieldGenerator();
 
 
  public:
  public:
-  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
-  virtual void DetermineObjectiveCClassDefinitions(std::set<string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(
+      std::set<std::string>* fwd_decls) const;
+  virtual void DetermineObjectiveCClassDefinitions(
+      std::set<std::string>* fwd_decls) const;
 };
 };
 
 
 class RepeatedMessageFieldGenerator : public RepeatedFieldGenerator {
 class RepeatedMessageFieldGenerator : public RepeatedFieldGenerator {
@@ -71,8 +73,10 @@ class RepeatedMessageFieldGenerator : public RepeatedFieldGenerator {
   RepeatedMessageFieldGenerator operator=(const RepeatedMessageFieldGenerator&) = delete;
   RepeatedMessageFieldGenerator operator=(const RepeatedMessageFieldGenerator&) = delete;
 
 
  public:
  public:
-  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
-  virtual void DetermineObjectiveCClassDefinitions(std::set<string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(
+      std::set<std::string>* fwd_decls) const;
+  virtual void DetermineObjectiveCClassDefinitions(
+      std::set<std::string>* fwd_decls) const;
 };
 };
 
 
 }  // namespace objectivec
 }  // namespace objectivec

+ 5 - 5
src/google/protobuf/compiler/objectivec/objectivec_oneof.cc

@@ -50,7 +50,7 @@ OneofGenerator::OneofGenerator(const OneofDescriptor* descriptor)
   const Descriptor* msg_descriptor = descriptor_->containing_type();
   const Descriptor* msg_descriptor = descriptor_->containing_type();
   variables_["owning_message_class"] = ClassName(msg_descriptor);
   variables_["owning_message_class"] = ClassName(msg_descriptor);
 
 
-  string comments;
+  std::string comments;
   SourceLocation location;
   SourceLocation location;
   if (descriptor_->GetSourceLocation(&location)) {
   if (descriptor_->GetSourceLocation(&location)) {
     comments = BuildCommentsString(location, true);
     comments = BuildCommentsString(location, true);
@@ -76,10 +76,10 @@ void OneofGenerator::GenerateCaseEnum(io::Printer* printer) {
   printer->Print(
   printer->Print(
       variables_,
       variables_,
       "$enum_name$_GPBUnsetOneOfCase = 0,\n");
       "$enum_name$_GPBUnsetOneOfCase = 0,\n");
-  string enum_name = variables_["enum_name"];
+  std::string enum_name = variables_["enum_name"];
   for (int j = 0; j < descriptor_->field_count(); j++) {
   for (int j = 0; j < descriptor_->field_count(); j++) {
     const FieldDescriptor* field = descriptor_->field(j);
     const FieldDescriptor* field = descriptor_->field(j);
-    string field_name = FieldNameCapitalized(field);
+    std::string field_name = FieldNameCapitalized(field);
     printer->Print(
     printer->Print(
         "$enum_name$_$field_name$ = $field_number$,\n",
         "$enum_name$_$field_name$ = $field_number$,\n",
         "enum_name", enum_name,
         "enum_name", enum_name,
@@ -126,11 +126,11 @@ void OneofGenerator::GenerateClearFunctionImplementation(io::Printer* printer) {
       "}\n");
       "}\n");
 }
 }
 
 
-string OneofGenerator::DescriptorName(void) const {
+std::string OneofGenerator::DescriptorName(void) const {
   return variables_.find("name")->second;
   return variables_.find("name")->second;
 }
 }
 
 
-string OneofGenerator::HasIndexAsString(void) const {
+std::string OneofGenerator::HasIndexAsString(void) const {
   return variables_.find("index")->second;
   return variables_.find("index")->second;
 }
 }
 
 

+ 3 - 3
src/google/protobuf/compiler/objectivec/objectivec_oneof.h

@@ -60,12 +60,12 @@ class OneofGenerator {
   void GeneratePropertyImplementation(io::Printer* printer);
   void GeneratePropertyImplementation(io::Printer* printer);
   void GenerateClearFunctionImplementation(io::Printer* printer);
   void GenerateClearFunctionImplementation(io::Printer* printer);
 
 
-  string DescriptorName(void) const;
-  string HasIndexAsString(void) const;
+  std::string DescriptorName(void) const;
+  std::string HasIndexAsString(void) const;
 
 
  private:
  private:
   const OneofDescriptor* descriptor_;
   const OneofDescriptor* descriptor_;
-  std::map<string, string> variables_;
+  std::map<std::string, std::string> variables_;
 };
 };
 
 
 }  // namespace objectivec
 }  // namespace objectivec

+ 2 - 2
src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc

@@ -116,7 +116,7 @@ const char* PrimitiveArrayTypeName(const FieldDescriptor* descriptor) {
 }
 }
 
 
 void SetPrimitiveVariables(const FieldDescriptor* descriptor,
 void SetPrimitiveVariables(const FieldDescriptor* descriptor,
-                           std::map<string, string>* variables) {
+                           std::map<std::string, std::string>* variables) {
   std::string primitive_name = PrimitiveTypeName(descriptor);
   std::string primitive_name = PrimitiveTypeName(descriptor);
   (*variables)["type"] = primitive_name;
   (*variables)["type"] = primitive_name;
   (*variables)["storage_type"] = primitive_name;
   (*variables)["storage_type"] = primitive_name;
@@ -172,7 +172,7 @@ RepeatedPrimitiveFieldGenerator::RepeatedPrimitiveFieldGenerator(
     : RepeatedFieldGenerator(descriptor, options) {
     : RepeatedFieldGenerator(descriptor, options) {
   SetPrimitiveVariables(descriptor, &variables_);
   SetPrimitiveVariables(descriptor, &variables_);
 
 
-  string base_name = PrimitiveArrayTypeName(descriptor);
+  std::string base_name = PrimitiveArrayTypeName(descriptor);
   if (base_name.length()) {
   if (base_name.length()) {
     variables_["array_storage_type"] = "GPB" + base_name + "Array";
     variables_["array_storage_type"] = "GPB" + base_name + "Array";
   } else {
   } else {

+ 68 - 64
src/google/protobuf/compiler/php/php_generator.cc

@@ -90,11 +90,12 @@ namespace {
 // Forward decls.
 // Forward decls.
 std::string PhpName(const std::string& full_name, const Options& options);
 std::string PhpName(const std::string& full_name, const Options& options);
 std::string IntToString(int32 value);
 std::string IntToString(int32 value);
-std::string FilenameToClassname(const string& filename);
+std::string FilenameToClassname(const std::string& filename);
 std::string GeneratedMetadataFileName(const FileDescriptor* file,
 std::string GeneratedMetadataFileName(const FileDescriptor* file,
                                       const Options& options);
                                       const Options& options);
-std::string UnderscoresToCamelCase(const string& name, bool cap_first_letter);
-std::string BinaryToHex(const string& binary);
+std::string UnderscoresToCamelCase(const std::string& name,
+                                   bool cap_first_letter);
+std::string BinaryToHex(const std::string& binary);
 void Indent(io::Printer* printer);
 void Indent(io::Printer* printer);
 void Outdent(io::Printer* printer);
 void Outdent(io::Printer* printer);
 void GenerateAddFilesToPool(const FileDescriptor* file, const Options& options,
 void GenerateAddFilesToPool(const FileDescriptor* file, const Options& options,
@@ -119,11 +120,11 @@ void GenerateServiceDocComment(io::Printer* printer,
 void GenerateServiceMethodDocComment(io::Printer* printer,
 void GenerateServiceMethodDocComment(io::Printer* printer,
                               const MethodDescriptor* method);
                               const MethodDescriptor* method);
 
 
-std::string ReservedNamePrefix(const string& classname,
+std::string ReservedNamePrefix(const std::string& classname,
                                 const FileDescriptor* file) {
                                 const FileDescriptor* file) {
   bool is_reserved = false;
   bool is_reserved = false;
 
 
-  string lower = classname;
+  std::string lower = classname;
   std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
   std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
 
 
   for (int i = 0; i < kReservedNamesSize; i++) {
   for (int i = 0; i < kReservedNamesSize; i++) {
@@ -156,9 +157,9 @@ std::string DescriptorFullName(const DescriptorType* desc, bool is_internal) {
 }
 }
 
 
 template <typename DescriptorType>
 template <typename DescriptorType>
-std::string ClassNamePrefix(const string& classname,
+std::string ClassNamePrefix(const std::string& classname,
                             const DescriptorType* desc) {
                             const DescriptorType* desc) {
-  const string& prefix = (desc->file()->options()).php_class_prefix();
+  const std::string& prefix = (desc->file()->options()).php_class_prefix();
   if (!prefix.empty()) {
   if (!prefix.empty()) {
     return prefix;
     return prefix;
   }
   }
@@ -194,8 +195,8 @@ std::string LegacyGeneratedClassName(const DescriptorType* desc) {
   return ClassNamePrefix(classname, desc) + classname;
   return ClassNamePrefix(classname, desc) + classname;
 }
 }
 
 
-std::string ClassNamePrefix(const string& classname) {
-  string lower = classname;
+std::string ClassNamePrefix(const std::string& classname) {
+  std::string lower = classname;
   std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
   std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
 
 
   for (int i = 0; i < kReservedNamesSize; i++) {
   for (int i = 0; i < kReservedNamesSize; i++) {
@@ -207,10 +208,10 @@ std::string ClassNamePrefix(const string& classname) {
   return "";
   return "";
 }
 }
 
 
-std::string ConstantNamePrefix(const string& classname) {
+std::string ConstantNamePrefix(const std::string& classname) {
   bool is_reserved = false;
   bool is_reserved = false;
 
 
-  string lower = classname;
+  std::string lower = classname;
   std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
   std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
 
 
   for (int i = 0; i < kReservedNamesSize; i++) {
   for (int i = 0; i < kReservedNamesSize; i++) {
@@ -238,7 +239,7 @@ template <typename DescriptorType>
 std::string RootPhpNamespace(const DescriptorType* desc,
 std::string RootPhpNamespace(const DescriptorType* desc,
                              const Options& options) {
                              const Options& options) {
   if (desc->file()->options().has_php_namespace()) {
   if (desc->file()->options().has_php_namespace()) {
-    const string& php_namespace = desc->file()->options().php_namespace();
+    const std::string& php_namespace = desc->file()->options().php_namespace();
     if (!php_namespace.empty()) {
     if (!php_namespace.empty()) {
       return php_namespace;
       return php_namespace;
     }
     }
@@ -253,8 +254,8 @@ std::string RootPhpNamespace(const DescriptorType* desc,
 
 
 template <typename DescriptorType>
 template <typename DescriptorType>
 std::string FullClassName(const DescriptorType* desc, const Options& options) {
 std::string FullClassName(const DescriptorType* desc, const Options& options) {
-  string classname = GeneratedClassNameImpl(desc);
-  string php_namespace = RootPhpNamespace(desc, options);
+  std::string classname = GeneratedClassNameImpl(desc);
+  std::string php_namespace = RootPhpNamespace(desc, options);
   if (!php_namespace.empty()) {
   if (!php_namespace.empty()) {
     return php_namespace + "\\" + classname;
     return php_namespace + "\\" + classname;
   }
   }
@@ -271,8 +272,8 @@ std::string FullClassName(const DescriptorType* desc, bool is_descriptor) {
 template <typename DescriptorType>
 template <typename DescriptorType>
 std::string LegacyFullClassName(const DescriptorType* desc,
 std::string LegacyFullClassName(const DescriptorType* desc,
                                 const Options& options) {
                                 const Options& options) {
-  string classname = LegacyGeneratedClassName(desc);
-  string php_namespace = RootPhpNamespace(desc, options);
+  std::string classname = LegacyGeneratedClassName(desc);
+  std::string php_namespace = RootPhpNamespace(desc, options);
   if (!php_namespace.empty()) {
   if (!php_namespace.empty()) {
     return php_namespace + "\\" + classname;
     return php_namespace + "\\" + classname;
   }
   }
@@ -330,7 +331,7 @@ std::string DefaultForField(const FieldDescriptor* field) {
 
 
 std::string GeneratedMetadataFileName(const FileDescriptor* file,
 std::string GeneratedMetadataFileName(const FileDescriptor* file,
                                       const Options& options) {
                                       const Options& options) {
-  const string& proto_file = file->name();
+  const std::string& proto_file = file->name();
   int start_index = 0;
   int start_index = 0;
   int first_index = proto_file.find_first_of("/", start_index);
   int first_index = proto_file.find_first_of("/", start_index);
   std::string result = "";
   std::string result = "";
@@ -353,7 +354,7 @@ std::string GeneratedMetadataFileName(const FileDescriptor* file,
   }
   }
 
 
   if (file->options().has_php_metadata_namespace()) {
   if (file->options().has_php_metadata_namespace()) {
-    const string& php_metadata_namespace =
+    const std::string& php_metadata_namespace =
         file->options().php_metadata_namespace();
         file->options().php_metadata_namespace();
     if (!php_metadata_namespace.empty() && php_metadata_namespace != "\\") {
     if (!php_metadata_namespace.empty() && php_metadata_namespace != "\\") {
       result += php_metadata_namespace;
       result += php_metadata_namespace;
@@ -364,7 +365,7 @@ std::string GeneratedMetadataFileName(const FileDescriptor* file,
     }
     }
   } else {
   } else {
     result += "GPBMetadata/";
     result += "GPBMetadata/";
-    while (first_index != string::npos) {
+    while (first_index != std::string::npos) {
       segment = UnderscoresToCamelCase(
       segment = UnderscoresToCamelCase(
           file_no_suffix.substr(start_index, first_index - start_index), true);
           file_no_suffix.substr(start_index, first_index - start_index), true);
       result += ReservedNamePrefix(segment, file) + segment + "/";
       result += ReservedNamePrefix(segment, file) + segment + "/";
@@ -375,7 +376,7 @@ std::string GeneratedMetadataFileName(const FileDescriptor* file,
 
 
   // Append file name.
   // Append file name.
   int file_name_start = file_no_suffix.find_last_of("/");
   int file_name_start = file_no_suffix.find_last_of("/");
-  if (file_name_start == string::npos) {
+  if (file_name_start == std::string::npos) {
     file_name_start = 0;
     file_name_start = 0;
   } else {
   } else {
     file_name_start += 1;
     file_name_start += 1;
@@ -449,7 +450,7 @@ std::string PhpSetterTypeName(const FieldDescriptor* field,
   if (field->is_map()) {
   if (field->is_map()) {
     return "array|\\Google\\Protobuf\\Internal\\MapField";
     return "array|\\Google\\Protobuf\\Internal\\MapField";
   }
   }
-  string type;
+  std::string type;
   switch (field->type()) {
   switch (field->type()) {
     case FieldDescriptor::TYPE_INT32:
     case FieldDescriptor::TYPE_INT32:
     case FieldDescriptor::TYPE_UINT32:
     case FieldDescriptor::TYPE_UINT32:
@@ -564,7 +565,8 @@ std::string EnumOrMessageSuffix(const FieldDescriptor* field,
 
 
 // Converts a name to camel-case. If cap_first_letter is true, capitalize the
 // Converts a name to camel-case. If cap_first_letter is true, capitalize the
 // first letter.
 // first letter.
-std::string UnderscoresToCamelCase(const string& name, bool cap_first_letter) {
+std::string UnderscoresToCamelCase(const std::string& name,
+                                   bool cap_first_letter) {
   std::string result;
   std::string result;
   for (int i = 0; i < name.size(); i++) {
   for (int i = 0; i < name.size(); i++) {
     if ('a' <= name[i] && name[i] <= 'z') {
     if ('a' <= name[i] && name[i] <= 'z') {
@@ -598,8 +600,8 @@ std::string UnderscoresToCamelCase(const string& name, bool cap_first_letter) {
   return result;
   return result;
 }
 }
 
 
-std::string BinaryToHex(const string& binary) {
-  string dest;
+std::string BinaryToHex(const std::string& binary) {
+  std::string dest;
   size_t i;
   size_t i;
   unsigned char symbol[16] = {
   unsigned char symbol[16] = {
     '0', '1', '2', '3',
     '0', '1', '2', '3',
@@ -855,15 +857,16 @@ void GenerateServiceMethod(const MethodDescriptor* method,
   );
   );
 }
 }
 
 
-void GenerateMessageToPool(const string& name_prefix, const Descriptor* message,
-                           io::Printer* printer) {
+void GenerateMessageToPool(const std::string& name_prefix,
+                           const Descriptor* message, io::Printer* printer) {
   // Don't generate MapEntry messages -- we use the PHP extension's native
   // Don't generate MapEntry messages -- we use the PHP extension's native
   // support for map fields instead.
   // support for map fields instead.
   if (message->options().map_entry()) {
   if (message->options().map_entry()) {
     return;
     return;
   }
   }
-  string class_name = (name_prefix.empty() ? "" : name_prefix + "\\") +
-    ReservedNamePrefix(message->name(), message->file()) + message->name();
+  std::string class_name =
+      (name_prefix.empty() ? "" : name_prefix + "\\") +
+      ReservedNamePrefix(message->name(), message->file()) + message->name();
 
 
   printer->Print(
   printer->Print(
       "$pool->addMessage('^message^', "
       "$pool->addMessage('^message^', "
@@ -985,8 +988,9 @@ void GenerateAddFileToPool(const FileDescriptor* file, const Options& options,
       file->CopyTo(file_proto);
       file->CopyTo(file_proto);
 
 
       // Filter out descriptor.proto as it cannot be depended on for now.
       // Filter out descriptor.proto as it cannot be depended on for now.
-      RepeatedPtrField<string>* dependency = file_proto->mutable_dependency();
-      for (RepeatedPtrField<string>::iterator it = dependency->begin();
+      RepeatedPtrField<std::string>* dependency =
+          file_proto->mutable_dependency();
+      for (RepeatedPtrField<std::string>::iterator it = dependency->begin();
            it != dependency->end(); ++it) {
            it != dependency->end(); ++it) {
         if (*it != kDescriptorFile) {
         if (*it != kDescriptorFile) {
           dependency->erase(it);
           dependency->erase(it);
@@ -1003,7 +1007,7 @@ void GenerateAddFileToPool(const FileDescriptor* file, const Options& options,
         it->clear_extension();
         it->clear_extension();
       }
       }
 
 
-      string files_data;
+      std::string files_data;
       files.SerializeToString(&files_data);
       files.SerializeToString(&files_data);
 
 
       printer->Print("$pool->internalAddGeneratedFile(hex2bin(\n");
       printer->Print("$pool->internalAddGeneratedFile(hex2bin(\n");
@@ -1058,9 +1062,8 @@ static void AnalyzeDependencyForFile(
   }
   }
 }
 }
 
 
-static bool NeedsUnwrapping(
-    const FileDescriptor* file,
-    const Options& options) {
+static bool NeedsUnwrapping(const FileDescriptor* file,
+                            const Options& options) {
   bool has_aggregate_metadata_prefix = false;
   bool has_aggregate_metadata_prefix = false;
   if (options.aggregate_metadata_prefixes.empty()) {
   if (options.aggregate_metadata_prefixes.empty()) {
     has_aggregate_metadata_prefix = true;
     has_aggregate_metadata_prefix = true;
@@ -1076,10 +1079,8 @@ static bool NeedsUnwrapping(
   return has_aggregate_metadata_prefix;
   return has_aggregate_metadata_prefix;
 }
 }
 
 
-void GenerateAddFilesToPool(
-    const FileDescriptor* file,
-    const Options& options,
-    io::Printer* printer) {
+void GenerateAddFilesToPool(const FileDescriptor* file, const Options& options,
+                            io::Printer* printer) {
   printer->Print(
   printer->Print(
       "$pool = \\Google\\Protobuf\\Internal\\"
       "$pool = \\Google\\Protobuf\\Internal\\"
       "DescriptorPool::getGeneratedPool();\n"
       "DescriptorPool::getGeneratedPool();\n"
@@ -1115,8 +1116,9 @@ void GenerateAddFilesToPool(
       file->CopyTo(file_proto);
       file->CopyTo(file_proto);
 
 
       // Filter out descriptor.proto as it cannot be depended on for now.
       // Filter out descriptor.proto as it cannot be depended on for now.
-      RepeatedPtrField<string>* dependency = file_proto->mutable_dependency();
-      for (RepeatedPtrField<string>::iterator it = dependency->begin();
+      RepeatedPtrField<std::string>* dependency =
+          file_proto->mutable_dependency();
+      for (RepeatedPtrField<std::string>::iterator it = dependency->begin();
            it != dependency->end(); ++it) {
            it != dependency->end(); ++it) {
         if (*it != kDescriptorFile) {
         if (*it != kDescriptorFile) {
           dependency->erase(it);
           dependency->erase(it);
@@ -1140,7 +1142,7 @@ void GenerateAddFilesToPool(
     }
     }
   }
   }
 
 
-  string files_data;
+  std::string files_data;
   sorted_file_set.SerializeToString(&files_data);
   sorted_file_set.SerializeToString(&files_data);
 
 
   printer->Print("$pool->internalAddGeneratedFile(hex2bin(\n");
   printer->Print("$pool->internalAddGeneratedFile(hex2bin(\n");
@@ -1183,7 +1185,7 @@ void GenerateHead(const FileDescriptor* file, io::Printer* printer) {
     "filename", file->name());
     "filename", file->name());
 }
 }
 
 
-std::string FilenameToClassname(const string& filename) {
+std::string FilenameToClassname(const std::string& filename) {
   int lastindex = filename.find_last_of(".");
   int lastindex = filename.find_last_of(".");
   std::string result = filename.substr(0, lastindex);
   std::string result = filename.substr(0, lastindex);
   for (int i = 0; i < result.size(); i++) {
   for (int i = 0; i < result.size(); i++) {
@@ -1206,7 +1208,7 @@ void GenerateMetadataFile(const FileDescriptor* file, const Options& options,
   std::string fullname = FilenameToClassname(filename);
   std::string fullname = FilenameToClassname(filename);
   int lastindex = fullname.find_last_of("\\");
   int lastindex = fullname.find_last_of("\\");
 
 
-  if (lastindex != string::npos) {
+  if (lastindex != std::string::npos) {
     printer.Print(
     printer.Print(
         "namespace ^name^;\n\n",
         "namespace ^name^;\n\n",
         "name", fullname.substr(0, lastindex));
         "name", fullname.substr(0, lastindex));
@@ -1279,7 +1281,7 @@ void GenerateEnumFile(const FileDescriptor* file, const EnumDescriptor* en,
   std::string fullname = FilenameToClassname(filename);
   std::string fullname = FilenameToClassname(filename);
   int lastindex = fullname.find_last_of("\\");
   int lastindex = fullname.find_last_of("\\");
 
 
-  if (lastindex != string::npos) {
+  if (lastindex != std::string::npos) {
     printer.Print(
     printer.Print(
         "namespace ^name^;\n\n",
         "namespace ^name^;\n\n",
         "name", fullname.substr(0, lastindex));
         "name", fullname.substr(0, lastindex));
@@ -1291,7 +1293,7 @@ void GenerateEnumFile(const FileDescriptor* file, const EnumDescriptor* en,
 
 
   GenerateEnumDocComment(&printer, en, options);
   GenerateEnumDocComment(&printer, en, options);
 
 
-  if (lastindex != string::npos) {
+  if (lastindex != std::string::npos) {
     fullname = fullname.substr(lastindex + 1);
     fullname = fullname.substr(lastindex + 1);
   }
   }
 
 
@@ -1390,7 +1392,7 @@ void GenerateMessageFile(const FileDescriptor* file, const Descriptor* message,
   std::string fullname = FilenameToClassname(filename);
   std::string fullname = FilenameToClassname(filename);
   int lastindex = fullname.find_last_of("\\");
   int lastindex = fullname.find_last_of("\\");
 
 
-  if (lastindex != string::npos) {
+  if (lastindex != std::string::npos) {
     printer.Print(
     printer.Print(
         "namespace ^name^;\n\n",
         "namespace ^name^;\n\n",
         "name", fullname.substr(0, lastindex));
         "name", fullname.substr(0, lastindex));
@@ -1399,7 +1401,7 @@ void GenerateMessageFile(const FileDescriptor* file, const Descriptor* message,
   GenerateUseDeclaration(options, &printer);
   GenerateUseDeclaration(options, &printer);
 
 
   GenerateMessageDocComment(&printer, message, options);
   GenerateMessageDocComment(&printer, message, options);
-  if (lastindex != string::npos) {
+  if (lastindex != std::string::npos) {
     fullname = fullname.substr(lastindex + 1);
     fullname = fullname.substr(lastindex + 1);
   }
   }
 
 
@@ -1510,7 +1512,7 @@ void GenerateServiceFile(
 
 
   if (!file->options().php_namespace().empty() ||
   if (!file->options().php_namespace().empty() ||
       (!file->options().has_php_namespace() && !file->package().empty()) ||
       (!file->options().has_php_namespace() && !file->package().empty()) ||
-      lastindex != string::npos) {
+      lastindex != std::string::npos) {
     printer.Print(
     printer.Print(
         "namespace ^name^;\n\n",
         "namespace ^name^;\n\n",
         "name", fullname.substr(0, lastindex));
         "name", fullname.substr(0, lastindex));
@@ -1518,13 +1520,13 @@ void GenerateServiceFile(
 
 
   GenerateServiceDocComment(&printer, service);
   GenerateServiceDocComment(&printer, service);
 
 
-  if (lastindex != string::npos) {
-      printer.Print(
+  if (lastindex != std::string::npos) {
+    printer.Print(
         "interface ^name^\n"
         "interface ^name^\n"
         "{\n",
         "{\n",
         "name", fullname.substr(lastindex + 1));
         "name", fullname.substr(lastindex + 1));
   } else {
   } else {
-      printer.Print(
+    printer.Print(
         "interface ^name^\n"
         "interface ^name^\n"
         "{\n",
         "{\n",
         "name", fullname);
         "name", fullname);
@@ -1560,13 +1562,13 @@ void GenerateFile(const FileDescriptor* file, const Options& options,
   }
   }
 }
 }
 
 
-static string EscapePhpdoc(const string& input) {
-  string result;
+static std::string EscapePhpdoc(const std::string& input) {
+  std::string result;
   result.reserve(input.size() * 2);
   result.reserve(input.size() * 2);
 
 
   char prev = '*';
   char prev = '*';
 
 
-  for (string::size_type i = 0; i < input.size(); i++) {
+  for (std::string::size_type i = 0; i < input.size(); i++) {
     char c = input[i];
     char c = input[i];
     switch (c) {
     switch (c) {
       case '*':
       case '*':
@@ -1605,8 +1607,9 @@ static string EscapePhpdoc(const string& input) {
 static void GenerateDocCommentBodyForLocation(
 static void GenerateDocCommentBodyForLocation(
     io::Printer* printer, const SourceLocation& location, bool trailingNewline,
     io::Printer* printer, const SourceLocation& location, bool trailingNewline,
     int indentCount) {
     int indentCount) {
-  string comments = location.leading_comments.empty() ?
-      location.trailing_comments : location.leading_comments;
+  std::string comments = location.leading_comments.empty()
+                             ? location.trailing_comments
+                             : location.leading_comments;
   if (!comments.empty()) {
   if (!comments.empty()) {
     // TODO(teboring):  Ideally we should parse the comment text as Markdown and
     // TODO(teboring):  Ideally we should parse the comment text as Markdown and
     //   write it back as HTML, but this requires a Markdown parser.  For now
     //   write it back as HTML, but this requires a Markdown parser.  For now
@@ -1616,7 +1619,7 @@ static void GenerateDocCommentBodyForLocation(
     // HTML-escape them so that they don't accidentally close the doc comment.
     // HTML-escape them so that they don't accidentally close the doc comment.
     comments = EscapePhpdoc(comments);
     comments = EscapePhpdoc(comments);
 
 
-    std::vector<string> lines = Split(comments, "\n", true);
+    std::vector<std::string> lines = Split(comments, "\n", true);
     while (!lines.empty() && lines.back().empty()) {
     while (!lines.empty() && lines.back().empty()) {
       lines.pop_back();
       lines.pop_back();
     }
     }
@@ -1647,11 +1650,11 @@ static void GenerateDocCommentBody(
   }
   }
 }
 }
 
 
-static string FirstLineOf(const string& value) {
-  string result = value;
+static std::string FirstLineOf(const std::string& value) {
+  std::string result = value;
 
 
-  string::size_type pos = result.find_first_of('\n');
-  if (pos != string::npos) {
+  std::string::size_type pos = result.find_first_of('\n');
+  if (pos != std::string::npos) {
     result.erase(pos);
     result.erase(pos);
   }
   }
 
 
@@ -2177,15 +2180,16 @@ void GenerateCWellKnownTypes(const std::vector<const FileDescriptor*>& files,
 
 
 }  // namespace
 }  // namespace
 
 
-bool Generator::Generate(const FileDescriptor* file, const string& parameter,
+bool Generator::Generate(const FileDescriptor* file,
+                         const std::string& parameter,
                          GeneratorContext* generator_context,
                          GeneratorContext* generator_context,
-                         string* error) const {
+                         std::string* error) const {
   return Generate(file, Options(), generator_context, error);
   return Generate(file, Options(), generator_context, error);
 }
 }
 
 
 bool Generator::Generate(const FileDescriptor* file, const Options& options,
 bool Generator::Generate(const FileDescriptor* file, const Options& options,
                          GeneratorContext* generator_context,
                          GeneratorContext* generator_context,
-                         string* error) const {
+                         std::string* error) const {
   if (options.is_descriptor && file->name() != kDescriptorFile) {
   if (options.is_descriptor && file->name() != kDescriptorFile) {
     *error =
     *error =
         "Can only generate PHP code for google/protobuf/descriptor.proto.\n";
         "Can only generate PHP code for google/protobuf/descriptor.proto.\n";

+ 3 - 3
src/google/protobuf/compiler/php/php_generator.h

@@ -49,9 +49,9 @@ class PROTOC_EXPORT Generator : public CodeGenerator {
  public:
  public:
   virtual bool Generate(
   virtual bool Generate(
       const FileDescriptor* file,
       const FileDescriptor* file,
-      const string& parameter,
+      const std::string& parameter,
       GeneratorContext* generator_context,
       GeneratorContext* generator_context,
-      string* error) const override;
+      std::string* error) const override;
 
 
   bool GenerateAll(const std::vector<const FileDescriptor*>& files,
   bool GenerateAll(const std::vector<const FileDescriptor*>& files,
                    const std::string& parameter,
                    const std::string& parameter,
@@ -67,7 +67,7 @@ class PROTOC_EXPORT Generator : public CodeGenerator {
       const FileDescriptor* file,
       const FileDescriptor* file,
       const Options& options,
       const Options& options,
       GeneratorContext* generator_context,
       GeneratorContext* generator_context,
-      string* error) const;
+      std::string* error) const;
 };
 };
 
 
 // To skip reserved keywords in php, some generated classname are prefixed.
 // To skip reserved keywords in php, some generated classname are prefixed.

+ 8 - 8
src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc

@@ -46,7 +46,7 @@ namespace compiler {
 namespace ruby {
 namespace ruby {
 namespace {
 namespace {
 
 
-string FindRubyTestDir() {
+std::string FindRubyTestDir() {
   return TestSourceDir() + "/google/protobuf/compiler/ruby";
   return TestSourceDir() + "/google/protobuf/compiler/ruby";
 }
 }
 
 
@@ -58,7 +58,7 @@ string FindRubyTestDir() {
 // extensions to the point where we can do this test in a more automated way.
 // extensions to the point where we can do this test in a more automated way.
 
 
 void RubyTest(string proto_file) {
 void RubyTest(string proto_file) {
-  string ruby_tests = FindRubyTestDir();
+  std::string ruby_tests = FindRubyTestDir();
 
 
   google::protobuf::compiler::CommandLineInterface cli;
   google::protobuf::compiler::CommandLineInterface cli;
   cli.SetInputsAreProtoPathRelative(true);
   cli.SetInputsAreProtoPathRelative(true);
@@ -67,7 +67,7 @@ void RubyTest(string proto_file) {
   cli.RegisterGenerator("--ruby_out", &ruby_generator, "");
   cli.RegisterGenerator("--ruby_out", &ruby_generator, "");
 
 
   // Copy generated_code.proto to the temporary test directory.
   // Copy generated_code.proto to the temporary test directory.
-  string test_input;
+  std::string test_input;
   GOOGLE_CHECK_OK(File::GetContents(
   GOOGLE_CHECK_OK(File::GetContents(
       ruby_tests + proto_file + ".proto",
       ruby_tests + proto_file + ".proto",
       &test_input,
       &test_input,
@@ -78,9 +78,9 @@ void RubyTest(string proto_file) {
       true));
       true));
 
 
   // Invoke the proto compiler (we will be inside TestTempDir() at this point).
   // Invoke the proto compiler (we will be inside TestTempDir() at this point).
-  string ruby_out = "--ruby_out=" + TestTempDir();
-  string proto_path = "--proto_path=" + TestTempDir();
-  string proto_target = TestTempDir() + proto_file + ".proto";
+  std::string ruby_out = "--ruby_out=" + TestTempDir();
+  std::string proto_path = "--proto_path=" + TestTempDir();
+  std::string proto_target = TestTempDir() + proto_file + ".proto";
   const char* argv[] = {
   const char* argv[] = {
     "protoc",
     "protoc",
     ruby_out.c_str(),
     ruby_out.c_str(),
@@ -91,12 +91,12 @@ void RubyTest(string proto_file) {
   EXPECT_EQ(0, cli.Run(4, argv));
   EXPECT_EQ(0, cli.Run(4, argv));
 
 
   // Load the generated output and compare to the expected result.
   // Load the generated output and compare to the expected result.
-  string output;
+  std::string output;
   GOOGLE_CHECK_OK(File::GetContentsAsText(
   GOOGLE_CHECK_OK(File::GetContentsAsText(
       TestTempDir() + proto_file + "_pb.rb",
       TestTempDir() + proto_file + "_pb.rb",
       &output,
       &output,
       true));
       true));
-  string expected_output;
+  std::string expected_output;
   GOOGLE_CHECK_OK(File::GetContentsAsText(
   GOOGLE_CHECK_OK(File::GetContentsAsText(
       ruby_tests + proto_file + "_pb.rb",
       ruby_tests + proto_file + "_pb.rb",
       &expected_output,
       &expected_output,

+ 2 - 45
tests.sh

@@ -316,7 +316,7 @@ build_python() {
   else
   else
     envlist=py\{27,36\}-python
     envlist=py\{27,36\}-python
   fi
   fi
-  tox -e $envlist
+  python -m tox -e $envlist
   cd ..
   cd ..
 }
 }
 
 
@@ -324,7 +324,7 @@ build_python_version() {
   internal_build_cpp
   internal_build_cpp
   cd python
   cd python
   envlist=$1
   envlist=$1
-  tox -e $envlist
+  python -m tox -e $envlist
   cd ..
   cd ..
 }
 }
 
 
@@ -467,45 +467,6 @@ use_php_zts() {
   internal_build_cpp
   internal_build_cpp
 }
 }
 
 
-build_php5.5() {
-  use_php 5.5
-
-  pushd php
-  rm -rf vendor
-  composer update
-  composer test
-  popd
-  (cd conformance && make test_php)
-}
-
-build_php5.6() {
-  use_php 5.6
-  pushd php
-  rm -rf vendor
-  composer update
-  composer test
-  popd
-  (cd conformance && make test_php)
-}
-
-build_php5.6_mac() {
-  # Install PHP
-  curl -s https://php-osx.liip.ch/install.sh | bash -s 5.6
-  PHP_FOLDER=`find /usr/local -type d -name "php5-5.6*"`  # The folder name may change upon time
-  test ! -z "$PHP_FOLDER"
-  export PATH="$PHP_FOLDER/bin:$PATH"
-
-  internal_build_cpp
-
-  # Run pure-PHP tests only.
-  pushd php
-  rm -rf vendor
-  composer update
-  composer test
-  popd
-  (cd conformance && make test_php)
-}
-
 build_php7.0() {
 build_php7.0() {
   use_php 7.0
   use_php 7.0
   pushd php
   pushd php
@@ -747,8 +708,6 @@ build_php8.0_all() {
 }
 }
 
 
 build_php_all_32() {
 build_php_all_32() {
-  build_php5.5
-  build_php5.6
   build_php7.0
   build_php7.0
   build_php7.1
   build_php7.1
   build_php7.4
   build_php7.4
@@ -803,8 +762,6 @@ Usage: $0 { cpp |
             ruby27 |
             ruby27 |
             jruby |
             jruby |
             ruby_all |
             ruby_all |
-            php5.5   |
-            php5.6   |
             php7.0   |
             php7.0   |
             php7.0_c |
             php7.0_c |
             php_compatibility |
             php_compatibility |

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott