Sync from Piper @314226556
PROTOBUF_SYNC_PIPER
diff --git a/BUILD b/BUILD
index daad6d8..996c334 100644
--- a/BUILD
+++ b/BUILD
@@ -966,6 +966,16 @@
objc_library(
name = "protobuf_objc",
hdrs = [
+ "objectivec/GPBAny.pbobjc.h",
+ "objectivec/GPBApi.pbobjc.h",
+ "objectivec/GPBDuration.pbobjc.h",
+ "objectivec/GPBEmpty.pbobjc.h",
+ "objectivec/GPBFieldMask.pbobjc.h",
+ "objectivec/GPBSourceContext.pbobjc.h",
+ "objectivec/GPBStruct.pbobjc.h",
+ "objectivec/GPBTimestamp.pbobjc.h",
+ "objectivec/GPBType.pbobjc.h",
+ "objectivec/GPBWrappers.pbobjc.h",
"objectivec/GPBArray.h",
"objectivec/GPBBootstrap.h",
"objectivec/GPBCodedInputStream.h",
@@ -1014,6 +1024,16 @@
"objectivec",
],
non_arc_srcs = [
+ "objectivec/GPBAny.pbobjc.m",
+ "objectivec/GPBApi.pbobjc.m",
+ "objectivec/GPBDuration.pbobjc.m",
+ "objectivec/GPBEmpty.pbobjc.m",
+ "objectivec/GPBFieldMask.pbobjc.m",
+ "objectivec/GPBSourceContext.pbobjc.m",
+ "objectivec/GPBStruct.pbobjc.m",
+ "objectivec/GPBTimestamp.pbobjc.m",
+ "objectivec/GPBType.pbobjc.m",
+ "objectivec/GPBWrappers.pbobjc.m",
"objectivec/GPBArray.m",
"objectivec/GPBCodedInputStream.m",
"objectivec/GPBCodedOutputStream.m",
@@ -1028,16 +1048,6 @@
"objectivec/GPBUtilities.m",
"objectivec/GPBWellKnownTypes.m",
"objectivec/GPBWireFormat.m",
- "objectivec/google/protobuf/Any.pbobjc.m",
- "objectivec/google/protobuf/Api.pbobjc.m",
- "objectivec/google/protobuf/Duration.pbobjc.m",
- "objectivec/google/protobuf/Empty.pbobjc.m",
- "objectivec/google/protobuf/FieldMask.pbobjc.m",
- "objectivec/google/protobuf/SourceContext.pbobjc.m",
- "objectivec/google/protobuf/Struct.pbobjc.m",
- "objectivec/google/protobuf/Timestamp.pbobjc.m",
- "objectivec/google/protobuf/Type.pbobjc.m",
- "objectivec/google/protobuf/Wrappers.pbobjc.m",
],
visibility = ["//visibility:public"],
)
diff --git a/CHANGES.txt b/CHANGES.txt
index 6234f16..43be322 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,28 @@
+Unreleased Changes
+
+ C++:
+ * Enabled heterogeneous lookup for std::string keys in maps.
+ * Improved the randomness of map ordering.
+
+ Python:
+ * Improved the error message when AttributeError is returned from __getattr__
+ in EnumTypeWrapper.
+
+2020-05-26 version 3.12.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
+
+ C++
+ * Simplified the template export macros to fix the build for mingw32. (#7539)
+
+ Objective-C
+ * Fix for the :protobuf_objc target in the Bazel BUILD file. (#7538)
+
+2020-05-20 version 3.12.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
+
+ Ruby
+ * Re-add binary gems for Ruby 2.3 and 2.4. These are EOL upstream, however
+ many people still use them and dropping support will require more
+ coordination.
+
2020-05-12 version 3.12.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Protocol Compiler
diff --git a/Makefile.am b/Makefile.am
index b873446..39c777c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -78,6 +78,7 @@
csharp/protos/unittest_import.proto \
csharp/protos/unittest_issues.proto \
csharp/protos/unittest_proto3.proto \
+ csharp/protos/unittest_selfreferential_options.proto \
csharp/protos/unittest.proto \
csharp/src/AddressBook/AddPerson.cs \
csharp/src/AddressBook/Addressbook.cs \
@@ -153,6 +154,7 @@
csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs \
csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs \
csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs \
+ csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs \
csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs \
csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs \
csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \
@@ -260,7 +262,6 @@
csharp/src/Google.Protobuf/UnknownFieldSet.cs
java_EXTRA_DIST= \
- java/BUILD \
java/README.md \
java/bom/pom.xml \
java/core/BUILD \
@@ -1205,6 +1206,10 @@
js/data.proto \
js/debug.js \
js/debug_test.js \
+ js/experimental/runtime/kernel/message_set.js \
+ js/experimental/runtime/kernel/message_set_test.js \
+ js/experimental/runtime/kernel/tag.js \
+ js/experimental/runtime/kernel/tag_test.js \
js/gulpfile.js \
js/jasmine.json \
js/map.js \
diff --git a/Protobuf-C++.podspec b/Protobuf-C++.podspec
index dcb9f4d..67a96cc 100644
--- a/Protobuf-C++.podspec
+++ b/Protobuf-C++.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Protobuf-C++'
- s.version = '3.11.4'
+ s.version = '3.12.2'
s.summary = 'Protocol Buffers v3 runtime library for C++.'
s.homepage = 'https://github.com/google/protobuf'
s.license = '3-Clause BSD License'
diff --git a/Protobuf.podspec b/Protobuf.podspec
index 5ff3597..a05b712 100644
--- a/Protobuf.podspec
+++ b/Protobuf.podspec
@@ -5,7 +5,7 @@
# dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s|
s.name = 'Protobuf'
- s.version = '3.12.0'
+ s.version = '3.12.2'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/protocolbuffers/protobuf'
s.license = '3-Clause BSD License'
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 8496799..9ca31ac 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -37,6 +37,9 @@
endif()
# Options
+if(WITH_PROTOC)
+ set(protobuf_PROTOC_EXE ${WITH_PROTOC} CACHE FILEPATH "Protocol Buffer Compiler executable" FORCE)
+endif()
option(protobuf_BUILD_TESTS "Build tests" ON)
option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF)
option(protobuf_BUILD_EXAMPLES "Build examples" OFF)
@@ -58,6 +61,12 @@
# User options
include(protobuf-options.cmake)
+# Overrides for option dependencies
+if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS)
+ set(protobuf_BUILD_LIBPROTOC ON)
+else()
+ set(protobuf_BUILD_LIBPROTOC OFF)
+endif ()
# Path to main configure script
set(protobuf_CONFIGURE_SCRIPT "../configure.ac")
@@ -242,11 +251,29 @@
include(libprotobuf-lite.cmake)
include(libprotobuf.cmake)
-if (protobuf_BUILD_PROTOC_BINARIES)
+if (protobuf_BUILD_LIBPROTOC)
include(libprotoc.cmake)
+endif (protobuf_BUILD_LIBPROTOC)
+if (protobuf_BUILD_PROTOC_BINARIES)
include(protoc.cmake)
+ if (NOT DEFINED protobuf_PROTOC_EXE)
+ set(protobuf_PROTOC_EXE protoc)
+ endif (NOT DEFINED protobuf_PROTOC_EXE)
endif (protobuf_BUILD_PROTOC_BINARIES)
+# Ensure we have a protoc executable if we need one
+if (protobuf_BUILD_TESTS OR protobuf_BUILD_CONFORMANCE OR protobuf_BUILD_EXAMPLES)
+ if (NOT DEFINED protobuf_PROTOC_EXE)
+ find_program(protobuf_PROTOC_EXE protoc)
+ if (NOT protobuf_PROTOC_EXE)
+ message(FATAL "Build requires 'protoc' but binary not found and not building protoc.")
+ endif ()
+ endif ()
+ if(protobuf_VERBOSE)
+ message(STATUS "Using protoc : ${protobuf_PROTOC_EXE}")
+ endif(protobuf_VERBOSE)
+endif ()
+
if (protobuf_BUILD_TESTS)
include(tests.cmake)
endif (protobuf_BUILD_TESTS)
@@ -262,5 +289,5 @@
endif (protobuf_BUILD_EXAMPLES)
if(protobuf_VERBOSE)
- message(STATUS "Protocol Buffers Configuring done")
-endif()
+ message(STATUS "Protocol Buffers Configuring done")
+endif(protobuf_VERBOSE)
diff --git a/cmake/conformance.cmake b/cmake/conformance.cmake
index 82b4cf5..76eae8a 100644
--- a/cmake/conformance.cmake
+++ b/cmake/conformance.cmake
@@ -1,8 +1,8 @@
add_custom_command(
OUTPUT ${protobuf_source_dir}/conformance/conformance.pb.cc
- DEPENDS protoc ${protobuf_source_dir}/conformance/conformance.proto
- COMMAND protoc ${protobuf_source_dir}/conformance/conformance.proto
+ DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/conformance/conformance.proto
+ COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/conformance/conformance.proto
--proto_path=${protobuf_source_dir}/conformance
--cpp_out=${protobuf_source_dir}/conformance
)
@@ -10,9 +10,9 @@
add_custom_command(
OUTPUT ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc
${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc
- DEPENDS protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto
- protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto
- COMMAND protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto
+ DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto
+ ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto
+ COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto
${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto
--proto_path=${protobuf_source_dir}/src
--cpp_out=${protobuf_source_dir}/src
diff --git a/cmake/tests.cmake b/cmake/tests.cmake
index a449372..4a54b70 100644
--- a/cmake/tests.cmake
+++ b/cmake/tests.cmake
@@ -87,8 +87,8 @@
get_filename_component(basename ${filename} NAME_WE)
add_custom_command(
OUTPUT ${protobuf_source_dir}/src/${dirname}/${basename}.pb.cc
- DEPENDS protoc ${protobuf_source_dir}/src/${dirname}/${basename}.proto
- COMMAND protoc ${protobuf_source_dir}/src/${dirname}/${basename}.proto
+ DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/${dirname}/${basename}.proto
+ COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/${dirname}/${basename}.proto
--proto_path=${protobuf_source_dir}/src
--cpp_out=${protobuf_source_dir}/src
--experimental_allow_proto3_optional
diff --git a/configure.ac b/configure.ac
index a86499a..e473a57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@
# In the SVN trunk, the version should always be the next anticipated release
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
# the size of one file name in the dist tarfile over the 99-char limit.)
-AC_INIT([Protocol Buffers],[3.11.4],[protobuf@googlegroups.com],[protobuf])
+AC_INIT([Protocol Buffers],[3.12.2],[protobuf@googlegroups.com],[protobuf])
AM_MAINTAINER_MODE([enable])
diff --git a/conformance/failure_list_python.txt b/conformance/failure_list_python.txt
index f551227..3f7a811 100644
--- a/conformance/failure_list_python.txt
+++ b/conformance/failure_list_python.txt
@@ -28,4 +28,3 @@
Required.Proto3.JsonInput.FloatFieldTooLarge
Required.Proto3.JsonInput.FloatFieldTooSmall
Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool
-Required.Proto3.JsonInput.TimestampJsonInputLowercaseT
diff --git a/conformance/failure_list_python_cpp.txt b/conformance/failure_list_python_cpp.txt
index 59a969d..df16455 100644
--- a/conformance/failure_list_python_cpp.txt
+++ b/conformance/failure_list_python_cpp.txt
@@ -19,4 +19,3 @@
Required.Proto3.JsonInput.FloatFieldTooLarge
Required.Proto3.JsonInput.FloatFieldTooSmall
Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool
-Required.Proto3.JsonInput.TimestampJsonInputLowercaseT
diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec
index d28a44e..50aca1b 100644
--- a/csharp/Google.Protobuf.Tools.nuspec
+++ b/csharp/Google.Protobuf.Tools.nuspec
@@ -5,7 +5,7 @@
<title>Google Protocol Buffers tools</title>
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
<description>See project site for more info.</description>
- <version>3.12.0</version>
+ <version>3.12.2</version>
<authors>Google Inc.</authors>
<owners>protobuf-packages</owners>
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>
diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
index 3ceb832..11615c8 100644
--- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj
+++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj
@@ -4,7 +4,7 @@
<Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
<Copyright>Copyright 2015, Google Inc.</Copyright>
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
- <VersionPrefix>3.12.0</VersionPrefix>
+ <VersionPrefix>3.12.2</VersionPrefix>
<!-- C# 7.2 is required for Span/BufferWriter/ReadOnlySequence -->
<LangVersion>7.2</LangVersion>
<Authors>Google Inc.</Authors>
@@ -31,7 +31,7 @@
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.2"/>
- <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Version="1.0.0-beta2-18618-05"/>
+ <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 -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0"/>
</ItemGroup>
diff --git a/global.json b/global.json
index 1c02f07..16f71a7 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,6 @@
{
"sdk": {
- "version": "3.0.100"
+ "version": "3.0.100",
+ "rollForward": "latestMinor"
}
}
diff --git a/java/bom/pom.xml b/java/bom/pom.xml
index 6fca4aa..5a63a1d 100644
--- a/java/bom/pom.xml
+++ b/java/bom/pom.xml
@@ -4,7 +4,7 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
- <version>3.12.0</version>
+ <version>3.12.2</version>
<packaging>pom</packaging>
<name>Protocol Buffers [BOM]</name>
diff --git a/java/core/pom.xml b/java/core/pom.xml
index 1bbf90e..4112eb2 100644
--- a/java/core/pom.xml
+++ b/java/core/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
- <version>3.12.0</version>
+ <version>3.12.2</version>
</parent>
<artifactId>protobuf-java</artifactId>
diff --git a/java/lite/pom.xml b/java/lite/pom.xml
index c5901a2..30e6f37 100644
--- a/java/lite/pom.xml
+++ b/java/lite/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
- <version>3.12.0</version>
+ <version>3.12.2</version>
</parent>
<artifactId>protobuf-javalite</artifactId>
diff --git a/java/pom.xml b/java/pom.xml
index 706e43d..f61c857 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -4,7 +4,7 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
- <version>3.12.0</version>
+ <version>3.12.2</version>
<packaging>pom</packaging>
<name>Protocol Buffers [Parent]</name>
diff --git a/java/util/pom.xml b/java/util/pom.xml
index 5d2cbc0..a9b8b4a 100644
--- a/java/util/pom.xml
+++ b/java/util/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
- <version>3.12.0</version>
+ <version>3.12.2</version>
</parent>
<artifactId>protobuf-java-util</artifactId>
diff --git a/js/message.js b/js/message.js
index c1736b3..f190894 100644
--- a/js/message.js
+++ b/js/message.js
@@ -417,7 +417,7 @@
*/
jspb.Message.isArray_ = function(o) {
return jspb.Message.ASSUME_LOCAL_ARRAYS ? o instanceof Array :
- goog.isArray(o);
+ Array.isArray(o);
};
/**
@@ -1433,7 +1433,7 @@
if (this.wrappers_) {
for (var fieldNumber in this.wrappers_) {
var val = this.wrappers_[fieldNumber];
- if (goog.isArray(val)) {
+ if (Array.isArray(val)) {
for (var i = 0; i < val.length; i++) {
if (val[i]) {
val[i].toArray();
@@ -1823,7 +1823,7 @@
*/
jspb.Message.clone_ = function(obj) {
var o;
- if (goog.isArray(obj)) {
+ if (Array.isArray(obj)) {
// Allocate array of correct size.
var clonedArray = new Array(obj.length);
// Use array iteration where possible because it is faster than for-in.
diff --git a/js/package.json b/js/package.json
index 14186be..7fd5e69 100644
--- a/js/package.json
+++ b/js/package.json
@@ -1,6 +1,6 @@
{
"name": "google-protobuf",
- "version": "3.11.4",
+ "version": "3.12.2",
"description": "Protocol Buffers for JavaScript",
"main": "google-protobuf.js",
"files": [
diff --git a/kokoro/linux/bazel/build.sh b/kokoro/linux/bazel/build.sh
index 9355eba..5f34bea 100755
--- a/kokoro/linux/bazel/build.sh
+++ b/kokoro/linux/bazel/build.sh
@@ -26,6 +26,9 @@
bazel test --copt=-Werror --host_copt=-Werror \
//:build_files_updated_unittest \
//java/... \
+ //:protoc \
+ //:protobuf \
+ //:protobuf_python \
//:protobuf_test \
@com_google_protobuf//:cc_proto_blacklist_test
trap - EXIT
diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml
index 687c43d..5c9d810 100644
--- a/php/ext/google/protobuf/package.xml
+++ b/php/ext/google/protobuf/package.xml
@@ -10,11 +10,11 @@
<email>protobuf-opensource@google.com</email>
<active>yes</active>
</lead>
- <date>2020-05-15</date>
- <time>13:26:23</time>
+ <date>2020-05-26</date>
+ <time>13:57:10</time>
<version>
- <release>3.12.0</release>
- <api>3.12.0</api>
+ <release>3.12.2</release>
+ <api>3.12.2</api>
</version>
<stability>
<release>stable</release>
@@ -571,5 +571,33 @@
<license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
<notes>GA release.</notes>
</release>
+ <release>
+ <version>
+ <release>3.12.1</release>
+ <api>3.12.1</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2020-05-20</date>
+ <time>10:18:13</time>
+ <license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
+ <notes>GA release.</notes>
+ </release>
+ <release>
+ <version>
+ <release>3.12.2</release>
+ <api>3.12.2</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2020-05-26</date>
+ <time>13:57:10</time>
+ <license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
+ <notes>GA release.</notes>
+ </release>
</changelog>
</package>
diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h
index 4f40ec2..090f960 100644
--- a/php/ext/google/protobuf/protobuf.h
+++ b/php/ext/google/protobuf/protobuf.h
@@ -37,7 +37,7 @@
#include "upb.h"
#define PHP_PROTOBUF_EXTNAME "protobuf"
-#define PHP_PROTOBUF_VERSION "3.12.0"
+#define PHP_PROTOBUF_VERSION "3.12.2"
#define MAX_LENGTH_OF_INT64 20
#define SIZEOF_INT64 8
diff --git a/php/release.sh b/php/release.sh
index 6b0baac..ec9ec0e 100755
--- a/php/release.sh
+++ b/php/release.sh
@@ -10,8 +10,8 @@
VERSION=$1
-git clone https://github.com/protocolbuffers/protobuf-php.git
-git clone https://github.com/protocolbuffers/protobuf.git
+git clone git@github.com:protocolbuffers/protobuf-php.git
+git clone git@github.com:protocolbuffers/protobuf.git
# Clean old files
pushd protobuf-php
diff --git a/php/tests/compatibility_test.sh b/php/tests/compatibility_test.sh
index 2b5c6ab..ddf05e8 100755
--- a/php/tests/compatibility_test.sh
+++ b/php/tests/compatibility_test.sh
@@ -1,17 +1,5 @@
#!/bin/bash
-function use_php() {
- VERSION=$1
-
- OLD_PATH=$PATH
- OLD_CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH
- OLD_C_INCLUDE_PATH=$C_INCLUDE_PATH
-
- export PATH=/usr/local/php-${VERSION}/bin:$OLD_PATH
- export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$OLD_CPLUS_INCLUDE_PATH
- export C_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$OLD_C_INCLUDE_PATH
-}
-
function generate_proto() {
PROTOC1=$1
PROTOC2=$2
@@ -92,7 +80,6 @@
popd
# Build and copy the new runtime
-use_php 7.1
pushd ../ext/google/protobuf
make clean || true
phpize && ./configure && make
diff --git a/php/tests/compile_extension.sh b/php/tests/compile_extension.sh
index 2ffc51f..3d6759e 100755
--- a/php/tests/compile_extension.sh
+++ b/php/tests/compile_extension.sh
@@ -1,14 +1,17 @@
#!/bin/bash
-VERSION=$2
+cd $(dirname $0)
-export PATH=/usr/local/php-$VERSION/bin:$PATH
-export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH
-export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH
+if [ "$1" = "--release"]; then
+ CFLAGS="-Wall"
+else
+ # To get debugging symbols in PHP itself, build PHP with:
+ # $ ./configure --enable-debug CFLAGS='-g -O0'
+ CFLAGS="-g -O0 -Wall"
+fi
pushd ../ext/google/protobuf
make clean || true
set -e
-# Add following in configure for debug: --enable-debug CFLAGS='-g -O0'
-phpize && ./configure CFLAGS='-g -O0 -Wall' && make
+phpize && ./configure --with-php-config=$(which php-config) CFLAGS="$CFLAGS" && make
popd
diff --git a/php/tests/gdb_test.sh b/php/tests/gdb_test.sh
index da5f3f3..76a0fc3 100755
--- a/php/tests/gdb_test.sh
+++ b/php/tests/gdb_test.sh
@@ -1,11 +1,5 @@
#!/bin/bash
-VERSION=$1
-
-export PATH=/usr/local/php-$VERSION/bin:$PATH
-export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH
-export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH
-
php -i | grep "Configuration"
# gdb --args php -dextension=../ext/google/protobuf/modules/protobuf.so `which
diff --git a/php/tests/multirequest.sh b/php/tests/multirequest.sh
index 97535ea..ec4a1ae 100755
--- a/php/tests/multirequest.sh
+++ b/php/tests/multirequest.sh
@@ -1,14 +1,12 @@
#!/bin/bash
+
+cd $(dirname $0)
+
set -e
-# Compile c extension
-VERSION=7.4
PORT=12345
-export PATH=/usr/local/php-$VERSION/bin:$PATH
-export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH
-export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH
-/bin/bash ./compile_extension.sh $VERSION
+./compile_extension.sh
nohup php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so -S localhost:$PORT multirequest.php 2>&1 &
diff --git a/php/tests/test.sh b/php/tests/test.sh
index 3c5e30d..3ecc0c7 100755
--- a/php/tests/test.sh
+++ b/php/tests/test.sh
@@ -1,13 +1,8 @@
#!/bin/bash
-VERSION=$1
+cd $(dirname $0)
-export PATH=/usr/local/php-$VERSION/bin:$PATH
-export C_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$C_INCLUDE_PATH
-export CPLUS_INCLUDE_PATH=/usr/local/php-$VERSION/include/php/main:/usr/local/php-$VERSION/include/php:$CPLUS_INCLUDE_PATH
-
-# Compile c extension
-/bin/bash ./compile_extension.sh $VERSION
+./compile_extension.sh
tests=( array_test.php encode_decode_test.php generated_class_test.php map_field_test.php well_known_test.php descriptors_test.php wrapper_type_setters_test.php)
diff --git a/protobuf.bzl b/protobuf.bzl
index 027937f..050eafc 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
@@ -85,8 +85,14 @@
import_flags = depset(direct=["-I."])
for dep in ctx.attr.deps:
- import_flags = depset(transitive=[import_flags, depset(direct=dep.proto.import_flags)])
- deps = depset(transitive=[deps, depset(direct=dep.proto.deps)])
+ if type(dep.proto.import_flags) == "list":
+ import_flags = depset(transitive=[import_flags], direct=dep.proto.import_flags)
+ else:
+ import_flags = depset(transitive=[import_flags, dep.proto.import_flags])
+ if type(dep.proto.deps) == "list":
+ deps = depset(transitive=[deps], direct=dep.proto.deps)
+ else:
+ deps = depset(transitive=[deps, dep.proto.deps])
if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin:
return struct(
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
index fb0c477..a160332 100644
--- a/protobuf_deps.bzl
+++ b/protobuf_deps.bzl
@@ -35,9 +35,9 @@
if not native.existing_rule("rules_cc"):
http_archive(
name = "rules_cc",
- sha256 = "29daf0159f0cf552fcff60b49d8bcd4f08f08506d2da6e41b07058ec50cfeaec",
- strip_prefix = "rules_cc-b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e",
- urls = ["https://github.com/bazelbuild/rules_cc/archive/b7fe9697c0c76ab2fd431a891dbb9a6a32ed7c3e.tar.gz"],
+ sha256 = "9d48151ea71b3e225adfb6867e6d2c7d0dce46cbdc8710d9a9a628574dfd40a0",
+ strip_prefix = "rules_cc-818289e5613731ae410efb54218a4077fb9dbb03",
+ urls = ["https://github.com/bazelbuild/rules_cc/archive/818289e5613731ae410efb54218a4077fb9dbb03.tar.gz"],
)
if not native.existing_rule("rules_java"):
diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml
index c64afb1..ed028d5 100644
--- a/protoc-artifacts/pom.xml
+++ b/protoc-artifacts/pom.xml
@@ -8,7 +8,7 @@
</parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protoc</artifactId>
- <version>3.12.0</version>
+ <version>3.12.2</version>
<packaging>pom</packaging>
<name>Protobuf Compiler</name>
<description>
diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py
index cc9a06a..8b3b580 100644
--- a/python/google/protobuf/__init__.py
+++ b/python/google/protobuf/__init__.py
@@ -30,7 +30,7 @@
# Copyright 2007 Google Inc. All Rights Reserved.
-__version__ = '3.11.4'
+__version__ = '3.12.2'
if __name__ != '__main__':
try:
diff --git a/python/google/protobuf/internal/json_format_test.py b/python/google/protobuf/internal/json_format_test.py
index d828272..104b947 100755
--- a/python/google/protobuf/internal/json_format_test.py
+++ b/python/google/protobuf/internal/json_format_test.py
@@ -269,7 +269,6 @@
}
self.assertEqual(expected_dict, message_dict)
-
def testExtensionSerializationJsonMatchesProto3Spec(self):
"""See go/proto3-json-spec for spec.
"""
@@ -295,7 +294,6 @@
'}}') % (ext1_text, ext2_text)
self.assertEqual(json.loads(golden_text), json.loads(message_text))
-
def testJsonEscapeString(self):
message = json_format_proto3_pb2.TestMessage()
if sys.version_info[0] < 3:
@@ -1036,6 +1034,15 @@
OverflowError,
'date value out of range',
json_format.MessageToJson, message)
+ # Lower case t does not accept.
+ text = '{"value": "0001-01-01t00:00:00Z"}'
+ with self.assertRaises(json_format.ParseError) as e:
+ json_format.Parse(text, message)
+ self.assertEqual(
+ 'Failed to parse value field: '
+ 'time data \'0001-01-01t00:00:00\' does not match format '
+ '\'%Y-%m-%dT%H:%M:%S\', lowercase \'t\' is not accepted.',
+ str(e.exception))
def testInvalidOneof(self):
message = json_format_proto3_pb2.TestOneof()
diff --git a/python/google/protobuf/internal/well_known_types.py b/python/google/protobuf/internal/well_known_types.py
index 308fbfe..cb646a7 100644
--- a/python/google/protobuf/internal/well_known_types.py
+++ b/python/google/protobuf/internal/well_known_types.py
@@ -160,6 +160,10 @@
else:
second_value = time_value[:point_position]
nano_value = time_value[point_position + 1:]
+ if 't' in second_value:
+ raise ValueError(
+ 'time data \'{0}\' does not match format \'%Y-%m-%dT%H:%M:%S\', '
+ 'lowercase \'t\' is not accepted'.format(second_value))
date_object = datetime.strptime(second_value, _TIMESTAMPFOMAT)
td = date_object - datetime(1970, 1, 1)
seconds = td.seconds + td.days * _SECONDS_PER_DAY
diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec
index 17df6fe..469074f 100644
--- a/ruby/google-protobuf.gemspec
+++ b/ruby/google-protobuf.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "google-protobuf"
- s.version = "3.12.0"
+ s.version = "3.12.2"
git_tag = "v#{s.version.to_s.sub('.rc.', '-rc')}" # Converts X.Y.Z.rc.N to vX.Y.Z-rcN, used for the git tag
s.licenses = ["BSD-3-Clause"]
s.summary = "Protocol Buffers"
diff --git a/src/Makefile.am b/src/Makefile.am
index 7ef5e1b..ffbee70 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,7 +18,7 @@
PTHREAD_DEF =
endif
-PROTOBUF_VERSION = 22:4:0
+PROTOBUF_VERSION = 23:2:0
if GCC
# Turn on all warnings except for sign comparison (we ignore sign comparison
diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h
index 187f7d8..08913bf 100644
--- a/src/google/protobuf/any.pb.h
+++ b/src/google/protobuf/any.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -45,7 +45,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fany_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
@@ -225,15 +225,6 @@
std::string* mutable_type_url();
std::string* release_type_url();
void set_allocated_type_url(std::string* type_url);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_type_url();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_type_url(
- std::string* type_url);
private:
const std::string& _internal_type_url() const;
void _internal_set_type_url(const std::string& value);
@@ -250,15 +241,6 @@
std::string* mutable_value();
std::string* release_value();
void set_allocated_value(std::string* value);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_value();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_value(
- std::string* value);
private:
const std::string& _internal_value() const;
void _internal_set_value(const std::string& value);
@@ -350,25 +332,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.type_url)
}
-inline std::string* Any::unsafe_arena_release_type_url() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Any.type_url)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return type_url_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Any::unsafe_arena_set_allocated_type_url(
- std::string* type_url) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (type_url != nullptr) {
-
- } else {
-
- }
- type_url_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- type_url, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Any.type_url)
-}
// bytes value = 2;
inline void Any::clear_value() {
@@ -431,25 +394,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Any.value)
}
-inline std::string* Any::unsafe_arena_release_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Any.value)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return value_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Any::unsafe_arena_set_allocated_value(
- std::string* value) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (value != nullptr) {
-
- } else {
-
- }
- value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- value, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Any.value)
-}
#ifdef __GNUC__
#pragma GCC diagnostic pop
diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h
index 21d57a7..3e199b6 100644
--- a/src/google/protobuf/api.pb.h
+++ b/src/google/protobuf/api.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -47,7 +47,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fapi_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
@@ -261,15 +261,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -286,15 +277,6 @@
std::string* mutable_version();
std::string* release_version();
void set_allocated_version(std::string* version);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_version();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_version(
- std::string* version);
private:
const std::string& _internal_version() const;
void _internal_set_version(const std::string& value);
@@ -496,15 +478,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -521,15 +494,6 @@
std::string* mutable_request_type_url();
std::string* release_request_type_url();
void set_allocated_request_type_url(std::string* request_type_url);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_request_type_url();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_request_type_url(
- std::string* request_type_url);
private:
const std::string& _internal_request_type_url() const;
void _internal_set_request_type_url(const std::string& value);
@@ -546,15 +510,6 @@
std::string* mutable_response_type_url();
std::string* release_response_type_url();
void set_allocated_response_type_url(std::string* response_type_url);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_response_type_url();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_response_type_url(
- std::string* response_type_url);
private:
const std::string& _internal_response_type_url() const;
void _internal_set_response_type_url(const std::string& value);
@@ -733,15 +688,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -758,15 +704,6 @@
std::string* mutable_root();
std::string* release_root();
void set_allocated_root(std::string* root);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_root();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_root(
- std::string* root);
private:
const std::string& _internal_root() const;
void _internal_set_root(const std::string& value);
@@ -857,25 +794,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.name)
}
-inline std::string* Api::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Api.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Api::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Api.name)
-}
// repeated .google.protobuf.Method methods = 2;
inline int Api::_internal_methods_size() const {
@@ -1013,25 +931,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Api.version)
}
-inline std::string* Api::unsafe_arena_release_version() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Api.version)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return version_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Api::unsafe_arena_set_allocated_version(
- std::string* version) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (version != nullptr) {
-
- } else {
-
- }
- version_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- version, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Api.version)
-}
// .google.protobuf.SourceContext source_context = 5;
inline bool Api::_internal_has_source_context() const {
@@ -1234,25 +1133,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.name)
}
-inline std::string* Method::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Method.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Method::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Method.name)
-}
// string request_type_url = 2;
inline void Method::clear_request_type_url() {
@@ -1315,25 +1195,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.request_type_url)
}
-inline std::string* Method::unsafe_arena_release_request_type_url() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Method.request_type_url)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return request_type_url_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Method::unsafe_arena_set_allocated_request_type_url(
- std::string* request_type_url) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (request_type_url != nullptr) {
-
- } else {
-
- }
- request_type_url_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- request_type_url, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Method.request_type_url)
-}
// bool request_streaming = 3;
inline void Method::clear_request_streaming() {
@@ -1416,25 +1277,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Method.response_type_url)
}
-inline std::string* Method::unsafe_arena_release_response_type_url() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Method.response_type_url)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return response_type_url_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Method::unsafe_arena_set_allocated_response_type_url(
- std::string* response_type_url) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (response_type_url != nullptr) {
-
- } else {
-
- }
- response_type_url_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- response_type_url, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Method.response_type_url)
-}
// bool response_streaming = 5;
inline void Method::clear_response_streaming() {
@@ -1577,25 +1419,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.name)
}
-inline std::string* Mixin::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Mixin.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Mixin::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Mixin.name)
-}
// string root = 2;
inline void Mixin::clear_root() {
@@ -1658,25 +1481,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Mixin.root)
}
-inline std::string* Mixin::unsafe_arena_release_root() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Mixin.root)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return root_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Mixin::unsafe_arena_set_allocated_root(
- std::string* root) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (root != nullptr) {
-
- } else {
-
- }
- root_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- root, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Mixin.root)
-}
#ifdef __GNUC__
#pragma GCC diagnostic pop
diff --git a/src/google/protobuf/arena_unittest.cc b/src/google/protobuf/arena_unittest.cc
index 5fa4b0c..8578420 100644
--- a/src/google/protobuf/arena_unittest.cc
+++ b/src/google/protobuf/arena_unittest.cc
@@ -858,23 +858,6 @@
}
}
-TEST(ArenaTest, UnsafeArenaReleaseAdd) {
- // Use unsafe_arena_release() and unsafe_arena_set_allocated() to transfer an
- // arena-allocated string from one message to another.
- const char kContent[] = "Test content";
-
- Arena arena;
- TestAllTypes* message1 = Arena::CreateMessage<TestAllTypes>(&arena);
- TestAllTypes* message2 = Arena::CreateMessage<TestAllTypes>(&arena);
- std::string* arena_string = Arena::Create<std::string>(&arena);
- *arena_string = kContent;
-
- message1->unsafe_arena_set_allocated_optional_string(arena_string);
- message2->unsafe_arena_set_allocated_optional_string(
- message1->unsafe_arena_release_optional_string());
- EXPECT_EQ(kContent, message2->optional_string());
-}
-
TEST(ArenaTest, UnsafeArenaAddAllocated) {
Arena arena;
TestAllTypes* message = Arena::CreateMessage<TestAllTypes>(&arena);
@@ -885,43 +868,20 @@
}
}
-TEST(ArenaTest, UnsafeArenaRelease) {
- Arena arena;
- TestAllTypes* message = Arena::CreateMessage<TestAllTypes>(&arena);
-
- std::string* s = new std::string("test string");
- message->unsafe_arena_set_allocated_optional_string(s);
- EXPECT_TRUE(message->has_optional_string());
- EXPECT_EQ("test string", message->optional_string());
- s = message->unsafe_arena_release_optional_string();
- EXPECT_FALSE(message->has_optional_string());
- delete s;
-
- s = new std::string("test string");
- message->unsafe_arena_set_allocated_oneof_string(s);
- EXPECT_TRUE(message->has_oneof_string());
- EXPECT_EQ("test string", message->oneof_string());
- s = message->unsafe_arena_release_oneof_string();
- EXPECT_FALSE(message->has_oneof_string());
- delete s;
-}
-
TEST(ArenaTest, OneofMerge) {
Arena arena;
TestAllTypes* message0 = Arena::CreateMessage<TestAllTypes>(&arena);
TestAllTypes* message1 = Arena::CreateMessage<TestAllTypes>(&arena);
- message0->unsafe_arena_set_allocated_oneof_string(new std::string("x"));
+ message0->set_oneof_string("x");
ASSERT_TRUE(message0->has_oneof_string());
- message1->unsafe_arena_set_allocated_oneof_string(new std::string("y"));
+ message1->set_oneof_string("y");
ASSERT_TRUE(message1->has_oneof_string());
EXPECT_EQ("x", message0->oneof_string());
EXPECT_EQ("y", message1->oneof_string());
message0->MergeFrom(*message1);
EXPECT_EQ("y", message0->oneof_string());
EXPECT_EQ("y", message1->oneof_string());
- delete message0->unsafe_arena_release_oneof_string();
- delete message1->unsafe_arena_release_oneof_string();
}
TEST(ArenaTest, ArenaOneofReflection) {
@@ -1345,19 +1305,6 @@
}
}
-TEST(ArenaTest, UnsafeSetAllocatedOnArena) {
- Arena arena;
- TestAllTypes* message = Arena::CreateMessage<TestAllTypes>(&arena);
- EXPECT_FALSE(message->has_optional_string());
-
- std::string owned_string = "test with long enough content to heap-allocate";
- message->unsafe_arena_set_allocated_optional_string(&owned_string);
- EXPECT_TRUE(message->has_optional_string());
-
- message->unsafe_arena_set_allocated_optional_string(NULL);
- EXPECT_FALSE(message->has_optional_string());
-}
-
// A helper utility class to only contain static hook functions, some
// counters to be used to verify the counters have been called and a cookie
// value to be verified.
diff --git a/src/google/protobuf/compiler/code_generator.h b/src/google/protobuf/compiler/code_generator.h
index 1bc8dfc..21131d5 100644
--- a/src/google/protobuf/compiler/code_generator.h
+++ b/src/google/protobuf/compiler/code_generator.h
@@ -110,7 +110,7 @@
// Implement this to indicate what features this code generator supports.
// This should be a bitwise OR of features from the Features enum in
// plugin.proto.
- virtual uint64 GetSupportedFeatures() const { return 0; }
+ virtual uint64_t GetSupportedFeatures() const { return 0; }
// This is no longer used, but this class is part of the opensource protobuf
// library, so it has to remain to keep vtables the same for the current
diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc
index e2961e5..7d69eb5 100644
--- a/src/google/protobuf/compiler/cpp/cpp_file.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_file.cc
@@ -1046,7 +1046,7 @@
"};\n"
"\n"
"PROTOBUF_CONSTEXPR_VAR "
- "::$proto_ns$::internal::AuxillaryParseTableField\n"
+ "::$proto_ns$::internal::AuxiliaryParseTableField\n"
" const $tablename$::aux[] "
"PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {\n");
format.Indent();
@@ -1060,7 +1060,7 @@
}
if (count == 0) {
- format("::$proto_ns$::internal::AuxillaryParseTableField(),\n");
+ format("::$proto_ns$::internal::AuxiliaryParseTableField(),\n");
}
format.Outdent();
@@ -1406,7 +1406,7 @@
// for table driven code.
" static const ::$proto_ns$::internal::ParseTableField entries[]\n"
" PROTOBUF_SECTION_VARIABLE(protodesc_cold);\n"
- " static const ::$proto_ns$::internal::AuxillaryParseTableField aux[]\n"
+ " static const ::$proto_ns$::internal::AuxiliaryParseTableField aux[]\n"
" PROTOBUF_SECTION_VARIABLE(protodesc_cold);\n"
" static const ::$proto_ns$::internal::ParseTable schema[$1$]\n"
" PROTOBUF_SECTION_VARIABLE(protodesc_cold);\n"
diff --git a/src/google/protobuf/compiler/cpp/cpp_generator.h b/src/google/protobuf/compiler/cpp/cpp_generator.h
index 85a5aab..97e848d 100644
--- a/src/google/protobuf/compiler/cpp/cpp_generator.h
+++ b/src/google/protobuf/compiler/cpp/cpp_generator.h
@@ -84,7 +84,7 @@
GeneratorContext* generator_context,
std::string* error) const override;
- uint64 GetSupportedFeatures() const override {
+ uint64_t GetSupportedFeatures() const override {
// We don't fully support this yet, but this is needed to unblock the tests,
// and we will have full support before the experimental flag is removed.
return FEATURE_PROTO3_OPTIONAL;
diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc
index 40ad78a..4e5d87e 100644
--- a/src/google/protobuf/compiler/cpp/cpp_message.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_message.cc
@@ -1706,7 +1706,7 @@
}
// TODO(ckennelly): Consolidate this with the calculation for
- // AuxillaryParseTableField.
+ // AuxiliaryParseTableField.
format(
"PROTOBUF_FIELD_OFFSET($classtype$, _internal_metadata_),\n"
"&$package_ns$::_$classname$_default_instance_,\n");
@@ -2302,14 +2302,14 @@
std::vector<const FieldDescriptor*> ordered_fields =
SortFieldsByNumber(descriptor_);
- format("::$proto_ns$::internal::AuxillaryParseTableField(),\n");
+ format("::$proto_ns$::internal::AuxiliaryParseTableField(),\n");
int last_field_number = 1;
for (auto field : ordered_fields) {
Formatter::SaveState saver(&format);
GOOGLE_CHECK_GE(field->number(), last_field_number);
for (; last_field_number < field->number(); last_field_number++) {
- format("::$proto_ns$::internal::AuxillaryParseTableField(),\n");
+ format("::$proto_ns$::internal::AuxiliaryParseTableField(),\n");
}
std::map<std::string, std::string> vars;
@@ -2320,11 +2320,11 @@
case FieldDescriptor::CPPTYPE_ENUM:
if (HasPreservingUnknownEnumSemantics(field)) {
format(
- "{::$proto_ns$::internal::AuxillaryParseTableField::enum_aux{"
+ "{::$proto_ns$::internal::AuxiliaryParseTableField::enum_aux{"
"nullptr}},\n");
} else {
format(
- "{::$proto_ns$::internal::AuxillaryParseTableField::enum_aux{"
+ "{::$proto_ns$::internal::AuxiliaryParseTableField::enum_aux{"
"$1$_IsValid}},\n",
ClassName(field->enum_type(), true));
}
@@ -2333,7 +2333,7 @@
case FieldDescriptor::CPPTYPE_MESSAGE: {
if (field->is_map()) {
format(
- "{::$proto_ns$::internal::AuxillaryParseTableField::map_"
+ "{::$proto_ns$::internal::AuxiliaryParseTableField::map_"
"aux{&::$proto_ns$::internal::ParseMap<$1$>}},\n",
QualifiedClassName(field->message_type(), options_));
last_field_number++;
@@ -2344,7 +2344,7 @@
field->message_type(), options_));
format(
- "{::$proto_ns$::internal::AuxillaryParseTableField::message_aux{\n"
+ "{::$proto_ns$::internal::AuxiliaryParseTableField::message_aux{\n"
" &$default_instance$}},\n");
last_field_number++;
break;
@@ -2367,7 +2367,7 @@
break;
}
format(
- "{::$proto_ns$::internal::AuxillaryParseTableField::string_aux{\n"
+ "{::$proto_ns$::internal::AuxiliaryParseTableField::string_aux{\n"
" $1$,\n"
" \"$2$\"\n"
"}},\n",
diff --git a/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
index ca365e7..5cf82f6 100644
--- a/src/google/protobuf/compiler/cpp/cpp_string_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_string_field.cc
@@ -179,23 +179,6 @@
"$deprecated_attr$void ${1$set_allocated_$name$$}$(std::string* "
"$name$);\n",
descriptor_);
- if (options_.opensource_runtime) {
- if (SupportsArenas(descriptor_)) {
- format(
- "$GOOGLE_PROTOBUF$_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors "
- "for\"\n"
- "\" string fields are deprecated and will be removed in a\"\n"
- "\" future release.\")\n"
- "std::string* ${1$unsafe_arena_release_$name$$}$();\n"
- "$GOOGLE_PROTOBUF$_RUNTIME_DEPRECATED(\"The unsafe_arena_ accessors "
- "for\"\n"
- "\" string fields are deprecated and will be removed in a\"\n"
- "\" future release.\")\n"
- "void ${1$unsafe_arena_set_allocated_$name$$}$(\n"
- " std::string* $name$);\n",
- descriptor_);
- }
- }
format(
"private:\n"
"const std::string& _internal_$name$() const;\n"
@@ -307,32 +290,6 @@
" GetArena());\n"
" // @@protoc_insertion_point(field_set_allocated:$full_name$)\n"
"}\n");
- if (options_.opensource_runtime) {
- format(
- "inline std::string* $classname$::unsafe_arena_release_$name$() {\n"
- "$annotate_accessor$"
- " // "
- "@@protoc_insertion_point(field_unsafe_arena_release:$full_name$)\n"
- " $DCHK$(GetArena() != nullptr);\n"
- " $clear_hasbit$\n"
- " return $name$_.UnsafeArenaRelease($default_variable$,\n"
- " GetArena());\n"
- "}\n"
- "inline void $classname$::unsafe_arena_set_allocated_$name$(\n"
- "$annotate_accessor$"
- " std::string* $name$) {\n"
- " $DCHK$(GetArena() != nullptr);\n"
- " if ($name$ != nullptr) {\n"
- " $set_hasbit$\n"
- " } else {\n"
- " $clear_hasbit$\n"
- " }\n"
- " $name$_.UnsafeArenaSetAllocated($default_variable$,\n"
- " $name$, GetArena());\n"
- " // @@protoc_insertion_point(field_unsafe_arena_set_allocated:"
- "$full_name$)\n"
- "}\n");
- }
} else {
// No-arena case.
format(
@@ -761,38 +718,6 @@
" }\n"
" // @@protoc_insertion_point(field_set_allocated:$full_name$)\n"
"}\n");
- if (options_.opensource_runtime) {
- format(
- "inline std::string* $classname$::unsafe_arena_release_$name$() {\n"
- "$annotate_accessor$"
- " // "
- "@@protoc_insertion_point(field_unsafe_arena_release:$full_name$)\n"
- " $DCHK$(GetArena() != nullptr);\n"
- " if (_internal_has_$name$()) {\n"
- " clear_has_$oneof_name$();\n"
- " return $field_member$.UnsafeArenaRelease(\n"
- " $default_variable$, GetArena());\n"
- " } else {\n"
- " return nullptr;\n"
- " }\n"
- "}\n"
- "inline void $classname$::unsafe_arena_set_allocated_$name$("
- "std::string* $name$) {\n"
- "$annotate_accessor$"
- " $DCHK$(GetArena() != nullptr);\n"
- " if (!_internal_has_$name$()) {\n"
- " $field_member$.UnsafeSetDefault($default_variable$);\n"
- " }\n"
- " clear_$oneof_name$();\n"
- " if ($name$) {\n"
- " set_has_$name$();\n"
- " $field_member$.UnsafeArenaSetAllocated($default_variable$, "
- "$name$, GetArena());\n"
- " }\n"
- " // @@protoc_insertion_point(field_unsafe_arena_set_allocated:"
- "$full_name$)\n"
- "}\n");
- }
} else {
// No-arena case.
format(
diff --git a/src/google/protobuf/compiler/java/java_generator.cc b/src/google/protobuf/compiler/java/java_generator.cc
index 11b04b8..29ae2cf 100644
--- a/src/google/protobuf/compiler/java/java_generator.cc
+++ b/src/google/protobuf/compiler/java/java_generator.cc
@@ -58,7 +58,7 @@
JavaGenerator::JavaGenerator() {}
JavaGenerator::~JavaGenerator() {}
-uint64 JavaGenerator::GetSupportedFeatures() const {
+uint64_t JavaGenerator::GetSupportedFeatures() const {
return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL;
}
diff --git a/src/google/protobuf/compiler/java/java_generator.h b/src/google/protobuf/compiler/java/java_generator.h
index a4e1708..6315e7c 100644
--- a/src/google/protobuf/compiler/java/java_generator.h
+++ b/src/google/protobuf/compiler/java/java_generator.h
@@ -60,7 +60,7 @@
bool Generate(const FileDescriptor* file, const std::string& parameter,
GeneratorContext* context, std::string* error) const override;
- uint64 GetSupportedFeatures() const override;
+ uint64_t GetSupportedFeatures() const override;
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JavaGenerator);
diff --git a/src/google/protobuf/compiler/mock_code_generator.cc b/src/google/protobuf/compiler/mock_code_generator.cc
index 8b82901..0b85056 100644
--- a/src/google/protobuf/compiler/mock_code_generator.cc
+++ b/src/google/protobuf/compiler/mock_code_generator.cc
@@ -87,7 +87,7 @@
MockCodeGenerator::~MockCodeGenerator() {}
-uint64 MockCodeGenerator::GetSupportedFeatures() const {
+uint64_t MockCodeGenerator::GetSupportedFeatures() const {
uint64 all_features = CodeGenerator::FEATURE_PROTO3_OPTIONAL;
return all_features & ~suppressed_features_;
}
diff --git a/src/google/protobuf/compiler/mock_code_generator.h b/src/google/protobuf/compiler/mock_code_generator.h
index 70a840e..9a72258 100644
--- a/src/google/protobuf/compiler/mock_code_generator.h
+++ b/src/google/protobuf/compiler/mock_code_generator.h
@@ -109,7 +109,7 @@
bool Generate(const FileDescriptor* file, const std::string& parameter,
GeneratorContext* context, std::string* error) const override;
- uint64 GetSupportedFeatures() const override;
+ uint64_t GetSupportedFeatures() const override;
void SuppressFeatures(uint64 features);
private:
diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h
index c614832..f4a0449 100644
--- a/src/google/protobuf/compiler/plugin.pb.h
+++ b/src/google/protobuf/compiler/plugin.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -53,7 +53,7 @@
struct PROTOC_EXPORT TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
@@ -251,15 +251,6 @@
std::string* mutable_suffix();
std::string* release_suffix();
void set_allocated_suffix(std::string* suffix);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_suffix();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_suffix(
- std::string* suffix);
private:
const std::string& _internal_suffix() const;
void _internal_set_suffix(const std::string& value);
@@ -503,15 +494,6 @@
std::string* mutable_parameter();
std::string* release_parameter();
void set_allocated_parameter(std::string* parameter);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_parameter();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_parameter(
- std::string* parameter);
private:
const std::string& _internal_parameter() const;
void _internal_set_parameter(const std::string& value);
@@ -691,15 +673,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -720,15 +693,6 @@
std::string* mutable_insertion_point();
std::string* release_insertion_point();
void set_allocated_insertion_point(std::string* insertion_point);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_insertion_point();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_insertion_point(
- std::string* insertion_point);
private:
const std::string& _internal_insertion_point() const;
void _internal_set_insertion_point(const std::string& value);
@@ -749,15 +713,6 @@
std::string* mutable_content();
std::string* release_content();
void set_allocated_content(std::string* content);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_content();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_content(
- std::string* content);
private:
const std::string& _internal_content() const;
void _internal_set_content(const std::string& value);
@@ -968,15 +923,6 @@
std::string* mutable_error();
std::string* release_error();
void set_allocated_error(std::string* error);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_error();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_error(
- std::string* error);
private:
const std::string& _internal_error() const;
void _internal_set_error(const std::string& value);
@@ -1178,25 +1124,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.Version.suffix)
}
-inline std::string* Version::unsafe_arena_release_suffix() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.compiler.Version.suffix)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return suffix_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Version::unsafe_arena_set_allocated_suffix(
- std::string* suffix) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (suffix != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- suffix_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- suffix, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.Version.suffix)
-}
// -------------------------------------------------------------------
@@ -1349,25 +1276,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.parameter)
}
-inline std::string* CodeGeneratorRequest::unsafe_arena_release_parameter() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.compiler.CodeGeneratorRequest.parameter)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return parameter_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void CodeGeneratorRequest::unsafe_arena_set_allocated_parameter(
- std::string* parameter) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (parameter != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- parameter_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- parameter, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.parameter)
-}
// repeated .google.protobuf.FileDescriptorProto proto_file = 15;
inline int CodeGeneratorRequest::_internal_proto_file_size() const {
@@ -1565,25 +1473,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.name)
}
-inline std::string* CodeGeneratorResponse_File::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.compiler.CodeGeneratorResponse.File.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.name)
-}
// optional string insertion_point = 2;
inline bool CodeGeneratorResponse_File::_internal_has_insertion_point() const {
@@ -1658,25 +1547,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)
}
-inline std::string* CodeGeneratorResponse_File::unsafe_arena_release_insertion_point() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000002u;
- return insertion_point_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_insertion_point(
- std::string* insertion_point) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (insertion_point != nullptr) {
- _has_bits_[0] |= 0x00000002u;
- } else {
- _has_bits_[0] &= ~0x00000002u;
- }
- insertion_point_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- insertion_point, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point)
-}
// optional string content = 15;
inline bool CodeGeneratorResponse_File::_internal_has_content() const {
@@ -1751,25 +1621,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.content)
}
-inline std::string* CodeGeneratorResponse_File::unsafe_arena_release_content() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.compiler.CodeGeneratorResponse.File.content)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000004u;
- return content_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_content(
- std::string* content) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (content != nullptr) {
- _has_bits_[0] |= 0x00000004u;
- } else {
- _has_bits_[0] &= ~0x00000004u;
- }
- content_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- content, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.content)
-}
// -------------------------------------------------------------------
@@ -1848,25 +1699,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.error)
}
-inline std::string* CodeGeneratorResponse::unsafe_arena_release_error() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.compiler.CodeGeneratorResponse.error)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return error_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void CodeGeneratorResponse::unsafe_arena_set_allocated_error(
- std::string* error) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (error != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- error_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- error, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.error)
-}
// optional uint64 supported_features = 2;
inline bool CodeGeneratorResponse::_internal_has_supported_features() const {
diff --git a/src/google/protobuf/compiler/python/python_generator.cc b/src/google/protobuf/compiler/python/python_generator.cc
index 88804bd..a95b37f 100644
--- a/src/google/protobuf/compiler/python/python_generator.cc
+++ b/src/google/protobuf/compiler/python/python_generator.cc
@@ -301,7 +301,7 @@
Generator::~Generator() {}
-uint64 Generator::GetSupportedFeatures() const {
+uint64_t Generator::GetSupportedFeatures() const {
return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL;
}
diff --git a/src/google/protobuf/compiler/python/python_generator.h b/src/google/protobuf/compiler/python/python_generator.h
index fb1aee1..ed1c995 100644
--- a/src/google/protobuf/compiler/python/python_generator.h
+++ b/src/google/protobuf/compiler/python/python_generator.h
@@ -73,7 +73,7 @@
GeneratorContext* generator_context,
std::string* error) const override;
- uint64 GetSupportedFeatures() const override;
+ uint64_t GetSupportedFeatures() const override;
private:
void PrintImports() const;
diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc
index 5001222..9a448ff 100644
--- a/src/google/protobuf/descriptor.cc
+++ b/src/google/protobuf/descriptor.cc
@@ -434,14 +434,14 @@
const Symbol kNullSymbol;
-typedef HASH_MAP<const char*, Symbol, HASH_FXN<const char*>, streq>
+typedef HASH_MAP<StringPiece, Symbol, HASH_FXN<StringPiece>>
SymbolsByNameMap;
typedef HASH_MAP<PointerStringPair, Symbol, PointerStringPairHash>
SymbolsByParentMap;
-typedef HASH_MAP<const char*, const FileDescriptor*, HASH_FXN<const char*>,
- streq>
+typedef HASH_MAP<StringPiece, const FileDescriptor*,
+ HASH_FXN<StringPiece>>
FilesByNameMap;
typedef HASH_MAP<PointerStringPair, const FieldDescriptor*,
@@ -576,16 +576,16 @@
// Find symbols. This returns a null Symbol (symbol.IsNull() is true)
// if not found.
- inline Symbol FindSymbol(const std::string& key) const;
+ inline Symbol FindSymbol(StringPiece key) const;
// This implements the body of DescriptorPool::Find*ByName(). It should
// really be a private method of DescriptorPool, but that would require
// declaring Symbol in descriptor.h, which would drag all kinds of other
// stuff into the header. Yay C++.
- Symbol FindByNameHelper(const DescriptorPool* pool, const std::string& name);
+ Symbol FindByNameHelper(const DescriptorPool* pool, StringPiece name);
// These return nullptr if not found.
- inline const FileDescriptor* FindFile(const std::string& key) const;
+ inline const FileDescriptor* FindFile(StringPiece key) const;
inline const FieldDescriptor* FindExtension(const Descriptor* extendee,
int number) const;
inline void FindAllExtensions(const Descriptor* extendee,
@@ -619,7 +619,7 @@
// Allocate a string which will be destroyed when the pool is destroyed.
// The string is initialized to the given value for convenience.
- std::string* AllocateString(const std::string& value);
+ std::string* AllocateString(StringPiece value);
// Allocate empty string which will be destroyed when the pool is destroyed.
std::string* AllocateEmptyString();
@@ -715,9 +715,9 @@
inline const FieldDescriptor* FindFieldByNumber(const Descriptor* parent,
int number) const;
inline const FieldDescriptor* FindFieldByLowercaseName(
- const void* parent, const std::string& lowercase_name) const;
+ const void* parent, StringPiece lowercase_name) const;
inline const FieldDescriptor* FindFieldByCamelcaseName(
- const void* parent, const std::string& camelcase_name) const;
+ const void* parent, StringPiece camelcase_name) const;
inline const EnumValueDescriptor* FindEnumValueByNumber(
const EnumDescriptor* parent, int number) const;
// This creates a new EnumValueDescriptor if not found, in a thread-safe way.
@@ -884,8 +884,8 @@
// -------------------------------------------------------------------
-inline Symbol DescriptorPool::Tables::FindSymbol(const std::string& key) const {
- const Symbol* result = FindOrNull(symbols_by_name_, key.c_str());
+inline Symbol DescriptorPool::Tables::FindSymbol(StringPiece key) const {
+ const Symbol* result = FindOrNull(symbols_by_name_, key);
if (result == nullptr) {
return kNullSymbol;
} else {
@@ -912,7 +912,7 @@
}
Symbol DescriptorPool::Tables::FindByNameHelper(const DescriptorPool* pool,
- const std::string& name) {
+ StringPiece name) {
if (pool->mutex_ != nullptr) {
// Fast path: the Symbol is already cached. This is just a hash lookup.
ReaderMutexLock lock(pool->mutex_);
@@ -944,8 +944,8 @@
}
inline const FileDescriptor* DescriptorPool::Tables::FindFile(
- const std::string& key) const {
- return FindPtrOrNull(files_by_name_, key.c_str());
+ StringPiece key) const {
+ return FindPtrOrNull(files_by_name_, key);
}
inline const FieldDescriptor* FileDescriptorTables::FindFieldByNumber(
@@ -982,12 +982,12 @@
}
inline const FieldDescriptor* FileDescriptorTables::FindFieldByLowercaseName(
- const void* parent, const std::string& lowercase_name) const {
+ const void* parent, StringPiece lowercase_name) const {
internal::call_once(
fields_by_lowercase_name_once_,
&FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic, this);
return FindPtrOrNull(fields_by_lowercase_name_,
- PointerStringPair(parent, lowercase_name.c_str()));
+ PointerStringPair(parent, lowercase_name));
}
void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic(
@@ -1006,12 +1006,12 @@
}
inline const FieldDescriptor* FileDescriptorTables::FindFieldByCamelcaseName(
- const void* parent, const std::string& camelcase_name) const {
+ const void* parent, StringPiece camelcase_name) const {
internal::call_once(
fields_by_camelcase_name_once_,
FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic, this);
return FindPtrOrNull(fields_by_camelcase_name_,
- PointerStringPair(parent, camelcase_name.c_str()));
+ PointerStringPair(parent, camelcase_name));
}
inline const EnumValueDescriptor* FileDescriptorTables::FindEnumValueByNumber(
@@ -1181,7 +1181,7 @@
return reinterpret_cast<Type*>(AllocateBytes(sizeof(Type) * count));
}
-std::string* DescriptorPool::Tables::AllocateString(const std::string& value) {
+std::string* DescriptorPool::Tables::AllocateString(StringPiece value) {
std::string* result = new std::string(value);
strings_.emplace_back(result);
return result;
@@ -1293,16 +1293,16 @@
enforce_dependencies_ = false;
}
-void DescriptorPool::AddUnusedImportTrackFile(const std::string& file_name,
+void DescriptorPool::AddUnusedImportTrackFile(ConstStringParam file_name,
bool is_error) {
- unused_import_track_files_[file_name] = is_error;
+ unused_import_track_files_[std::string(file_name)] = is_error;
}
void DescriptorPool::ClearUnusedImportTrackFiles() {
unused_import_track_files_.clear();
}
-bool DescriptorPool::InternalIsFileLoaded(const std::string& filename) const {
+bool DescriptorPool::InternalIsFileLoaded(ConstStringParam filename) const {
MutexLockMaybe lock(mutex_);
return tables_->FindFile(filename) != nullptr;
}
@@ -1379,7 +1379,7 @@
// there's nothing more important to do (read: never).
const FileDescriptor* DescriptorPool::FindFileByName(
- const std::string& name) const {
+ ConstStringParam name) const {
MutexLockMaybe lock(mutex_);
if (fallback_database_ != nullptr) {
tables_->known_bad_symbols_.clear();
@@ -1399,7 +1399,7 @@
}
const FileDescriptor* DescriptorPool::FindFileContainingSymbol(
- const std::string& symbol_name) const {
+ ConstStringParam symbol_name) const {
MutexLockMaybe lock(mutex_);
if (fallback_database_ != nullptr) {
tables_->known_bad_symbols_.clear();
@@ -1420,13 +1420,13 @@
}
const Descriptor* DescriptorPool::FindMessageTypeByName(
- const std::string& name) const {
+ ConstStringParam name) const {
Symbol result = tables_->FindByNameHelper(this, name);
return (result.type == Symbol::MESSAGE) ? result.descriptor : nullptr;
}
const FieldDescriptor* DescriptorPool::FindFieldByName(
- const std::string& name) const {
+ ConstStringParam name) const {
Symbol result = tables_->FindByNameHelper(this, name);
if (result.type == Symbol::FIELD &&
!result.field_descriptor->is_extension()) {
@@ -1437,7 +1437,7 @@
}
const FieldDescriptor* DescriptorPool::FindExtensionByName(
- const std::string& name) const {
+ ConstStringParam name) const {
Symbol result = tables_->FindByNameHelper(this, name);
if (result.type == Symbol::FIELD && result.field_descriptor->is_extension()) {
return result.field_descriptor;
@@ -1447,32 +1447,32 @@
}
const OneofDescriptor* DescriptorPool::FindOneofByName(
- const std::string& name) const {
+ ConstStringParam name) const {
Symbol result = tables_->FindByNameHelper(this, name);
return (result.type == Symbol::ONEOF) ? result.oneof_descriptor : nullptr;
}
const EnumDescriptor* DescriptorPool::FindEnumTypeByName(
- const std::string& name) const {
+ ConstStringParam name) const {
Symbol result = tables_->FindByNameHelper(this, name);
return (result.type == Symbol::ENUM) ? result.enum_descriptor : nullptr;
}
const EnumValueDescriptor* DescriptorPool::FindEnumValueByName(
- const std::string& name) const {
+ ConstStringParam name) const {
Symbol result = tables_->FindByNameHelper(this, name);
return (result.type == Symbol::ENUM_VALUE) ? result.enum_value_descriptor
: nullptr;
}
const ServiceDescriptor* DescriptorPool::FindServiceByName(
- const std::string& name) const {
+ ConstStringParam name) const {
Symbol result = tables_->FindByNameHelper(this, name);
return (result.type == Symbol::SERVICE) ? result.service_descriptor : nullptr;
}
const MethodDescriptor* DescriptorPool::FindMethodByName(
- const std::string& name) const {
+ ConstStringParam name) const {
Symbol result = tables_->FindByNameHelper(this, name);
return (result.type == Symbol::METHOD) ? result.method_descriptor : nullptr;
}
@@ -1529,7 +1529,7 @@
}
const FieldDescriptor* DescriptorPool::FindExtensionByPrintableName(
- const Descriptor* extendee, const std::string& printable_name) const {
+ const Descriptor* extendee, ConstStringParam printable_name) const {
if (extendee->extension_range_count() == 0) return nullptr;
const FieldDescriptor* result = FindExtensionByName(printable_name);
if (result != nullptr && result->containing_type() == extendee) {
@@ -1600,7 +1600,7 @@
}
const FieldDescriptor* Descriptor::FindFieldByLowercaseName(
- const std::string& key) const {
+ ConstStringParam key) const {
const FieldDescriptor* result =
file()->tables_->FindFieldByLowercaseName(this, key);
if (result == nullptr || result->is_extension()) {
@@ -1611,7 +1611,7 @@
}
const FieldDescriptor* Descriptor::FindFieldByCamelcaseName(
- const std::string& key) const {
+ ConstStringParam key) const {
const FieldDescriptor* result =
file()->tables_->FindFieldByCamelcaseName(this, key);
if (result == nullptr || result->is_extension()) {
@@ -1621,8 +1621,7 @@
}
}
-const FieldDescriptor* Descriptor::FindFieldByName(
- const std::string& key) const {
+const FieldDescriptor* Descriptor::FindFieldByName(ConstStringParam key) const {
Symbol result =
file()->tables_->FindNestedSymbolOfType(this, key, Symbol::FIELD);
if (!result.IsNull() && !result.field_descriptor->is_extension()) {
@@ -1632,8 +1631,7 @@
}
}
-const OneofDescriptor* Descriptor::FindOneofByName(
- const std::string& key) const {
+const OneofDescriptor* Descriptor::FindOneofByName(ConstStringParam key) const {
Symbol result =
file()->tables_->FindNestedSymbolOfType(this, key, Symbol::ONEOF);
if (!result.IsNull()) {
@@ -1644,7 +1642,7 @@
}
const FieldDescriptor* Descriptor::FindExtensionByName(
- const std::string& key) const {
+ ConstStringParam key) const {
Symbol result =
file()->tables_->FindNestedSymbolOfType(this, key, Symbol::FIELD);
if (!result.IsNull() && result.field_descriptor->is_extension()) {
@@ -1655,7 +1653,7 @@
}
const FieldDescriptor* Descriptor::FindExtensionByLowercaseName(
- const std::string& key) const {
+ ConstStringParam key) const {
const FieldDescriptor* result =
file()->tables_->FindFieldByLowercaseName(this, key);
if (result == nullptr || !result->is_extension()) {
@@ -1666,7 +1664,7 @@
}
const FieldDescriptor* Descriptor::FindExtensionByCamelcaseName(
- const std::string& key) const {
+ ConstStringParam key) const {
const FieldDescriptor* result =
file()->tables_->FindFieldByCamelcaseName(this, key);
if (result == nullptr || !result->is_extension()) {
@@ -1676,8 +1674,7 @@
}
}
-const Descriptor* Descriptor::FindNestedTypeByName(
- const std::string& key) const {
+const Descriptor* Descriptor::FindNestedTypeByName(ConstStringParam key) const {
Symbol result =
file()->tables_->FindNestedSymbolOfType(this, key, Symbol::MESSAGE);
if (!result.IsNull()) {
@@ -1688,7 +1685,7 @@
}
const EnumDescriptor* Descriptor::FindEnumTypeByName(
- const std::string& key) const {
+ ConstStringParam key) const {
Symbol result =
file()->tables_->FindNestedSymbolOfType(this, key, Symbol::ENUM);
if (!result.IsNull()) {
@@ -1699,7 +1696,7 @@
}
const EnumValueDescriptor* Descriptor::FindEnumValueByName(
- const std::string& key) const {
+ ConstStringParam key) const {
Symbol result =
file()->tables_->FindNestedSymbolOfType(this, key, Symbol::ENUM_VALUE);
if (!result.IsNull()) {
@@ -1742,7 +1739,7 @@
}
const MethodDescriptor* ServiceDescriptor::FindMethodByName(
- const std::string& key) const {
+ ConstStringParam key) const {
Symbol result =
file()->tables_->FindNestedSymbolOfType(this, key, Symbol::METHOD);
if (!result.IsNull()) {
@@ -1753,7 +1750,7 @@
}
const Descriptor* FileDescriptor::FindMessageTypeByName(
- const std::string& key) const {
+ ConstStringParam key) const {
Symbol result = tables_->FindNestedSymbolOfType(this, key, Symbol::MESSAGE);
if (!result.IsNull()) {
return result.descriptor;
@@ -1763,7 +1760,7 @@
}
const EnumDescriptor* FileDescriptor::FindEnumTypeByName(
- const std::string& key) const {
+ ConstStringParam key) const {
Symbol result = tables_->FindNestedSymbolOfType(this, key, Symbol::ENUM);
if (!result.IsNull()) {
return result.enum_descriptor;
@@ -1773,7 +1770,7 @@
}
const EnumValueDescriptor* FileDescriptor::FindEnumValueByName(
- const std::string& key) const {
+ ConstStringParam key) const {
Symbol result =
tables_->FindNestedSymbolOfType(this, key, Symbol::ENUM_VALUE);
if (!result.IsNull()) {
@@ -1784,7 +1781,7 @@
}
const ServiceDescriptor* FileDescriptor::FindServiceByName(
- const std::string& key) const {
+ ConstStringParam key) const {
Symbol result = tables_->FindNestedSymbolOfType(this, key, Symbol::SERVICE);
if (!result.IsNull()) {
return result.service_descriptor;
@@ -1794,7 +1791,7 @@
}
const FieldDescriptor* FileDescriptor::FindExtensionByName(
- const std::string& key) const {
+ ConstStringParam key) const {
Symbol result = tables_->FindNestedSymbolOfType(this, key, Symbol::FIELD);
if (!result.IsNull() && result.field_descriptor->is_extension()) {
return result.field_descriptor;
@@ -1804,7 +1801,7 @@
}
const FieldDescriptor* FileDescriptor::FindExtensionByLowercaseName(
- const std::string& key) const {
+ ConstStringParam key) const {
const FieldDescriptor* result = tables_->FindFieldByLowercaseName(this, key);
if (result == nullptr || !result->is_extension()) {
return nullptr;
@@ -1814,7 +1811,7 @@
}
const FieldDescriptor* FileDescriptor::FindExtensionByCamelcaseName(
- const std::string& key) const {
+ ConstStringParam key) const {
const FieldDescriptor* result = tables_->FindFieldByCamelcaseName(this, key);
if (result == nullptr || !result->is_extension()) {
return nullptr;
@@ -1871,22 +1868,23 @@
// -------------------------------------------------------------------
bool DescriptorPool::TryFindFileInFallbackDatabase(
- const std::string& name) const {
+ StringPiece name) const {
if (fallback_database_ == nullptr) return false;
- if (tables_->known_bad_files_.count(name) > 0) return false;
+ auto name_string = std::string(name);
+ if (tables_->known_bad_files_.count(name_string) > 0) return false;
FileDescriptorProto file_proto;
- if (!fallback_database_->FindFileByName(name, &file_proto) ||
+ if (!fallback_database_->FindFileByName(name_string, &file_proto) ||
BuildFileFromDatabase(file_proto) == nullptr) {
- tables_->known_bad_files_.insert(name);
+ tables_->known_bad_files_.insert(std::move(name_string));
return false;
}
return true;
}
-bool DescriptorPool::IsSubSymbolOfBuiltType(const std::string& name) const {
- std::string prefix = name;
+bool DescriptorPool::IsSubSymbolOfBuiltType(StringPiece name) const {
+ auto prefix = std::string(name);
for (;;) {
std::string::size_type dot_pos = prefix.find_last_of('.');
if (dot_pos == std::string::npos) {
@@ -1908,10 +1906,11 @@
}
bool DescriptorPool::TryFindSymbolInFallbackDatabase(
- const std::string& name) const {
+ StringPiece name) const {
if (fallback_database_ == nullptr) return false;
- if (tables_->known_bad_symbols_.count(name) > 0) return false;
+ auto name_string = std::string(name);
+ if (tables_->known_bad_symbols_.count(name_string) > 0) return false;
FileDescriptorProto file_proto;
if ( // We skip looking in the fallback database if the name is a sub-symbol
@@ -1933,7 +1932,7 @@
IsSubSymbolOfBuiltType(name)
// Look up file containing this symbol in fallback database.
- || !fallback_database_->FindFileContainingSymbol(name, &file_proto)
+ || !fallback_database_->FindFileContainingSymbol(name_string, &file_proto)
// Check if we've already built this file. If so, it apparently doesn't
// contain the symbol we're looking for. Some DescriptorDatabases
@@ -1942,7 +1941,7 @@
// Build the file.
|| BuildFileFromDatabase(file_proto) == nullptr) {
- tables_->known_bad_symbols_.insert(name);
+ tables_->known_bad_symbols_.insert(std::move(name_string));
return false;
}
@@ -3864,7 +3863,7 @@
return result;
}
-static bool ValidateQualifiedName(const std::string& name) {
+static bool ValidateQualifiedName(StringPiece name) {
bool last_was_period = false;
for (int i = 0; i < name.size(); i++) {
@@ -3884,14 +3883,14 @@
return !name.empty() && !last_was_period;
}
-Symbol DescriptorPool::NewPlaceholder(const std::string& name,
+Symbol DescriptorPool::NewPlaceholder(StringPiece name,
PlaceholderType placeholder_type) const {
MutexLockMaybe lock(mutex_);
return NewPlaceholderWithMutexHeld(name, placeholder_type);
}
Symbol DescriptorPool::NewPlaceholderWithMutexHeld(
- const std::string& name, PlaceholderType placeholder_type) const {
+ StringPiece name, PlaceholderType placeholder_type) const {
if (mutex_) {
mutex_->AssertHeld();
}
@@ -3989,13 +3988,13 @@
}
FileDescriptor* DescriptorPool::NewPlaceholderFile(
- const std::string& name) const {
+ StringPiece name) const {
MutexLockMaybe lock(mutex_);
return NewPlaceholderFileWithMutexHeld(name);
}
FileDescriptor* DescriptorPool::NewPlaceholderFileWithMutexHeld(
- const std::string& name) const {
+ StringPiece name) const {
if (mutex_) {
mutex_->AssertHeld();
}
@@ -7269,9 +7268,9 @@
}
}
-Symbol DescriptorPool::CrossLinkOnDemandHelper(const std::string& name,
+Symbol DescriptorPool::CrossLinkOnDemandHelper(StringPiece name,
bool expecting_enum) const {
- std::string lookup_name = name;
+ auto lookup_name = std::string(name);
if (!lookup_name.empty() && lookup_name[0] == '.') {
lookup_name = lookup_name.substr(1);
}
@@ -7399,7 +7398,7 @@
descriptor_ = descriptor;
}
-void LazyDescriptor::SetLazy(const std::string& name,
+void LazyDescriptor::SetLazy(StringPiece name,
const FileDescriptor* file) {
// verify Init() has been called and Set hasn't been called yet.
GOOGLE_CHECK(!descriptor_);
diff --git a/src/google/protobuf/descriptor.h b/src/google/protobuf/descriptor.h
index f0d2064..078f24a 100644
--- a/src/google/protobuf/descriptor.h
+++ b/src/google/protobuf/descriptor.h
@@ -203,7 +203,7 @@
// build time if the symbol wasn't found and building of the file containing
// that type is delayed because lazily_build_dependencies_ is set on the pool.
// Should not be called after Set() has been called.
- void SetLazy(const std::string& name, const FileDescriptor* file);
+ void SetLazy(StringPiece name, const FileDescriptor* file);
// Returns the current value of the descriptor, thread-safe. If SetLazy(...)
// has been called, will do a one-time cross link of the type specified,
@@ -321,20 +321,20 @@
// exists.
const FieldDescriptor* FindFieldByNumber(int number) const;
// Looks up a field by name. Returns nullptr if no such field exists.
- const FieldDescriptor* FindFieldByName(const std::string& name) const;
+ const FieldDescriptor* FindFieldByName(ConstStringParam name) const;
// Looks up a field by lowercased name (as returned by lowercase_name()).
// This lookup may be ambiguous if multiple field names differ only by case,
// in which case the field returned is chosen arbitrarily from the matches.
const FieldDescriptor* FindFieldByLowercaseName(
- const std::string& lowercase_name) const;
+ ConstStringParam lowercase_name) const;
// Looks up a field by camel-case name (as returned by camelcase_name()).
// This lookup may be ambiguous if multiple field names differ in a way that
// leads them to have identical camel-case names, in which case the field
// returned is chosen arbitrarily from the matches.
const FieldDescriptor* FindFieldByCamelcaseName(
- const std::string& camelcase_name) const;
+ ConstStringParam camelcase_name) const;
// The number of oneofs in this message type.
int oneof_decl_count() const;
@@ -347,7 +347,7 @@
const OneofDescriptor* oneof_decl(int index) const;
// Looks up a oneof by name. Returns nullptr if no such oneof exists.
- const OneofDescriptor* FindOneofByName(const std::string& name) const;
+ const OneofDescriptor* FindOneofByName(ConstStringParam name) const;
// Nested type stuff -----------------------------------------------
@@ -359,7 +359,7 @@
// Looks up a nested type by name. Returns nullptr if no such nested type
// exists.
- const Descriptor* FindNestedTypeByName(const std::string& name) const;
+ const Descriptor* FindNestedTypeByName(ConstStringParam name) const;
// Enum stuff ------------------------------------------------------
@@ -371,11 +371,11 @@
// Looks up an enum type by name. Returns nullptr if no such enum type
// exists.
- const EnumDescriptor* FindEnumTypeByName(const std::string& name) const;
+ const EnumDescriptor* FindEnumTypeByName(ConstStringParam name) const;
// Looks up an enum value by name, among all enum types in this message.
// Returns nullptr if no such value exists.
- const EnumValueDescriptor* FindEnumValueByName(const std::string& name) const;
+ const EnumValueDescriptor* FindEnumValueByName(ConstStringParam name) const;
// Extensions ------------------------------------------------------
@@ -439,17 +439,17 @@
// Looks up a named extension (which extends some *other* message type)
// defined within this message type's scope.
- const FieldDescriptor* FindExtensionByName(const std::string& name) const;
+ const FieldDescriptor* FindExtensionByName(ConstStringParam name) const;
// Similar to FindFieldByLowercaseName(), but finds extensions defined within
// this message type's scope.
const FieldDescriptor* FindExtensionByLowercaseName(
- const std::string& name) const;
+ ConstStringParam name) const;
// Similar to FindFieldByCamelcaseName(), but finds extensions defined within
// this message type's scope.
const FieldDescriptor* FindExtensionByCamelcaseName(
- const std::string& name) const;
+ ConstStringParam name) const;
// Reserved fields -------------------------------------------------
@@ -479,7 +479,7 @@
const std::string& reserved_name(int index) const;
// Returns true if the field name is reserved.
- bool IsReservedName(const std::string& name) const;
+ bool IsReservedName(ConstStringParam name) const;
// Source Location ---------------------------------------------------
@@ -1088,7 +1088,7 @@
const std::string& reserved_name(int index) const;
// Returns true if the field name is reserved.
- bool IsReservedName(const std::string& name) const;
+ bool IsReservedName(ConstStringParam name) const;
// Source Location ---------------------------------------------------
@@ -1267,7 +1267,7 @@
const MethodDescriptor* method(int index) const;
// Look up a MethodDescriptor by name.
- const MethodDescriptor* FindMethodByName(const std::string& name) const;
+ const MethodDescriptor* FindMethodByName(ConstStringParam name) const;
// See Descriptor::CopyTo().
void CopyTo(ServiceDescriptorProto* proto) const;
@@ -1488,25 +1488,25 @@
static const char* SyntaxName(Syntax syntax);
// Find a top-level message type by name. Returns nullptr if not found.
- const Descriptor* FindMessageTypeByName(const std::string& name) const;
+ const Descriptor* FindMessageTypeByName(ConstStringParam name) const;
// Find a top-level enum type by name. Returns nullptr if not found.
- const EnumDescriptor* FindEnumTypeByName(const std::string& name) const;
+ const EnumDescriptor* FindEnumTypeByName(ConstStringParam name) const;
// Find an enum value defined in any top-level enum by name. Returns nullptr
// if not found.
- const EnumValueDescriptor* FindEnumValueByName(const std::string& name) const;
+ const EnumValueDescriptor* FindEnumValueByName(ConstStringParam name) const;
// Find a service definition by name. Returns nullptr if not found.
- const ServiceDescriptor* FindServiceByName(const std::string& name) const;
+ const ServiceDescriptor* FindServiceByName(ConstStringParam name) const;
// Find a top-level extension definition by name. Returns nullptr if not
// found.
- const FieldDescriptor* FindExtensionByName(const std::string& name) const;
+ const FieldDescriptor* FindExtensionByName(ConstStringParam name) const;
// Similar to FindExtensionByName(), but searches by lowercased-name. See
// Descriptor::FindFieldByLowercaseName().
const FieldDescriptor* FindExtensionByLowercaseName(
- const std::string& name) const;
+ ConstStringParam name) const;
// Similar to FindExtensionByName(), but searches by camelcased-name. See
// Descriptor::FindFieldByCamelcaseName().
const FieldDescriptor* FindExtensionByCamelcaseName(
- const std::string& name) const;
+ ConstStringParam name) const;
// See Descriptor::CopyTo().
// Notes:
@@ -1669,28 +1669,28 @@
// Find a FileDescriptor in the pool by file name. Returns nullptr if not
// found.
- const FileDescriptor* FindFileByName(const std::string& name) const;
+ const FileDescriptor* FindFileByName(ConstStringParam name) const;
// Find the FileDescriptor in the pool which defines the given symbol.
// If any of the Find*ByName() methods below would succeed, then this is
// equivalent to calling that method and calling the result's file() method.
// Otherwise this returns nullptr.
const FileDescriptor* FindFileContainingSymbol(
- const std::string& symbol_name) const;
+ ConstStringParam symbol_name) const;
// Looking up descriptors ------------------------------------------
// These find descriptors by fully-qualified name. These will find both
// top-level descriptors and nested descriptors. They return nullptr if not
// found.
- const Descriptor* FindMessageTypeByName(const std::string& name) const;
- const FieldDescriptor* FindFieldByName(const std::string& name) const;
- const FieldDescriptor* FindExtensionByName(const std::string& name) const;
- const OneofDescriptor* FindOneofByName(const std::string& name) const;
- const EnumDescriptor* FindEnumTypeByName(const std::string& name) const;
- const EnumValueDescriptor* FindEnumValueByName(const std::string& name) const;
- const ServiceDescriptor* FindServiceByName(const std::string& name) const;
- const MethodDescriptor* FindMethodByName(const std::string& name) const;
+ const Descriptor* FindMessageTypeByName(ConstStringParam name) const;
+ const FieldDescriptor* FindFieldByName(ConstStringParam name) const;
+ const FieldDescriptor* FindExtensionByName(ConstStringParam name) const;
+ const OneofDescriptor* FindOneofByName(ConstStringParam name) const;
+ const EnumDescriptor* FindEnumTypeByName(ConstStringParam name) const;
+ const EnumValueDescriptor* FindEnumValueByName(ConstStringParam name) const;
+ const ServiceDescriptor* FindServiceByName(ConstStringParam name) const;
+ const MethodDescriptor* FindMethodByName(ConstStringParam name) const;
// Finds an extension of the given type by number. The extendee must be
// a member of this DescriptorPool or one of its underlays.
@@ -1703,7 +1703,7 @@
// or one of its underlays. Returns nullptr if there is no known message
// extension with the given printable name.
const FieldDescriptor* FindExtensionByPrintableName(
- const Descriptor* extendee, const std::string& printable_name) const;
+ const Descriptor* extendee, ConstStringParam printable_name) const;
// Finds extensions of extendee. The extensions will be appended to
// out in an undefined order. Only extensions defined directly in
@@ -1876,11 +1876,11 @@
// For internal (unit test) use only: Returns true if a FileDescriptor has
// been constructed for the given file, false otherwise. Useful for testing
// lazy descriptor initialization behavior.
- bool InternalIsFileLoaded(const std::string& filename) const;
+ bool InternalIsFileLoaded(ConstStringParam filename) const;
// Add a file to unused_import_track_files_. DescriptorBuilder will log
// warnings or errors for those files if there is any unused import.
- void AddUnusedImportTrackFile(const std::string& file_name,
+ void AddUnusedImportTrackFile(ConstStringParam file_name,
bool is_error = false);
void ClearUnusedImportTrackFiles();
@@ -1899,14 +1899,14 @@
// Return true if the given name is a sub-symbol of any non-package
// descriptor that already exists in the descriptor pool. (The full
// definition of such types is already known.)
- bool IsSubSymbolOfBuiltType(const std::string& name) const;
+ bool IsSubSymbolOfBuiltType(StringPiece name) const;
// Tries to find something in the fallback database and link in the
// corresponding proto file. Returns true if successful, in which case
// the caller should search for the thing again. These are declared
// const because they are called by (semantically) const methods.
- bool TryFindFileInFallbackDatabase(const std::string& name) const;
- bool TryFindSymbolInFallbackDatabase(const std::string& name) const;
+ bool TryFindFileInFallbackDatabase(StringPiece name) const;
+ bool TryFindSymbolInFallbackDatabase(StringPiece name) const;
bool TryFindExtensionInFallbackDatabase(const Descriptor* containing_type,
int field_number) const;
@@ -1927,13 +1927,12 @@
// symbol is defined if necessary. Will create a placeholder if the type
// doesn't exist in the fallback database, or the file doesn't build
// successfully.
- Symbol CrossLinkOnDemandHelper(const std::string& name,
+ Symbol CrossLinkOnDemandHelper(StringPiece name,
bool expecting_enum) const;
// Create a placeholder FileDescriptor of the specified name
- FileDescriptor* NewPlaceholderFile(const std::string& name) const;
- FileDescriptor* NewPlaceholderFileWithMutexHeld(
- const std::string& name) const;
+ FileDescriptor* NewPlaceholderFile(StringPiece name) const;
+ FileDescriptor* NewPlaceholderFileWithMutexHeld(StringPiece name) const;
enum PlaceholderType {
PLACEHOLDER_MESSAGE,
@@ -1941,9 +1940,9 @@
PLACEHOLDER_EXTENDABLE_MESSAGE
};
// Create a placeholder Descriptor of the specified name
- Symbol NewPlaceholder(const std::string& name,
+ Symbol NewPlaceholder(StringPiece name,
PlaceholderType placeholder_type) const;
- Symbol NewPlaceholderWithMutexHeld(const std::string& name,
+ Symbol NewPlaceholderWithMutexHeld(StringPiece name,
PlaceholderType placeholder_type) const;
// If fallback_database_ is nullptr, this is nullptr. Otherwise, this is a
@@ -2126,9 +2125,9 @@
return FindReservedRangeContainingNumber(number) != nullptr;
}
-inline bool Descriptor::IsReservedName(const std::string& name) const {
+inline bool Descriptor::IsReservedName(ConstStringParam name) const {
for (int i = 0; i < reserved_name_count(); i++) {
- if (name == reserved_name(i)) {
+ if (name == static_cast<ConstStringParam>(reserved_name(i))) {
return true;
}
}
@@ -2145,9 +2144,9 @@
return FindReservedRangeContainingNumber(number) != nullptr;
}
-inline bool EnumDescriptor::IsReservedName(const std::string& name) const {
+inline bool EnumDescriptor::IsReservedName(ConstStringParam name) const {
for (int i = 0; i < reserved_name_count(); i++) {
- if (name == reserved_name(i)) {
+ if (name == static_cast<ConstStringParam>(reserved_name(i))) {
return true;
}
}
diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h
index b41f228..fd0ed66 100644
--- a/src/google/protobuf/descriptor.pb.h
+++ b/src/google/protobuf/descriptor.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -46,7 +46,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fdescriptor_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[27]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
@@ -770,15 +770,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -799,15 +790,6 @@
std::string* mutable_package();
std::string* release_package();
void set_allocated_package(std::string* package);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_package();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_package(
- std::string* package);
private:
const std::string& _internal_package() const;
void _internal_set_package(const std::string& value);
@@ -828,15 +810,6 @@
std::string* mutable_syntax();
std::string* release_syntax();
void set_allocated_syntax(std::string* syntax);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_syntax();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_syntax(
- std::string* syntax);
private:
const std::string& _internal_syntax() const;
void _internal_set_syntax(const std::string& value);
@@ -1550,15 +1523,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -2002,15 +1966,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -2031,15 +1986,6 @@
std::string* mutable_extendee();
std::string* release_extendee();
void set_allocated_extendee(std::string* extendee);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_extendee();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_extendee(
- std::string* extendee);
private:
const std::string& _internal_extendee() const;
void _internal_set_extendee(const std::string& value);
@@ -2060,15 +2006,6 @@
std::string* mutable_type_name();
std::string* release_type_name();
void set_allocated_type_name(std::string* type_name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_type_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_type_name(
- std::string* type_name);
private:
const std::string& _internal_type_name() const;
void _internal_set_type_name(const std::string& value);
@@ -2089,15 +2026,6 @@
std::string* mutable_default_value();
std::string* release_default_value();
void set_allocated_default_value(std::string* default_value);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_default_value();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_default_value(
- std::string* default_value);
private:
const std::string& _internal_default_value() const;
void _internal_set_default_value(const std::string& value);
@@ -2118,15 +2046,6 @@
std::string* mutable_json_name();
std::string* release_json_name();
void set_allocated_json_name(std::string* json_name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_json_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_json_name(
- std::string* json_name);
private:
const std::string& _internal_json_name() const;
void _internal_set_json_name(const std::string& value);
@@ -2377,15 +2296,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -2791,15 +2701,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -2980,15 +2881,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -3198,15 +3090,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -3388,15 +3271,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -3417,15 +3291,6 @@
std::string* mutable_input_type();
std::string* release_input_type();
void set_allocated_input_type(std::string* input_type);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_input_type();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_input_type(
- std::string* input_type);
private:
const std::string& _internal_input_type() const;
void _internal_set_input_type(const std::string& value);
@@ -3446,15 +3311,6 @@
std::string* mutable_output_type();
std::string* release_output_type();
void set_allocated_output_type(std::string* output_type);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_output_type();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_output_type(
- std::string* output_type);
private:
const std::string& _internal_output_type() const;
void _internal_set_output_type(const std::string& value);
@@ -3730,15 +3586,6 @@
std::string* mutable_java_package();
std::string* release_java_package();
void set_allocated_java_package(std::string* java_package);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_java_package();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_java_package(
- std::string* java_package);
private:
const std::string& _internal_java_package() const;
void _internal_set_java_package(const std::string& value);
@@ -3759,15 +3606,6 @@
std::string* mutable_java_outer_classname();
std::string* release_java_outer_classname();
void set_allocated_java_outer_classname(std::string* java_outer_classname);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_java_outer_classname();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_java_outer_classname(
- std::string* java_outer_classname);
private:
const std::string& _internal_java_outer_classname() const;
void _internal_set_java_outer_classname(const std::string& value);
@@ -3788,15 +3626,6 @@
std::string* mutable_go_package();
std::string* release_go_package();
void set_allocated_go_package(std::string* go_package);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_go_package();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_go_package(
- std::string* go_package);
private:
const std::string& _internal_go_package() const;
void _internal_set_go_package(const std::string& value);
@@ -3817,15 +3646,6 @@
std::string* mutable_objc_class_prefix();
std::string* release_objc_class_prefix();
void set_allocated_objc_class_prefix(std::string* objc_class_prefix);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_objc_class_prefix();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_objc_class_prefix(
- std::string* objc_class_prefix);
private:
const std::string& _internal_objc_class_prefix() const;
void _internal_set_objc_class_prefix(const std::string& value);
@@ -3846,15 +3666,6 @@
std::string* mutable_csharp_namespace();
std::string* release_csharp_namespace();
void set_allocated_csharp_namespace(std::string* csharp_namespace);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_csharp_namespace();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_csharp_namespace(
- std::string* csharp_namespace);
private:
const std::string& _internal_csharp_namespace() const;
void _internal_set_csharp_namespace(const std::string& value);
@@ -3875,15 +3686,6 @@
std::string* mutable_swift_prefix();
std::string* release_swift_prefix();
void set_allocated_swift_prefix(std::string* swift_prefix);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_swift_prefix();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_swift_prefix(
- std::string* swift_prefix);
private:
const std::string& _internal_swift_prefix() const;
void _internal_set_swift_prefix(const std::string& value);
@@ -3904,15 +3706,6 @@
std::string* mutable_php_class_prefix();
std::string* release_php_class_prefix();
void set_allocated_php_class_prefix(std::string* php_class_prefix);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_php_class_prefix();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_php_class_prefix(
- std::string* php_class_prefix);
private:
const std::string& _internal_php_class_prefix() const;
void _internal_set_php_class_prefix(const std::string& value);
@@ -3933,15 +3726,6 @@
std::string* mutable_php_namespace();
std::string* release_php_namespace();
void set_allocated_php_namespace(std::string* php_namespace);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_php_namespace();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_php_namespace(
- std::string* php_namespace);
private:
const std::string& _internal_php_namespace() const;
void _internal_set_php_namespace(const std::string& value);
@@ -3962,15 +3746,6 @@
std::string* mutable_php_metadata_namespace();
std::string* release_php_metadata_namespace();
void set_allocated_php_metadata_namespace(std::string* php_metadata_namespace);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_php_metadata_namespace();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_php_metadata_namespace(
- std::string* php_metadata_namespace);
private:
const std::string& _internal_php_metadata_namespace() const;
void _internal_set_php_metadata_namespace(const std::string& value);
@@ -3991,15 +3766,6 @@
std::string* mutable_ruby_package();
std::string* release_ruby_package();
void set_allocated_ruby_package(std::string* ruby_package);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_ruby_package();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_ruby_package(
- std::string* ruby_package);
private:
const std::string& _internal_ruby_package() const;
void _internal_set_ruby_package(const std::string& value);
@@ -5744,15 +5510,6 @@
std::string* mutable_name_part();
std::string* release_name_part();
void set_allocated_name_part(std::string* name_part);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name_part();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name_part(
- std::string* name_part);
private:
const std::string& _internal_name_part() const;
void _internal_set_name_part(const std::string& value);
@@ -5952,15 +5709,6 @@
std::string* mutable_identifier_value();
std::string* release_identifier_value();
void set_allocated_identifier_value(std::string* identifier_value);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_identifier_value();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_identifier_value(
- std::string* identifier_value);
private:
const std::string& _internal_identifier_value() const;
void _internal_set_identifier_value(const std::string& value);
@@ -5981,15 +5729,6 @@
std::string* mutable_string_value();
std::string* release_string_value();
void set_allocated_string_value(std::string* string_value);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_string_value();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_string_value(
- std::string* string_value);
private:
const std::string& _internal_string_value() const;
void _internal_set_string_value(const std::string& value);
@@ -6010,15 +5749,6 @@
std::string* mutable_aggregate_value();
std::string* release_aggregate_value();
void set_allocated_aggregate_value(std::string* aggregate_value);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_aggregate_value();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_aggregate_value(
- std::string* aggregate_value);
private:
const std::string& _internal_aggregate_value() const;
void _internal_set_aggregate_value(const std::string& value);
@@ -6292,15 +6022,6 @@
std::string* mutable_leading_comments();
std::string* release_leading_comments();
void set_allocated_leading_comments(std::string* leading_comments);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_leading_comments();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_leading_comments(
- std::string* leading_comments);
private:
const std::string& _internal_leading_comments() const;
void _internal_set_leading_comments(const std::string& value);
@@ -6321,15 +6042,6 @@
std::string* mutable_trailing_comments();
std::string* release_trailing_comments();
void set_allocated_trailing_comments(std::string* trailing_comments);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_trailing_comments();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_trailing_comments(
- std::string* trailing_comments);
private:
const std::string& _internal_trailing_comments() const;
void _internal_set_trailing_comments(const std::string& value);
@@ -6672,15 +6384,6 @@
std::string* mutable_source_file();
std::string* release_source_file();
void set_allocated_source_file(std::string* source_file);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_source_file();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_source_file(
- std::string* source_file);
private:
const std::string& _internal_source_file() const;
void _internal_set_source_file(const std::string& value);
@@ -7011,25 +6714,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.name)
}
-inline std::string* FileDescriptorProto::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileDescriptorProto::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.name)
-}
// optional string package = 2;
inline bool FileDescriptorProto::_internal_has_package() const {
@@ -7104,25 +6788,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.package)
}
-inline std::string* FileDescriptorProto::unsafe_arena_release_package() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.package)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000002u;
- return package_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileDescriptorProto::unsafe_arena_set_allocated_package(
- std::string* package) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (package != nullptr) {
- _has_bits_[0] |= 0x00000002u;
- } else {
- _has_bits_[0] &= ~0x00000002u;
- }
- package_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- package, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.package)
-}
// repeated string dependency = 3;
inline int FileDescriptorProto::_internal_dependency_size() const {
@@ -7687,25 +7352,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.syntax)
}
-inline std::string* FileDescriptorProto::unsafe_arena_release_syntax() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.syntax)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000004u;
- return syntax_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileDescriptorProto::unsafe_arena_set_allocated_syntax(
- std::string* syntax) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (syntax != nullptr) {
- _has_bits_[0] |= 0x00000004u;
- } else {
- _has_bits_[0] &= ~0x00000004u;
- }
- syntax_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- syntax, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileDescriptorProto.syntax)
-}
// -------------------------------------------------------------------
@@ -7987,25 +7633,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.name)
}
-inline std::string* DescriptorProto::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void DescriptorProto::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.DescriptorProto.name)
-}
// repeated .google.protobuf.FieldDescriptorProto field = 2;
inline int DescriptorProto::_internal_field_size() const {
@@ -8557,25 +8184,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.name)
}
-inline std::string* FieldDescriptorProto::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FieldDescriptorProto::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.name)
-}
// optional int32 number = 3;
inline bool FieldDescriptorProto::_internal_has_number() const {
@@ -8736,25 +8344,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.type_name)
}
-inline std::string* FieldDescriptorProto::unsafe_arena_release_type_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.type_name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000004u;
- return type_name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FieldDescriptorProto::unsafe_arena_set_allocated_type_name(
- std::string* type_name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (type_name != nullptr) {
- _has_bits_[0] |= 0x00000004u;
- } else {
- _has_bits_[0] &= ~0x00000004u;
- }
- type_name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- type_name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.type_name)
-}
// optional string extendee = 2;
inline bool FieldDescriptorProto::_internal_has_extendee() const {
@@ -8829,25 +8418,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.extendee)
}
-inline std::string* FieldDescriptorProto::unsafe_arena_release_extendee() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.extendee)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000002u;
- return extendee_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FieldDescriptorProto::unsafe_arena_set_allocated_extendee(
- std::string* extendee) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (extendee != nullptr) {
- _has_bits_[0] |= 0x00000002u;
- } else {
- _has_bits_[0] &= ~0x00000002u;
- }
- extendee_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- extendee, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.extendee)
-}
// optional string default_value = 7;
inline bool FieldDescriptorProto::_internal_has_default_value() const {
@@ -8922,25 +8492,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.default_value)
}
-inline std::string* FieldDescriptorProto::unsafe_arena_release_default_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.default_value)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000008u;
- return default_value_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FieldDescriptorProto::unsafe_arena_set_allocated_default_value(
- std::string* default_value) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (default_value != nullptr) {
- _has_bits_[0] |= 0x00000008u;
- } else {
- _has_bits_[0] &= ~0x00000008u;
- }
- default_value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- default_value, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.default_value)
-}
// optional int32 oneof_index = 9;
inline bool FieldDescriptorProto::_internal_has_oneof_index() const {
@@ -9043,25 +8594,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name)
}
-inline std::string* FieldDescriptorProto::unsafe_arena_release_json_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.json_name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000010u;
- return json_name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FieldDescriptorProto::unsafe_arena_set_allocated_json_name(
- std::string* json_name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (json_name != nullptr) {
- _has_bits_[0] |= 0x00000010u;
- } else {
- _has_bits_[0] &= ~0x00000010u;
- }
- json_name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- json_name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FieldDescriptorProto.json_name)
-}
// optional .google.protobuf.FieldOptions options = 8;
inline bool FieldDescriptorProto::_internal_has_options() const {
@@ -9251,25 +8783,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name)
}
-inline std::string* OneofDescriptorProto::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.OneofDescriptorProto.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void OneofDescriptorProto::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.OneofDescriptorProto.name)
-}
// optional .google.protobuf.OneofOptions options = 2;
inline bool OneofDescriptorProto::_internal_has_options() const {
@@ -9491,25 +9004,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.name)
}
-inline std::string* EnumDescriptorProto::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumDescriptorProto.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void EnumDescriptorProto::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumDescriptorProto.name)
-}
// repeated .google.protobuf.EnumValueDescriptorProto value = 2;
inline int EnumDescriptorProto::_internal_value_size() const {
@@ -9823,25 +9317,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.name)
}
-inline std::string* EnumValueDescriptorProto::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValueDescriptorProto.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void EnumValueDescriptorProto::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValueDescriptorProto.name)
-}
// optional int32 number = 2;
inline bool EnumValueDescriptorProto::_internal_has_number() const {
@@ -10031,25 +9506,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.name)
}
-inline std::string* ServiceDescriptorProto::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.ServiceDescriptorProto.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void ServiceDescriptorProto::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.ServiceDescriptorProto.name)
-}
// repeated .google.protobuf.MethodDescriptorProto method = 2;
inline int ServiceDescriptorProto::_internal_method_size() const {
@@ -10250,25 +9706,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.name)
}
-inline std::string* MethodDescriptorProto::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void MethodDescriptorProto::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.name)
-}
// optional string input_type = 2;
inline bool MethodDescriptorProto::_internal_has_input_type() const {
@@ -10343,25 +9780,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.input_type)
}
-inline std::string* MethodDescriptorProto::unsafe_arena_release_input_type() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.input_type)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000002u;
- return input_type_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void MethodDescriptorProto::unsafe_arena_set_allocated_input_type(
- std::string* input_type) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (input_type != nullptr) {
- _has_bits_[0] |= 0x00000002u;
- } else {
- _has_bits_[0] &= ~0x00000002u;
- }
- input_type_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- input_type, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.input_type)
-}
// optional string output_type = 3;
inline bool MethodDescriptorProto::_internal_has_output_type() const {
@@ -10436,25 +9854,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.output_type)
}
-inline std::string* MethodDescriptorProto::unsafe_arena_release_output_type() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.output_type)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000004u;
- return output_type_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void MethodDescriptorProto::unsafe_arena_set_allocated_output_type(
- std::string* output_type) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (output_type != nullptr) {
- _has_bits_[0] |= 0x00000004u;
- } else {
- _has_bits_[0] &= ~0x00000004u;
- }
- output_type_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- output_type, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.MethodDescriptorProto.output_type)
-}
// optional .google.protobuf.MethodOptions options = 4;
inline bool MethodDescriptorProto::_internal_has_options() const {
@@ -10672,25 +10071,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_package)
}
-inline std::string* FileOptions::unsafe_arena_release_java_package() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.java_package)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return java_package_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_java_package(
- std::string* java_package) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (java_package != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- java_package_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- java_package, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.java_package)
-}
// optional string java_outer_classname = 8;
inline bool FileOptions::_internal_has_java_outer_classname() const {
@@ -10765,25 +10145,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_outer_classname)
}
-inline std::string* FileOptions::unsafe_arena_release_java_outer_classname() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.java_outer_classname)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000002u;
- return java_outer_classname_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_java_outer_classname(
- std::string* java_outer_classname) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (java_outer_classname != nullptr) {
- _has_bits_[0] |= 0x00000002u;
- } else {
- _has_bits_[0] &= ~0x00000002u;
- }
- java_outer_classname_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- java_outer_classname, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.java_outer_classname)
-}
// optional bool java_multiple_files = 10 [default = false];
inline bool FileOptions::_internal_has_java_multiple_files() const {
@@ -10971,25 +10332,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.go_package)
}
-inline std::string* FileOptions::unsafe_arena_release_go_package() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.go_package)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000004u;
- return go_package_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_go_package(
- std::string* go_package) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (go_package != nullptr) {
- _has_bits_[0] |= 0x00000004u;
- } else {
- _has_bits_[0] &= ~0x00000004u;
- }
- go_package_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- go_package, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.go_package)
-}
// optional bool cc_generic_services = 16 [default = false];
inline bool FileOptions::_internal_has_cc_generic_services() const {
@@ -11232,25 +10574,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.objc_class_prefix)
}
-inline std::string* FileOptions::unsafe_arena_release_objc_class_prefix() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.objc_class_prefix)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000008u;
- return objc_class_prefix_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_objc_class_prefix(
- std::string* objc_class_prefix) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (objc_class_prefix != nullptr) {
- _has_bits_[0] |= 0x00000008u;
- } else {
- _has_bits_[0] &= ~0x00000008u;
- }
- objc_class_prefix_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- objc_class_prefix, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.objc_class_prefix)
-}
// optional string csharp_namespace = 37;
inline bool FileOptions::_internal_has_csharp_namespace() const {
@@ -11325,25 +10648,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.csharp_namespace)
}
-inline std::string* FileOptions::unsafe_arena_release_csharp_namespace() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.csharp_namespace)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000010u;
- return csharp_namespace_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_csharp_namespace(
- std::string* csharp_namespace) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (csharp_namespace != nullptr) {
- _has_bits_[0] |= 0x00000010u;
- } else {
- _has_bits_[0] &= ~0x00000010u;
- }
- csharp_namespace_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- csharp_namespace, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.csharp_namespace)
-}
// optional string swift_prefix = 39;
inline bool FileOptions::_internal_has_swift_prefix() const {
@@ -11418,25 +10722,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.swift_prefix)
}
-inline std::string* FileOptions::unsafe_arena_release_swift_prefix() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.swift_prefix)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000020u;
- return swift_prefix_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_swift_prefix(
- std::string* swift_prefix) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (swift_prefix != nullptr) {
- _has_bits_[0] |= 0x00000020u;
- } else {
- _has_bits_[0] &= ~0x00000020u;
- }
- swift_prefix_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- swift_prefix, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.swift_prefix)
-}
// optional string php_class_prefix = 40;
inline bool FileOptions::_internal_has_php_class_prefix() const {
@@ -11511,25 +10796,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_class_prefix)
}
-inline std::string* FileOptions::unsafe_arena_release_php_class_prefix() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_class_prefix)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000040u;
- return php_class_prefix_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_php_class_prefix(
- std::string* php_class_prefix) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (php_class_prefix != nullptr) {
- _has_bits_[0] |= 0x00000040u;
- } else {
- _has_bits_[0] &= ~0x00000040u;
- }
- php_class_prefix_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- php_class_prefix, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_class_prefix)
-}
// optional string php_namespace = 41;
inline bool FileOptions::_internal_has_php_namespace() const {
@@ -11604,25 +10870,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_namespace)
}
-inline std::string* FileOptions::unsafe_arena_release_php_namespace() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_namespace)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000080u;
- return php_namespace_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_php_namespace(
- std::string* php_namespace) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (php_namespace != nullptr) {
- _has_bits_[0] |= 0x00000080u;
- } else {
- _has_bits_[0] &= ~0x00000080u;
- }
- php_namespace_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- php_namespace, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_namespace)
-}
// optional string php_metadata_namespace = 44;
inline bool FileOptions::_internal_has_php_metadata_namespace() const {
@@ -11697,25 +10944,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.php_metadata_namespace)
}
-inline std::string* FileOptions::unsafe_arena_release_php_metadata_namespace() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_metadata_namespace)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000100u;
- return php_metadata_namespace_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_php_metadata_namespace(
- std::string* php_metadata_namespace) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (php_metadata_namespace != nullptr) {
- _has_bits_[0] |= 0x00000100u;
- } else {
- _has_bits_[0] &= ~0x00000100u;
- }
- php_metadata_namespace_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- php_metadata_namespace, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.php_metadata_namespace)
-}
// optional string ruby_package = 45;
inline bool FileOptions::_internal_has_ruby_package() const {
@@ -11790,25 +11018,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.ruby_package)
}
-inline std::string* FileOptions::unsafe_arena_release_ruby_package() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.ruby_package)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000200u;
- return ruby_package_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void FileOptions::unsafe_arena_set_allocated_ruby_package(
- std::string* ruby_package) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (ruby_package != nullptr) {
- _has_bits_[0] |= 0x00000200u;
- } else {
- _has_bits_[0] &= ~0x00000200u;
- }
- ruby_package_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- ruby_package, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.FileOptions.ruby_package)
-}
// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
inline int FileOptions::_internal_uninterpreted_option_size() const {
@@ -12678,25 +11887,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part)
}
-inline std::string* UninterpretedOption_NamePart::unsafe_arena_release_name_part() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.NamePart.name_part)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return name_part_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void UninterpretedOption_NamePart::unsafe_arena_set_allocated_name_part(
- std::string* name_part) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name_part != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- name_part_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name_part, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part)
-}
// required bool is_extension = 2;
inline bool UninterpretedOption_NamePart::_internal_has_is_extension() const {
@@ -12842,25 +12032,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.identifier_value)
}
-inline std::string* UninterpretedOption::unsafe_arena_release_identifier_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.identifier_value)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return identifier_value_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void UninterpretedOption::unsafe_arena_set_allocated_identifier_value(
- std::string* identifier_value) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (identifier_value != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- identifier_value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- identifier_value, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.identifier_value)
-}
// optional uint64 positive_int_value = 4;
inline bool UninterpretedOption::_internal_has_positive_int_value() const {
@@ -13019,25 +12190,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.string_value)
}
-inline std::string* UninterpretedOption::unsafe_arena_release_string_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.string_value)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000002u;
- return string_value_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void UninterpretedOption::unsafe_arena_set_allocated_string_value(
- std::string* string_value) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (string_value != nullptr) {
- _has_bits_[0] |= 0x00000002u;
- } else {
- _has_bits_[0] &= ~0x00000002u;
- }
- string_value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- string_value, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.string_value)
-}
// optional string aggregate_value = 8;
inline bool UninterpretedOption::_internal_has_aggregate_value() const {
@@ -13112,25 +12264,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.aggregate_value)
}
-inline std::string* UninterpretedOption::unsafe_arena_release_aggregate_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.aggregate_value)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000004u;
- return aggregate_value_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void UninterpretedOption::unsafe_arena_set_allocated_aggregate_value(
- std::string* aggregate_value) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (aggregate_value != nullptr) {
- _has_bits_[0] |= 0x00000004u;
- } else {
- _has_bits_[0] &= ~0x00000004u;
- }
- aggregate_value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- aggregate_value, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.UninterpretedOption.aggregate_value)
-}
// -------------------------------------------------------------------
@@ -13303,25 +12436,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments)
}
-inline std::string* SourceCodeInfo_Location::unsafe_arena_release_leading_comments() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.SourceCodeInfo.Location.leading_comments)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return leading_comments_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void SourceCodeInfo_Location::unsafe_arena_set_allocated_leading_comments(
- std::string* leading_comments) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (leading_comments != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- leading_comments_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- leading_comments, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments)
-}
// optional string trailing_comments = 4;
inline bool SourceCodeInfo_Location::_internal_has_trailing_comments() const {
@@ -13396,25 +12510,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments)
}
-inline std::string* SourceCodeInfo_Location::unsafe_arena_release_trailing_comments() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.SourceCodeInfo.Location.trailing_comments)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000002u;
- return trailing_comments_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void SourceCodeInfo_Location::unsafe_arena_set_allocated_trailing_comments(
- std::string* trailing_comments) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (trailing_comments != nullptr) {
- _has_bits_[0] |= 0x00000002u;
- } else {
- _has_bits_[0] &= ~0x00000002u;
- }
- trailing_comments_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- trailing_comments, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments)
-}
// repeated string leading_detached_comments = 6;
inline int SourceCodeInfo_Location::_internal_leading_detached_comments_size() const {
@@ -13657,25 +12752,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file)
}
-inline std::string* GeneratedCodeInfo_Annotation::unsafe_arena_release_source_file() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file)
- GOOGLE_DCHECK(GetArena() != nullptr);
- _has_bits_[0] &= ~0x00000001u;
- return source_file_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void GeneratedCodeInfo_Annotation::unsafe_arena_set_allocated_source_file(
- std::string* source_file) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (source_file != nullptr) {
- _has_bits_[0] |= 0x00000001u;
- } else {
- _has_bits_[0] &= ~0x00000001u;
- }
- source_file_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- source_file, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file)
-}
// optional int32 begin = 3;
inline bool GeneratedCodeInfo_Annotation::_internal_has_begin() const {
diff --git a/src/google/protobuf/descriptor_database.cc b/src/google/protobuf/descriptor_database.cc
index dbe1dc1..a332dab 100644
--- a/src/google/protobuf/descriptor_database.cc
+++ b/src/google/protobuf/descriptor_database.cc
@@ -390,8 +390,6 @@
// -------------------------------------------------------------------
class EncodedDescriptorDatabase::DescriptorIndex {
- using String = std::string;
-
public:
using Value = std::pair<const void*, int>;
// Helpers to recursively add particular descriptors and all their contents
@@ -410,15 +408,13 @@
private:
friend class EncodedDescriptorDatabase;
- bool AddSymbol(StringPiece package, StringPiece symbol,
- Value value);
+ bool AddSymbol(StringPiece symbol);
template <typename DescProto>
bool AddNestedExtensions(StringPiece filename,
- const DescProto& message_type, Value value);
+ const DescProto& message_type);
template <typename FieldProto>
- bool AddExtension(StringPiece filename, const FieldProto& field,
- Value value);
+ bool AddExtension(StringPiece filename, const FieldProto& field);
// All the maps below have two representations:
// - a std::set<> where we insert initially.
@@ -429,47 +425,80 @@
void EnsureFlat();
+ using String = std::string;
+
+ String EncodeString(StringPiece str) const { return String(str); }
+ StringPiece DecodeString(const String& str, int) const { return str; }
+
+ struct EncodedEntry {
+ // Do not use `Value` here to avoid the padding of that object.
+ const void* data;
+ int size;
+ // Keep the package here instead of each SymbolEntry to save space.
+ String encoded_package;
+
+ Value value() const { return {data, size}; }
+ };
+ std::vector<EncodedEntry> all_values_;
+
struct FileEntry {
- String name;
- Value data;
+ int data_offset;
+ String encoded_name;
+
+ StringPiece name(const DescriptorIndex& index) const {
+ return index.DecodeString(encoded_name, data_offset);
+ }
};
struct FileCompare {
+ const DescriptorIndex& index;
+
bool operator()(const FileEntry& a, const FileEntry& b) const {
- return a.name < b.name;
+ return a.name(index) < b.name(index);
}
bool operator()(const FileEntry& a, StringPiece b) const {
- return a.name < b;
+ return a.name(index) < b;
}
bool operator()(StringPiece a, const FileEntry& b) const {
- return a < b.name;
+ return a < b.name(index);
}
};
- std::set<FileEntry, FileCompare> by_name_;
+ std::set<FileEntry, FileCompare> by_name_{FileCompare{*this}};
std::vector<FileEntry> by_name_flat_;
struct SymbolEntry {
- String package;
- String symbol;
- Value data;
+ int data_offset;
+ String encoded_symbol;
- std::string AsString() const {
- return StrCat(package, package.empty() ? "" : ".", symbol);
+ StringPiece package(const DescriptorIndex& index) const {
+ return index.DecodeString(index.all_values_[data_offset].encoded_package,
+ data_offset);
+ }
+ StringPiece symbol(const DescriptorIndex& index) const {
+ return index.DecodeString(encoded_symbol, data_offset);
+ }
+
+ std::string AsString(const DescriptorIndex& index) const {
+ auto p = package(index);
+ return StrCat(p, p.empty() ? "" : ".", symbol(index));
}
};
struct SymbolCompare {
- static std::string AsString(const SymbolEntry& entry) {
- return entry.AsString();
+ const DescriptorIndex& index;
+
+ std::string AsString(const SymbolEntry& entry) const {
+ return entry.AsString(index);
}
static StringPiece AsString(StringPiece str) { return str; }
- static std::pair<StringPiece, StringPiece> GetParts(
- const SymbolEntry& entry) {
- if (entry.package.empty()) return {entry.symbol, StringPiece{}};
- return {entry.package, entry.symbol};
+ std::pair<StringPiece, StringPiece> GetParts(
+ const SymbolEntry& entry) const {
+ auto package = entry.package(index);
+ if (package.empty()) return {entry.symbol(index), StringPiece{}};
+ return {package, entry.symbol(index)};
}
- static std::pair<StringPiece, StringPiece> GetParts(
- StringPiece str) {
+ std::pair<StringPiece, StringPiece> GetParts(
+ StringPiece str) const {
return {str, {}};
}
@@ -490,29 +519,35 @@
return AsString(lhs) < AsString(rhs);
}
};
- std::set<SymbolEntry, SymbolCompare> by_symbol_;
+ std::set<SymbolEntry, SymbolCompare> by_symbol_{SymbolCompare{*this}};
std::vector<SymbolEntry> by_symbol_flat_;
struct ExtensionEntry {
- String extendee;
+ int data_offset;
+ String encoded_extendee;
+ StringPiece extendee(const DescriptorIndex& index) const {
+ return index.DecodeString(encoded_extendee, data_offset).substr(1);
+ }
int extension_number;
- Value data;
};
struct ExtensionCompare {
+ const DescriptorIndex& index;
+
bool operator()(const ExtensionEntry& a, const ExtensionEntry& b) const {
- return std::tie(a.extendee, a.extension_number) <
- std::tie(b.extendee, b.extension_number);
+ return std::make_tuple(a.extendee(index), a.extension_number) <
+ std::make_tuple(b.extendee(index), b.extension_number);
}
bool operator()(const ExtensionEntry& a,
std::tuple<StringPiece, int> b) const {
- return std::tie(a.extendee, a.extension_number) < b;
+ return std::make_tuple(a.extendee(index), a.extension_number) < b;
}
bool operator()(std::tuple<StringPiece, int> a,
const ExtensionEntry& b) const {
- return a < std::tie(b.extendee, b.extension_number);
+ return a < std::make_tuple(b.extendee(index), b.extension_number);
}
};
- std::set<ExtensionEntry, ExtensionCompare> by_extension_;
+ std::set<ExtensionEntry, ExtensionCompare> by_extension_{
+ ExtensionCompare{*this}};
std::vector<ExtensionEntry> by_extension_flat_;
};
@@ -591,40 +626,51 @@
template <typename FileProto>
bool EncodedDescriptorDatabase::DescriptorIndex::AddFile(const FileProto& file,
Value value) {
- if (!InsertIfNotPresent(&by_name_, FileEntry{file.name(), value}) ||
+ // We push `value` into the array first. This is important because the AddXXX
+ // functions below will expect it to be there.
+ all_values_.push_back({value.first, value.second});
+
+ if (!ValidateSymbolName(file.package())) {
+ GOOGLE_LOG(ERROR) << "Invalid package name: " << file.package();
+ return false;
+ }
+ all_values_.back().encoded_package = EncodeString(file.package());
+
+ if (!InsertIfNotPresent(
+ &by_name_, FileEntry{static_cast<int>(all_values_.size() - 1),
+ EncodeString(file.name())}) ||
std::binary_search(by_name_flat_.begin(), by_name_flat_.end(),
file.name(), by_name_.key_comp())) {
GOOGLE_LOG(ERROR) << "File already exists in database: " << file.name();
return false;
}
- StringPiece package = file.package();
for (const auto& message_type : file.message_type()) {
- if (!AddSymbol(package, message_type.name(), value)) return false;
- if (!AddNestedExtensions(file.name(), message_type, value)) return false;
+ if (!AddSymbol(message_type.name())) return false;
+ if (!AddNestedExtensions(file.name(), message_type)) return false;
}
for (const auto& enum_type : file.enum_type()) {
- if (!AddSymbol(package, enum_type.name(), value)) return false;
+ if (!AddSymbol(enum_type.name())) return false;
}
for (const auto& extension : file.extension()) {
- if (!AddSymbol(package, extension.name(), value)) return false;
- if (!AddExtension(file.name(), extension, value)) return false;
+ if (!AddSymbol(extension.name())) return false;
+ if (!AddExtension(file.name(), extension)) return false;
}
for (const auto& service : file.service()) {
- if (!AddSymbol(package, service.name(), value)) return false;
+ if (!AddSymbol(service.name())) return false;
}
return true;
}
-template <typename Iter, typename Iter2>
+template <typename Iter, typename Iter2, typename Index>
static bool CheckForMutualSubsymbols(StringPiece symbol_name, Iter* iter,
- Iter2 end) {
+ Iter2 end, const Index& index) {
if (*iter != end) {
- if (IsSubSymbol((*iter)->AsString(), symbol_name)) {
+ if (IsSubSymbol((*iter)->AsString(index), symbol_name)) {
GOOGLE_LOG(ERROR) << "Symbol name \"" << symbol_name
<< "\" conflicts with the existing symbol \""
- << (*iter)->AsString() << "\".";
+ << (*iter)->AsString(index) << "\".";
return false;
}
@@ -635,10 +681,10 @@
// to increment it.
++*iter;
- if (*iter != end && IsSubSymbol(symbol_name, (*iter)->AsString())) {
+ if (*iter != end && IsSubSymbol(symbol_name, (*iter)->AsString(index))) {
GOOGLE_LOG(ERROR) << "Symbol name \"" << symbol_name
<< "\" conflicts with the existing symbol \""
- << (*iter)->AsString() << "\".";
+ << (*iter)->AsString(index) << "\".";
return false;
}
}
@@ -646,22 +692,24 @@
}
bool EncodedDescriptorDatabase::DescriptorIndex::AddSymbol(
- StringPiece package, StringPiece symbol, Value value) {
- SymbolEntry entry = {String(package), String(symbol), value};
- std::string entry_as_string = entry.AsString();
+ StringPiece symbol) {
+ SymbolEntry entry = {static_cast<int>(all_values_.size() - 1),
+ EncodeString(symbol)};
+ std::string entry_as_string = entry.AsString(*this);
// We need to make sure not to violate our map invariant.
// If the symbol name is invalid it could break our lookup algorithm (which
// relies on the fact that '.' sorts before all other characters that are
// valid in symbol names).
- if (!ValidateSymbolName(package) || !ValidateSymbolName(symbol)) {
+ if (!ValidateSymbolName(symbol)) {
GOOGLE_LOG(ERROR) << "Invalid symbol name: " << entry_as_string;
return false;
}
auto iter = FindLastLessOrEqual(&by_symbol_, entry);
- if (!CheckForMutualSubsymbols(entry_as_string, &iter, by_symbol_.end())) {
+ if (!CheckForMutualSubsymbols(entry_as_string, &iter, by_symbol_.end(),
+ *this)) {
return false;
}
@@ -669,7 +717,7 @@
auto flat_iter =
FindLastLessOrEqual(&by_symbol_flat_, entry, by_symbol_.key_comp());
if (!CheckForMutualSubsymbols(entry_as_string, &flat_iter,
- by_symbol_flat_.end())) {
+ by_symbol_flat_.end(), *this)) {
return false;
}
@@ -684,25 +732,26 @@
template <typename DescProto>
bool EncodedDescriptorDatabase::DescriptorIndex::AddNestedExtensions(
- StringPiece filename, const DescProto& message_type, Value value) {
+ StringPiece filename, const DescProto& message_type) {
for (const auto& nested_type : message_type.nested_type()) {
- if (!AddNestedExtensions(filename, nested_type, value)) return false;
+ if (!AddNestedExtensions(filename, nested_type)) return false;
}
for (const auto& extension : message_type.extension()) {
- if (!AddExtension(filename, extension, value)) return false;
+ if (!AddExtension(filename, extension)) return false;
}
return true;
}
template <typename FieldProto>
bool EncodedDescriptorDatabase::DescriptorIndex::AddExtension(
- StringPiece filename, const FieldProto& field, Value value) {
+ StringPiece filename, const FieldProto& field) {
if (!field.extendee().empty() && field.extendee()[0] == '.') {
// The extension is fully-qualified. We can use it as a lookup key in
// the by_symbol_ table.
- if (!InsertIfNotPresent(&by_extension_,
- ExtensionEntry{field.extendee().substr(1),
- field.number(), value}) ||
+ if (!InsertIfNotPresent(
+ &by_extension_,
+ ExtensionEntry{static_cast<int>(all_values_.size() - 1),
+ EncodeString(field.extendee()), field.number()}) ||
std::binary_search(
by_extension_flat_.begin(), by_extension_flat_.end(),
std::make_pair(field.extendee().substr(1), field.number()),
@@ -733,8 +782,9 @@
auto iter =
FindLastLessOrEqual(&by_symbol_flat_, name, by_symbol_.key_comp());
- return iter != by_symbol_flat_.end() && IsSubSymbol(iter->AsString(), name)
- ? iter->data
+ return iter != by_symbol_flat_.end() &&
+ IsSubSymbol(iter->AsString(*this), name)
+ ? all_values_[iter->data_offset].value()
: Value();
}
@@ -746,10 +796,11 @@
auto it = std::lower_bound(
by_extension_flat_.begin(), by_extension_flat_.end(),
std::make_tuple(containing_type, field_number), by_extension_.key_comp());
- return it == by_extension_flat_.end() || it->extendee != containing_type ||
+ return it == by_extension_flat_.end() ||
+ it->extendee(*this) != containing_type ||
it->extension_number != field_number
? std::make_pair(nullptr, 0)
- : it->data;
+ : all_values_[it->data_offset].value();
}
template <typename T, typename Less>
@@ -763,6 +814,7 @@
}
void EncodedDescriptorDatabase::DescriptorIndex::EnsureFlat() {
+ all_values_.shrink_to_fit();
// Merge each of the sets into their flat counterpart.
MergeIntoFlat(&by_name_, &by_name_flat_);
MergeIntoFlat(&by_symbol_, &by_symbol_flat_);
@@ -777,7 +829,8 @@
auto it = std::lower_bound(
by_extension_flat_.begin(), by_extension_flat_.end(),
std::make_tuple(containing_type, 0), by_extension_.key_comp());
- for (; it != by_extension_flat_.end() && it->extendee == containing_type;
+ for (;
+ it != by_extension_flat_.end() && it->extendee(*this) == containing_type;
++it) {
output->push_back(it->extension_number);
success = true;
@@ -791,11 +844,11 @@
output->resize(by_name_.size() + by_name_flat_.size());
int i = 0;
for (const auto& entry : by_name_) {
- (*output)[i] = std::string(entry.name);
+ (*output)[i] = std::string(entry.name(*this));
i++;
}
for (const auto& entry : by_name_flat_) {
- (*output)[i] = std::string(entry.name);
+ (*output)[i] = std::string(entry.name(*this));
i++;
}
}
@@ -807,9 +860,9 @@
auto it = std::lower_bound(by_name_flat_.begin(), by_name_flat_.end(),
filename, by_name_.key_comp());
- return it == by_name_flat_.end() || it->name != filename
+ return it == by_name_flat_.end() || it->name(*this) != filename
? std::make_pair(nullptr, 0)
- : it->data;
+ : all_values_[it->data_offset].value();
}
diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h
index fcc2103..675cb93 100644
--- a/src/google/protobuf/duration.pb.h
+++ b/src/google/protobuf/duration.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -45,7 +45,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fduration_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h
index 8172d7a..232c194 100644
--- a/src/google/protobuf/empty.pb.h
+++ b/src/google/protobuf/empty.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -45,7 +45,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fempty_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h
index f5f1ff2..b32ae3f 100644
--- a/src/google/protobuf/field_mask.pb.h
+++ b/src/google/protobuf/field_mask.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -45,7 +45,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ffield_5fmask_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
diff --git a/src/google/protobuf/generated_enum_reflection.h b/src/google/protobuf/generated_enum_reflection.h
index 989b5a8..5debc0a 100644
--- a/src/google/protobuf/generated_enum_reflection.h
+++ b/src/google/protobuf/generated_enum_reflection.h
@@ -72,10 +72,10 @@
// an enum name of the given type, returning true and filling in value on
// success, or returning false and leaving value unchanged on failure.
PROTOBUF_EXPORT bool ParseNamedEnum(const EnumDescriptor* descriptor,
- StringPiece name, int* value);
+ ConstStringParam name, int* value);
template <typename EnumType>
-bool ParseNamedEnum(const EnumDescriptor* descriptor, StringPiece name,
+bool ParseNamedEnum(const EnumDescriptor* descriptor, ConstStringParam name,
EnumType* value) {
int tmp;
if (!ParseNamedEnum(descriptor, name, &tmp)) return false;
diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc
index be1e740..5483eda 100644
--- a/src/google/protobuf/generated_message_reflection.cc
+++ b/src/google/protobuf/generated_message_reflection.cc
@@ -82,7 +82,7 @@
namespace internal {
-bool ParseNamedEnum(const EnumDescriptor* descriptor, StringPiece name,
+bool ParseNamedEnum(const EnumDescriptor* descriptor, ConstStringParam name,
int* value) {
const EnumValueDescriptor* d = descriptor->FindValueByName(name);
if (d == nullptr) return false;
diff --git a/src/google/protobuf/generated_message_table_driven.h b/src/google/protobuf/generated_message_table_driven.h
index 1394ab1..41ec74d 100644
--- a/src/google/protobuf/generated_message_table_driven.h
+++ b/src/google/protobuf/generated_message_table_driven.h
@@ -120,7 +120,7 @@
// ParseTableField is kept small to help simplify instructions for computing
// offsets, as we will always need this information to parse a field.
// Additional data, needed for some types, is stored in
-// AuxillaryParseTableField.
+// AuxiliaryParseTableField.
struct ParseTableField {
uint32 offset;
// The presence_index ordinarily represents a has_bit index, but for fields
@@ -138,7 +138,7 @@
struct ParseTable;
-union AuxillaryParseTableField {
+union AuxiliaryParseTableField {
typedef bool (*EnumValidator)(int);
// Enums
@@ -169,20 +169,20 @@
};
map_aux maps;
- AuxillaryParseTableField() = default;
- constexpr AuxillaryParseTableField(AuxillaryParseTableField::enum_aux e)
+ AuxiliaryParseTableField() = default;
+ constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::enum_aux e)
: enums(e) {}
- constexpr AuxillaryParseTableField(AuxillaryParseTableField::message_aux m)
+ constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::message_aux m)
: messages(m) {}
- constexpr AuxillaryParseTableField(AuxillaryParseTableField::string_aux s)
+ constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::string_aux s)
: strings(s) {}
- constexpr AuxillaryParseTableField(AuxillaryParseTableField::map_aux m)
+ constexpr AuxiliaryParseTableField(AuxiliaryParseTableField::map_aux m)
: maps(m) {}
};
struct ParseTable {
const ParseTableField* fields;
- const AuxillaryParseTableField* aux;
+ const AuxiliaryParseTableField* aux;
int max_field_number;
// TODO(ckennelly): Do something with this padding.
@@ -207,10 +207,10 @@
// The tables must be composed of POD components to ensure link-time
// initialization.
static_assert(std::is_pod<ParseTableField>::value, "");
-static_assert(std::is_pod<AuxillaryParseTableField>::value, "");
-static_assert(std::is_pod<AuxillaryParseTableField::enum_aux>::value, "");
-static_assert(std::is_pod<AuxillaryParseTableField::message_aux>::value, "");
-static_assert(std::is_pod<AuxillaryParseTableField::string_aux>::value, "");
+static_assert(std::is_pod<AuxiliaryParseTableField>::value, "");
+static_assert(std::is_pod<AuxiliaryParseTableField::enum_aux>::value, "");
+static_assert(std::is_pod<AuxiliaryParseTableField::message_aux>::value, "");
+static_assert(std::is_pod<AuxiliaryParseTableField::string_aux>::value, "");
static_assert(std::is_pod<ParseTable>::value, "");
// TODO(ckennelly): Consolidate these implementations into a single one, using
diff --git a/src/google/protobuf/generated_message_table_driven_lite.h b/src/google/protobuf/generated_message_table_driven_lite.h
index fda7c15..7405c3d 100644
--- a/src/google/protobuf/generated_message_table_driven_lite.h
+++ b/src/google/protobuf/generated_message_table_driven_lite.h
@@ -309,7 +309,7 @@
return false;
}
- AuxillaryParseTableField::EnumValidator validator =
+ AuxiliaryParseTableField::EnumValidator validator =
table.aux[field_number].enums.validator;
if (validator == nullptr || validator(value)) {
switch (cardinality) {
@@ -794,7 +794,7 @@
return false;
}
- AuxillaryParseTableField::EnumValidator validator =
+ AuxiliaryParseTableField::EnumValidator validator =
table.aux[field_number].enums.validator;
RepeatedField<int>* values = Raw<RepeatedField<int>>(msg, offset);
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h
index 786fcf9..a1722db 100644
--- a/src/google/protobuf/map.h
+++ b/src/google/protobuf/map.h
@@ -343,8 +343,8 @@
}
~Map() {
- clear();
if (arena_ == nullptr) {
+ clear();
delete elements_;
}
}
@@ -1218,7 +1218,7 @@
first = erase(first);
}
}
- void clear() { erase(begin(), end()); }
+ void clear() { elements_->clear(); }
// Assign
Map& operator=(const Map& other) {
diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc
index d35dfff..cfea396 100644
--- a/src/google/protobuf/message.cc
+++ b/src/google/protobuf/message.cc
@@ -171,7 +171,7 @@
#define HASH_MAP std::unordered_map
-#define HASH_FXN hash
+#define STR_HASH_FXN hash<const char*>
class GeneratedMessageFactory : public MessageFactory {
@@ -186,8 +186,8 @@
private:
// Only written at static init time, so does not require locking.
- HASH_MAP<const char*, const google::protobuf::internal::DescriptorTable*,
- HASH_FXN<const char*>, streq>
+ HASH_MAP<const char*, const google::protobuf::internal::DescriptorTable*, STR_HASH_FXN,
+ streq>
file_map_;
internal::WrappedMutex mutex_;
diff --git a/src/google/protobuf/message.h b/src/google/protobuf/message.h
index a1b77a7..24b48de 100644
--- a/src/google/protobuf/message.h
+++ b/src/google/protobuf/message.h
@@ -740,8 +740,7 @@
// long as the message is not destroyed.
//
// Note that to use this method users need to include the header file
- // "net/proto2/public/reflection.h" (which defines the RepeatedFieldRef
- // class templates).
+ // "reflection.h" (which defines the RepeatedFieldRef class templates).
template <typename T>
RepeatedFieldRef<T> GetRepeatedFieldRef(const Message& message,
const FieldDescriptor* field) const;
diff --git a/src/google/protobuf/parse_context.h b/src/google/protobuf/parse_context.h
index c83eed9..c5e3fda 100644
--- a/src/google/protobuf/parse_context.h
+++ b/src/google/protobuf/parse_context.h
@@ -744,11 +744,9 @@
void* object, const char* ptr, ParseContext* ctx);
template <typename T>
-PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
-PROTOBUF_MUST_USE_RESULT const
- char* PackedEnumParser(void* object, const char* ptr, ParseContext* ctx,
- bool (*is_valid)(int), InternalMetadata* metadata,
- int field_num) {
+PROTOBUF_MUST_USE_RESULT const char* PackedEnumParser(
+ void* object, const char* ptr, ParseContext* ctx, bool (*is_valid)(int),
+ InternalMetadata* metadata, int field_num) {
return ctx->ReadPackedVarint(
ptr, [object, is_valid, metadata, field_num](uint64 val) {
if (is_valid(val)) {
@@ -760,12 +758,10 @@
}
template <typename T>
-PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
-PROTOBUF_MUST_USE_RESULT const
- char* PackedEnumParserArg(void* object, const char* ptr, ParseContext* ctx,
- bool (*is_valid)(const void*, int),
- const void* data, InternalMetadata* metadata,
- int field_num) {
+PROTOBUF_MUST_USE_RESULT const char* PackedEnumParserArg(
+ void* object, const char* ptr, ParseContext* ctx,
+ bool (*is_valid)(const void*, int), const void* data,
+ InternalMetadata* metadata, int field_num) {
return ctx->ReadPackedVarint(
ptr, [object, is_valid, data, metadata, field_num](uint64 val) {
if (is_valid(data, val)) {
diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
index 89f476f..c92a3d5 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -300,14 +300,14 @@
// Shared google3/opensource definitions. //////////////////////////////////////
-#define PROTOBUF_VERSION 3011004
-#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3011000
-#define PROTOBUF_MIN_PROTOC_VERSION 3011000
+#define PROTOBUF_VERSION 3012002
+#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3012000
+#define PROTOBUF_MIN_PROTOC_VERSION 3012000
#define PROTOBUF_VERSION_SUFFIX ""
// The minimum library version which works with the current version of the
// headers.
-#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3011000
+#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3012000
#if defined(GOOGLE_PROTOBUF_NO_RTTI) && GOOGLE_PROTOBUF_NO_RTTI
#define PROTOBUF_RTTI 0
@@ -358,192 +358,42 @@
#if defined(PROTOBUF_USE_DLLS)
#if defined(_MSC_VER)
#ifdef LIBPROTOBUF_EXPORTS
- #define PROTOBUF_EXPORT __declspec(dllexport)
- #else
- #define PROTOBUF_EXPORT __declspec(dllimport)
- #endif
- #ifdef LIBPROTOC_EXPORTS
- #define PROTOC_EXPORT __declspec(dllexport)
- #else
- #define PROTOC_EXPORT __declspec(dllimport)
- #endif
- #else // defined(_MSC_VER)
- #ifdef LIBPROTOBUF_EXPORTS
- #define PROTOBUF_EXPORT __attribute__((visibility("default")))
- #else
- #define PROTOBUF_EXPORT
- #endif
- #ifdef LIBPROTOC_EXPORTS
- #define PROTOC_EXPORT __attribute__((visibility("default")))
- #else
- #define PROTOC_EXPORT
- #endif
- #endif
+#define PROTOBUF_EXPORT __declspec(dllexport)
+#define PROTOBUF_EXPORT_TEMPLATE_DECLARE
+#define PROTOBUF_EXPORT_TEMPLATE_DEFINE __declspec(dllexport)
+#else
+#define PROTOBUF_EXPORT __declspec(dllimport)
+#define PROTOBUF_EXPORT_TEMPLATE_DECLARE
+#define PROTOBUF_EXPORT_TEMPLATE_DEFINE __declspec(dllimport)
+#endif
+#ifdef LIBPROTOC_EXPORTS
+#define PROTOC_EXPORT __declspec(dllexport)
+#else
+#define PROTOC_EXPORT __declspec(dllimport)
+#endif
+#else // defined(_MSC_VER)
+#ifdef LIBPROTOBUF_EXPORTS
+#define PROTOBUF_EXPORT __attribute__((visibility("default")))
+#define PROTOBUF_EXPORT_TEMPLATE_DECLARE __attribute__((visibility("default")))
+#define PROTOBUF_EXPORT_TEMPLATE_DEFINE
+#else
+#define PROTOBUF_EXPORT
+#define PROTOBUF_EXPORT_TEMPLATE_DECLARE
+#define PROTOBUF_EXPORT_TEMPLATE_DEFINE
+#endif
+#ifdef LIBPROTOC_EXPORTS
+#define PROTOC_EXPORT __attribute__((visibility("default")))
+#else
+#define PROTOC_EXPORT
+#endif
+#endif
#else // defined(PROTOBUF_USE_DLLS)
#define PROTOBUF_EXPORT
#define PROTOC_EXPORT
+#define PROTOBUF_EXPORT_TEMPLATE_DECLARE
+#define PROTOBUF_EXPORT_TEMPLATE_DEFINE
#endif
-
-// This portion provides macros for using FOO_EXPORT macros with explicit
-// template instantiation declarations and definitions.
-// Generally, the FOO_EXPORT macros are used at declarations,
-// and GCC requires them to be used at explicit instantiation declarations,
-// but MSVC requires __declspec(dllexport) to be used at the explicit
-// instantiation definitions instead.
-
-// Usage
-//
-// In a header file, write:
-//
-// extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE(FOO_EXPORT) foo<bar>;
-//
-// In a source file, write:
-//
-// template class PROTOBUF_EXPORT_TEMPLATE_DEFINE(FOO_EXPORT) foo<bar>;
-//
-// Where FOO_EXPORT is either PROTOBUF_EXPORT or PROTOC_EXPORT
-
-// Implementation notes
-//
-// The implementation of these macros uses some subtle macro semantics to
-// detect what the provided FOO_EXPORT value was defined as and then
-// to dispatch to appropriate macro definitions. Unfortunately,
-// MSVC's C preprocessor is rather non-compliant and requires special
-// care to make it work.
-//
-// Issue 1.
-//
-// #define F(x)
-// F()
-//
-// MSVC emits warning C4003 ("not enough actual parameters for macro
-// 'F'), even though it's a valid macro invocation. This affects the
-// macros below that take just an "export" parameter, because export
-// may be empty.
-//
-// As a workaround, we can add a dummy parameter and arguments:
-//
-// #define F(x,_)
-// F(,)
-//
-// Issue 2.
-//
-// #define F(x) G##x
-// #define Gj() ok
-// F(j())
-//
-// The correct replacement for "F(j())" is "ok", but MSVC replaces it
-// with "Gj()". As a workaround, we can pass the result to an
-// identity macro to force MSVC to look for replacements again. (This
-// is why PROTOBUF_EXPORT_TEMPLATE_STYLE_3 exists.)
-
-#define PROTOBUF_EXPORT_TEMPLATE_DECLARE(export) \
- PROTOBUF_EXPORT_TEMPLATE_INVOKE( \
- DECLARE, PROTOBUF_EXPORT_TEMPLATE_STYLE(export, ), export)
-#define PROTOBUF_EXPORT_TEMPLATE_DEFINE(export) \
- PROTOBUF_EXPORT_TEMPLATE_INVOKE( \
- DEFINE, PROTOBUF_EXPORT_TEMPLATE_STYLE(export, ), export)
-
-// INVOKE is an internal helper macro to perform parameter replacements
-// and token pasting to chain invoke another macro. E.g.,
-// PROTOBUF_EXPORT_TEMPLATE_INVOKE(DECLARE, DEFAULT, FOO_EXPORT)
-// will export to call
-// PROTOBUF_EXPORT_TEMPLATE_DECLARE_DEFAULT(FOO_EXPORT, )
-// (but with FOO_EXPORT expanded too).
-#define PROTOBUF_EXPORT_TEMPLATE_INVOKE(which, style, export) \
- PROTOBUF_EXPORT_TEMPLATE_INVOKE_2(which, style, export)
-#define PROTOBUF_EXPORT_TEMPLATE_INVOKE_2(which, style, export) \
- PROTOBUF_EXPORT_TEMPLATE_##which##_##style(export, )
-
-// Default style is to apply the FOO_EXPORT macro at declaration sites.
-#define PROTOBUF_EXPORT_TEMPLATE_DECLARE_DEFAULT(export, _) export
-#define PROTOBUF_EXPORT_TEMPLATE_DEFINE_DEFAULT(export, _)
-
-// The "MSVC hack" style is used when FOO_EXPORT is defined
-// as __declspec(dllexport), which MSVC requires to be used at
-// definition sites instead.
-#define PROTOBUF_EXPORT_TEMPLATE_DECLARE_MSVC_HACK(export, _)
-#define PROTOBUF_EXPORT_TEMPLATE_DEFINE_MSVC_HACK(export, _) export
-
-// PROTOBUF_EXPORT_TEMPLATE_STYLE is an internal helper macro that identifies
-// which export style needs to be used for the provided FOO_EXPORT macro
-// definition. "", "__attribute__(...)", and "__declspec(dllimport)" are
-// mapped to "DEFAULT"; while "__declspec(dllexport)" is mapped to "MSVC_HACK".
-//
-// It's implemented with token pasting to transform the __attribute__ and
-// __declspec annotations into macro invocations. E.g., if FOO_EXPORT is
-// defined as "__declspec(dllimport)", it undergoes the following sequence of
-// macro substitutions:
-// PROTOBUF_EXPORT_TEMPLATE_STYLE(FOO_EXPORT, )
-// PROTOBUF_EXPORT_TEMPLATE_STYLE_2(__declspec(dllimport), )
-// PROTOBUF_EXPORT_TEMPLATE_STYLE_3(
-// PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH__declspec(dllimport))
-// PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH__declspec(dllimport)
-// PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllimport
-// DEFAULT
-#define PROTOBUF_EXPORT_TEMPLATE_STYLE(export, _) \
- PROTOBUF_EXPORT_TEMPLATE_STYLE_2(export, )
-#define PROTOBUF_EXPORT_TEMPLATE_STYLE_2(export, _) \
- PROTOBUF_EXPORT_TEMPLATE_STYLE_3( \
- PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA##export)
-#define PROTOBUF_EXPORT_TEMPLATE_STYLE_3(style) style
-
-// Internal helper macros for PROTOBUF_EXPORT_TEMPLATE_STYLE.
-//
-// XXX: C++ reserves all identifiers containing "__" for the implementation,
-// but "__attribute__" and "__declspec" already contain "__" and the token-paste
-// operator can only add characters; not remove them. To minimize the risk of
-// conflict with implementations, we include "foj3FJo5StF0OvIzl7oMxA" (a random
-// 128-bit string, encoded in Base64) in the macro name.
-#define PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA DEFAULT
-#define PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__attribute__(...) \
- DEFAULT
-#define PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__declspec(arg) \
- PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_##arg
-
-// Internal helper macros for PROTOBUF_EXPORT_TEMPLATE_STYLE.
-#define PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllexport MSVC_HACK
-#define PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllimport DEFAULT
-
-// Sanity checks.
-//
-// PROTOBUF_EXPORT_TEMPLATE_TEST uses the same macro invocation pattern as
-// PROTOBUF_EXPORT_TEMPLATE_DECLARE and PROTOBUF_EXPORT_TEMPLATE_DEFINE do to
-// check that they're working correctly. When they're working correctly, the
-// sequence of macro replacements should go something like:
-//
-// PROTOBUF_EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport));
-//
-// static_assert(PROTOBUF_EXPORT_TEMPLATE_INVOKE(TEST_DEFAULT,
-// PROTOBUF_EXPORT_TEMPLATE_STYLE(__declspec(dllimport), ),
-// __declspec(dllimport)), "__declspec(dllimport)");
-//
-// static_assert(PROTOBUF_EXPORT_TEMPLATE_INVOKE(TEST_DEFAULT,
-// DEFAULT, __declspec(dllimport)), "__declspec(dllimport)");
-//
-// static_assert(PROTOBUF_EXPORT_TEMPLATE_TEST_DEFAULT_DEFAULT(
-// __declspec(dllimport)), "__declspec(dllimport)");
-//
-// static_assert(true, "__declspec(dllimport)");
-//
-// When they're not working correctly, a syntax error should occur instead.
-#define PROTOBUF_EXPORT_TEMPLATE_TEST(want, export) \
- static_assert(PROTOBUF_EXPORT_TEMPLATE_INVOKE( \
- TEST_##want, PROTOBUF_EXPORT_TEMPLATE_STYLE(export, ), \
- export), #export)
-#define PROTOBUF_EXPORT_TEMPLATE_TEST_DEFAULT_DEFAULT(...) true
-#define PROTOBUF_EXPORT_TEMPLATE_TEST_MSVC_HACK_MSVC_HACK(...) true
-
-PROTOBUF_EXPORT_TEMPLATE_TEST(DEFAULT, );
-PROTOBUF_EXPORT_TEMPLATE_TEST(DEFAULT, __attribute__((visibility("default"))));
-PROTOBUF_EXPORT_TEMPLATE_TEST(MSVC_HACK, __declspec(dllexport));
-PROTOBUF_EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport));
-
-#undef PROTOBUF_EXPORT_TEMPLATE_TEST
-#undef PROTOBUF_EXPORT_TEMPLATE_TEST_DEFAULT_DEFAULT
-#undef PROTOBUF_EXPORT_TEMPLATE_TEST_MSVC_HACK_MSVC_HACK
-
// Windows declares several inconvenient macro names. We #undef them and then
// restore them in port_undef.inc.
#ifdef _MSC_VER
@@ -671,4 +521,6 @@
// ownership of arena. However, we cannot do that for nested messages. In order
// to tell how many usages of nested messages affected by message owned arena,
// we need to simulate the arena ownership.
-#define PROTOBUF_MESSAGE_OWNED_ARENA_EXPERIMENT
+// This experiment is purely for the purpose of gathering data. All code guarded
+// by this flag is supposed to be removed after this experiment.
+// #define PROTOBUF_MESSAGE_OWNED_ARENA_EXPERIMENT
diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc
index aa2208d..5fea276 100644
--- a/src/google/protobuf/port_undef.inc
+++ b/src/google/protobuf/port_undef.inc
@@ -69,19 +69,6 @@
#undef PROTOBUF_EXPORT_TEMPLATE_DECLARE
#undef PROTOBUF_EXPORT_TEMPLATE_DEFINE
#undef PROTOBUF_ALIGNAS
-#undef PROTOBUF_EXPORT_TEMPLATE_INVOKE_2
-#undef PROTOBUF_EXPORT_TEMPLATE_DECLARE_DEFAULT
-#undef PROTOBUF_EXPORT_TEMPLATE_DEFINE_DEFAULT
-#undef PROTOBUF_EXPORT_TEMPLATE_DECLARE_MSVC_HACK
-#undef PROTOBUF_EXPORT_TEMPLATE_DEFINE_MSVC_HACK
-#undef PROTOBUF_EXPORT_TEMPLATE_STYLE
-#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_2
-#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_3
-#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA
-#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__attribute__
-#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__declspec
-#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllexport
-#undef PROTOBUF_EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllimport
#undef PROTOBUF_FINAL
#undef PROTOBUF_THREAD_LOCAL
#undef PROTOBUF_MESSAGE_OWNED_ARENA_EXPERIMENT
diff --git a/src/google/protobuf/repeated_field.cc b/src/google/protobuf/repeated_field.cc
index 1b5a0b8..6450679 100644
--- a/src/google/protobuf/repeated_field.cc
+++ b/src/google/protobuf/repeated_field.cc
@@ -123,22 +123,14 @@
} // namespace internal
-template class PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
- RepeatedField<bool>;
-template class PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
- RepeatedField<int32>;
-template class PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
- RepeatedField<uint32>;
-template class PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
- RepeatedField<int64>;
-template class PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
- RepeatedField<uint64>;
-template class PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
- RepeatedField<float>;
-template class PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
- RepeatedField<double>;
-template class PROTOBUF_EXPORT_TEMPLATE_DEFINE(PROTOBUF_EXPORT)
- RepeatedPtrField<std::string>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<bool>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<int32>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<uint32>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<int64>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<uint64>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<float>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedField<double>;
+template class PROTOBUF_EXPORT_TEMPLATE_DEFINE RepeatedPtrField<std::string>;
} // namespace protobuf
} // namespace google
diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h
index 9e27882..fd01a66 100644
--- a/src/google/protobuf/repeated_field.h
+++ b/src/google/protobuf/repeated_field.h
@@ -2816,21 +2816,14 @@
}
// Extern declarations of common instantiations to reduce library bloat.
-extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE(PROTOBUF_EXPORT)
- RepeatedField<bool>;
-extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE(PROTOBUF_EXPORT)
- RepeatedField<int32>;
-extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE(PROTOBUF_EXPORT)
- RepeatedField<uint32>;
-extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE(PROTOBUF_EXPORT)
- RepeatedField<int64>;
-extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE(PROTOBUF_EXPORT)
- RepeatedField<uint64>;
-extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE(PROTOBUF_EXPORT)
- RepeatedField<float>;
-extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE(PROTOBUF_EXPORT)
- RepeatedField<double>;
-extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE(PROTOBUF_EXPORT)
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<bool>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<int32>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<uint32>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<int64>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<uint64>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<float>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE RepeatedField<double>;
+extern template class PROTOBUF_EXPORT_TEMPLATE_DECLARE
RepeatedPtrField<std::string>;
} // namespace protobuf
diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h
index 1cf16f6..c0326de 100644
--- a/src/google/protobuf/source_context.pb.h
+++ b/src/google/protobuf/source_context.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -45,7 +45,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
@@ -191,15 +191,6 @@
std::string* mutable_file_name();
std::string* release_file_name();
void set_allocated_file_name(std::string* file_name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_file_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_file_name(
- std::string* file_name);
private:
const std::string& _internal_file_name() const;
void _internal_set_file_name(const std::string& value);
@@ -289,25 +280,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceContext.file_name)
}
-inline std::string* SourceContext::unsafe_arena_release_file_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.SourceContext.file_name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return file_name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void SourceContext::unsafe_arena_set_allocated_file_name(
- std::string* file_name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (file_name != nullptr) {
-
- } else {
-
- }
- file_name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- file_name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.SourceContext.file_name)
-}
#ifdef __GNUC__
#pragma GCC diagnostic pop
diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h
index 671a0cb..c0fdf90 100644
--- a/src/google/protobuf/struct.pb.h
+++ b/src/google/protobuf/struct.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -49,7 +49,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fstruct_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
@@ -456,15 +456,6 @@
std::string* mutable_string_value();
std::string* release_string_value();
void set_allocated_string_value(std::string* string_value);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_string_value();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_string_value(
- std::string* string_value);
private:
const std::string& _internal_string_value() const;
void _internal_set_string_value(const std::string& value);
@@ -918,29 +909,6 @@
}
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.string_value)
}
-inline std::string* Value::unsafe_arena_release_string_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.string_value)
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (_internal_has_string_value()) {
- clear_has_kind();
- return kind_.string_value_.UnsafeArenaRelease(
- &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
- } else {
- return nullptr;
- }
-}
-inline void Value::unsafe_arena_set_allocated_string_value(std::string* string_value) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (!_internal_has_string_value()) {
- kind_.string_value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
- }
- clear_kind();
- if (string_value) {
- set_has_string_value();
- kind_.string_value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), string_value, GetArena());
- }
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Value.string_value)
-}
// bool bool_value = 4;
inline bool Value::_internal_has_bool_value() const {
diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h
index 1c9084f..ca99dfd 100644
--- a/src/google/protobuf/stubs/common.h
+++ b/src/google/protobuf/stubs/common.h
@@ -43,9 +43,10 @@
#include <string>
#include <vector>
-#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/macros.h>
#include <google/protobuf/stubs/platform_macros.h>
+#include <google/protobuf/stubs/port.h>
+#include <google/protobuf/stubs/stringpiece.h>
#ifndef PROTOBUF_USE_EXCEPTIONS
#if defined(_MSC_VER) && defined(_CPPUNWIND)
@@ -81,7 +82,7 @@
// The current version, represented as a single integer to make comparison
// easier: major * 10^6 + minor * 10^3 + micro
-#define GOOGLE_PROTOBUF_VERSION 3011004
+#define GOOGLE_PROTOBUF_VERSION 3012002
// A suffix string for alpha, beta or rc releases. Empty for stable releases.
#define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
@@ -89,15 +90,15 @@
// The minimum header version which works with the current version of
// the library. This constant should only be used by protoc's C++ code
// generator.
-static const int kMinHeaderVersionForLibrary = 3011000;
+static const int kMinHeaderVersionForLibrary = 3012000;
// The minimum protoc version which works with the current version of the
// headers.
-#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3011000
+#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3012000
// The minimum header version which works with the current version of
// protoc. This constant should only be used in VerifyVersion().
-static const int kMinHeaderVersionForProtoc = 3011000;
+static const int kMinHeaderVersionForProtoc = 3012000;
// Verifies that the headers and libraries are compatible. Use the macro
// below to call this.
@@ -129,12 +130,12 @@
// structurally_valid.cc.
PROTOBUF_EXPORT bool IsStructurallyValidUTF8(const char* buf, int len);
-inline bool IsStructurallyValidUTF8(const std::string& str) {
+inline bool IsStructurallyValidUTF8(StringPiece str) {
return IsStructurallyValidUTF8(str.data(), static_cast<int>(str.length()));
}
// Returns initial number of bytes of structurally valid UTF-8.
-PROTOBUF_EXPORT int UTF8SpnStructurallyValid(const StringPiece& str);
+PROTOBUF_EXPORT int UTF8SpnStructurallyValid(StringPiece str);
// Coerce UTF-8 byte string in src_str to be
// a structurally-valid equal-length string by selectively
@@ -148,8 +149,7 @@
//
// Optimized for: all structurally valid and no byte copying is done.
//
-PROTOBUF_EXPORT char* UTF8CoerceToStructurallyValid(const StringPiece& str,
- char* dst,
+PROTOBUF_EXPORT char* UTF8CoerceToStructurallyValid(StringPiece str, char* dst,
char replace_char);
} // namespace internal
diff --git a/src/google/protobuf/stubs/hash.h b/src/google/protobuf/stubs/hash.h
index a093b40..e2d2392 100644
--- a/src/google/protobuf/stubs/hash.h
+++ b/src/google/protobuf/stubs/hash.h
@@ -33,9 +33,8 @@
#ifndef GOOGLE_PROTOBUF_STUBS_HASH_H__
#define GOOGLE_PROTOBUF_STUBS_HASH_H__
-#include <string.h>
-#include <google/protobuf/stubs/common.h>
-
+#include <cstring>
+#include <string>
#include <unordered_map>
#include <unordered_set>
@@ -78,14 +77,14 @@
};
template <>
-struct hash<string> {
- inline size_t operator()(const string& key) const {
+struct hash<std::string> {
+ inline size_t operator()(const std::string& key) const {
return hash<const char*>()(key.c_str());
}
static const size_t bucket_size = 4;
static const size_t min_buckets = 8;
- inline bool operator()(const string& a, const string& b) const {
+ inline bool operator()(const std::string& a, const std::string& b) const {
return a < b;
}
};
diff --git a/src/google/protobuf/stubs/stringpiece.cc b/src/google/protobuf/stubs/stringpiece.cc
index fc2f521..353c78c 100644
--- a/src/google/protobuf/stubs/stringpiece.cc
+++ b/src/google/protobuf/stubs/stringpiece.cc
@@ -64,11 +64,11 @@
GOOGLE_DCHECK_GE(len, 0);
}
-void StringPiece::CopyToString(string* target) const {
+void StringPiece::CopyToString(std::string* target) const {
target->assign(ptr_, length_);
}
-void StringPiece::AppendToString(string* target) const {
+void StringPiece::AppendToString(std::string* target) const {
target->append(ptr_, length_);
}
diff --git a/src/google/protobuf/stubs/stringpiece.h b/src/google/protobuf/stubs/stringpiece.h
index 2ae3881..fbcb20a 100644
--- a/src/google/protobuf/stubs/stringpiece.h
+++ b/src/google/protobuf/stubs/stringpiece.h
@@ -148,7 +148,6 @@
#include <limits>
#include <string>
-#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/hash.h>
#include <google/protobuf/port_def.inc>
@@ -165,7 +164,7 @@
// is 32 bits in LP32, 64 bits in LP64, 64 bits in LLP64
// future changes intended: http://go/64BitStringPiece
//
-typedef string::difference_type stringpiece_ssize_type;
+typedef std::string::difference_type stringpiece_ssize_type;
// STRINGPIECE_CHECK_SIZE protects us from 32-bit overflows.
// TODO(mec): delete this after stringpiece_ssize_type goes 64 bit.
@@ -302,25 +301,21 @@
return 0;
}
- string as_string() const {
- return ToString();
- }
+ std::string as_string() const { return ToString(); }
// We also define ToString() here, since many other string-like
// interfaces name the routine that converts to a C++ string
// "ToString", and it's confusing to have the method that does that
// for a StringPiece be called "as_string()". We also leave the
// "as_string()" method defined here for existing code.
- string ToString() const {
- if (ptr_ == nullptr) return string();
- return string(data(), static_cast<size_type>(size()));
+ std::string ToString() const {
+ if (ptr_ == nullptr) return "";
+ return std::string(data(), static_cast<size_type>(size()));
}
- operator string() const {
- return ToString();
- }
+ explicit operator std::string() const { return ToString(); }
- void CopyToString(string* target) const;
- void AppendToString(string* target) const;
+ void CopyToString(std::string* target) const;
+ void AppendToString(std::string* target) const;
bool starts_with(StringPiece x) const {
return (length_ >= x.length_) &&
@@ -466,7 +461,7 @@
return std::string(data_, static_cast<size_t>(size_));
}
- operator string() const { return ToString(); }
+ explicit operator std::string() const { return ToString(); }
private:
const char* data_;
diff --git a/src/google/protobuf/stubs/structurally_valid.cc b/src/google/protobuf/stubs/structurally_valid.cc
index 4d424a1..9a476c3 100644
--- a/src/google/protobuf/stubs/structurally_valid.cc
+++ b/src/google/protobuf/stubs/structurally_valid.cc
@@ -561,7 +561,7 @@
return (bytes_consumed == len);
}
-int UTF8SpnStructurallyValid(const StringPiece& str) {
+int UTF8SpnStructurallyValid(StringPiece str) {
if (!module_initialized_) return str.size();
int bytes_consumed = 0;
@@ -582,8 +582,7 @@
//
// Fast case: all is structurally valid and no byte copying is done.
//
-char* UTF8CoerceToStructurallyValid(const StringPiece& src_str,
- char* idst,
+char* UTF8CoerceToStructurallyValid(StringPiece src_str, char* idst,
const char replace_char) {
const char* isrc = src_str.data();
const int len = src_str.length();
diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc
index 24ae286..2722594 100644
--- a/src/google/protobuf/stubs/strutil.cc
+++ b/src/google/protobuf/stubs/strutil.cc
@@ -176,10 +176,8 @@
// the characters in the string, not the entire string as a single delimiter.
// ----------------------------------------------------------------------
template <typename ITR>
-static inline
-void SplitStringToIteratorUsing(const string& full,
- const char* delim,
- ITR& result) {
+static inline void SplitStringToIteratorUsing(StringPiece full,
+ const char *delim, ITR &result) {
// Optimize the common case where delim is a single character.
if (delim[0] != '\0' && delim[1] == '\0') {
char c = delim[0];
@@ -191,7 +189,7 @@
} else {
const char* start = p;
while (++p != end && *p != c);
- *result++ = string(start, p - start);
+ *result++ = std::string(start, p - start);
}
}
return;
@@ -202,17 +200,17 @@
while (begin_index != string::npos) {
end_index = full.find_first_of(delim, begin_index);
if (end_index == string::npos) {
- *result++ = full.substr(begin_index);
+ *result++ = std::string(full.substr(begin_index));
return;
}
- *result++ = full.substr(begin_index, (end_index - begin_index));
+ *result++ =
+ std::string(full.substr(begin_index, (end_index - begin_index)));
begin_index = full.find_first_not_of(delim, end_index);
}
}
-void SplitStringUsing(const string& full,
- const char* delim,
- std::vector<string>* result) {
+void SplitStringUsing(StringPiece full, const char *delim,
+ std::vector<string> *result) {
std::back_insert_iterator< std::vector<string> > it(*result);
SplitStringToIteratorUsing(full, delim, it);
}
@@ -228,29 +226,28 @@
//
// If "pieces" is negative for some reason, it returns the whole string
// ----------------------------------------------------------------------
-template <typename StringType, typename ITR>
-static inline
-void SplitStringToIteratorAllowEmpty(const StringType& full,
- const char* delim,
- int pieces,
- ITR& result) {
+template <typename ITR>
+static inline void SplitStringToIteratorAllowEmpty(StringPiece full,
+ const char *delim,
+ int pieces, ITR &result) {
string::size_type begin_index, end_index;
begin_index = 0;
for (int i = 0; (i < pieces-1) || (pieces == 0); i++) {
end_index = full.find_first_of(delim, begin_index);
if (end_index == string::npos) {
- *result++ = full.substr(begin_index);
+ *result++ = std::string(full.substr(begin_index));
return;
}
- *result++ = full.substr(begin_index, (end_index - begin_index));
+ *result++ =
+ std::string(full.substr(begin_index, (end_index - begin_index)));
begin_index = end_index + 1;
}
- *result++ = full.substr(begin_index);
+ *result++ = std::string(full.substr(begin_index));
}
-void SplitStringAllowEmpty(const string& full, const char* delim,
- std::vector<string>* result) {
+void SplitStringAllowEmpty(StringPiece full, const char *delim,
+ std::vector<string> *result) {
std::back_insert_iterator<std::vector<string> > it(*result);
SplitStringToIteratorAllowEmpty(full, delim, 0, it);
}
diff --git a/src/google/protobuf/stubs/strutil.h b/src/google/protobuf/stubs/strutil.h
index 981cb6e..c070a05 100644
--- a/src/google/protobuf/stubs/strutil.h
+++ b/src/google/protobuf/stubs/strutil.h
@@ -113,12 +113,6 @@
// prefix string if the prefix matches, otherwise the original
// string.
// ----------------------------------------------------------------------
-inline bool HasPrefixString(const string& str,
- const string& prefix) {
- return str.size() >= prefix.size() &&
- str.compare(0, prefix.size(), prefix) == 0;
-}
-
inline bool HasPrefixString(StringPiece str, StringPiece prefix) {
return str.size() >= prefix.size() &&
memcmp(str.data(), prefix.data(), prefix.size()) == 0;
@@ -140,10 +134,10 @@
// suffix string if the suffix matches, otherwise the original
// string.
// ----------------------------------------------------------------------
-inline bool HasSuffixString(const string& str,
- const string& suffix) {
+inline bool HasSuffixString(StringPiece str, StringPiece suffix) {
return str.size() >= suffix.size() &&
- str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
+ memcmp(str.data() + str.size() - suffix.size(), suffix.data(),
+ suffix.size()) == 0;
}
inline string StripSuffixString(const string& str, const string& suffix) {
@@ -219,7 +213,7 @@
// to 'result'. If there are consecutive delimiters, this function skips
// over all of them.
// ----------------------------------------------------------------------
-PROTOBUF_EXPORT void SplitStringUsing(const string& full, const char* delim,
+PROTOBUF_EXPORT void SplitStringUsing(StringPiece full, const char* delim,
std::vector<string>* res);
// Split a string using one or more byte delimiters, presented
@@ -230,16 +224,15 @@
//
// If "full" is the empty string, yields an empty string as the only value.
// ----------------------------------------------------------------------
-PROTOBUF_EXPORT void SplitStringAllowEmpty(const string& full,
- const char* delim,
+PROTOBUF_EXPORT void SplitStringAllowEmpty(StringPiece full, const char* delim,
std::vector<string>* result);
// ----------------------------------------------------------------------
// Split()
// Split a string using a character delimiter.
// ----------------------------------------------------------------------
-inline std::vector<string> Split(
- const string& full, const char* delim, bool skip_empty = true) {
+inline std::vector<string> Split(StringPiece full, const char* delim,
+ bool skip_empty = true) {
std::vector<string> result;
if (skip_empty) {
SplitStringUsing(full, delim, &result);
diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h
index 84c7440..b3db098 100644
--- a/src/google/protobuf/timestamp.pb.h
+++ b/src/google/protobuf/timestamp.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -45,7 +45,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ftimestamp_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h
index eb4b937..ea57370 100644
--- a/src/google/protobuf/type.pb.h
+++ b/src/google/protobuf/type.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -48,7 +48,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2ftype_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[5]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
@@ -369,15 +369,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -679,15 +670,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -704,15 +686,6 @@
std::string* mutable_type_url();
std::string* release_type_url();
void set_allocated_type_url(std::string* type_url);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_type_url();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_type_url(
- std::string* type_url);
private:
const std::string& _internal_type_url() const;
void _internal_set_type_url(const std::string& value);
@@ -729,15 +702,6 @@
std::string* mutable_json_name();
std::string* release_json_name();
void set_allocated_json_name(std::string* json_name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_json_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_json_name(
- std::string* json_name);
private:
const std::string& _internal_json_name() const;
void _internal_set_json_name(const std::string& value);
@@ -754,15 +718,6 @@
std::string* mutable_default_value();
std::string* release_default_value();
void set_allocated_default_value(std::string* default_value);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_default_value();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_default_value(
- std::string* default_value);
private:
const std::string& _internal_default_value() const;
void _internal_set_default_value(const std::string& value);
@@ -1001,15 +956,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -1205,15 +1151,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -1370,15 +1307,6 @@
std::string* mutable_name();
std::string* release_name();
void set_allocated_name(std::string* name);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_name();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_name(
- std::string* name);
private:
const std::string& _internal_name() const;
void _internal_set_name(const std::string& value);
@@ -1487,25 +1415,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Type.name)
}
-inline std::string* Type::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Type.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Type::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Type.name)
-}
// repeated .google.protobuf.Field fields = 2;
inline int Type::_internal_fields_size() const {
@@ -1881,25 +1790,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.name)
}
-inline std::string* Field::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Field::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.name)
-}
// string type_url = 6;
inline void Field::clear_type_url() {
@@ -1962,25 +1852,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.type_url)
}
-inline std::string* Field::unsafe_arena_release_type_url() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.type_url)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return type_url_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Field::unsafe_arena_set_allocated_type_url(
- std::string* type_url) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (type_url != nullptr) {
-
- } else {
-
- }
- type_url_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- type_url, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.type_url)
-}
// int32 oneof_index = 7;
inline void Field::clear_oneof_index() {
@@ -2122,25 +1993,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.json_name)
}
-inline std::string* Field::unsafe_arena_release_json_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.json_name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return json_name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Field::unsafe_arena_set_allocated_json_name(
- std::string* json_name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (json_name != nullptr) {
-
- } else {
-
- }
- json_name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- json_name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.json_name)
-}
// string default_value = 11;
inline void Field::clear_default_value() {
@@ -2203,25 +2055,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Field.default_value)
}
-inline std::string* Field::unsafe_arena_release_default_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Field.default_value)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return default_value_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Field::unsafe_arena_set_allocated_default_value(
- std::string* default_value) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (default_value != nullptr) {
-
- } else {
-
- }
- default_value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- default_value, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Field.default_value)
-}
// -------------------------------------------------------------------
@@ -2288,25 +2121,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Enum.name)
}
-inline std::string* Enum::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Enum.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Enum::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Enum.name)
-}
// repeated .google.protobuf.EnumValue enumvalue = 2;
inline int Enum::_internal_enumvalue_size() const {
@@ -2548,25 +2362,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValue.name)
}
-inline std::string* EnumValue::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValue.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void EnumValue::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.EnumValue.name)
-}
// int32 number = 2;
inline void EnumValue::clear_number() {
@@ -2692,25 +2487,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.Option.name)
}
-inline std::string* Option::unsafe_arena_release_name() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Option.name)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void Option::unsafe_arena_set_allocated_name(
- std::string* name) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (name != nullptr) {
-
- } else {
-
- }
- name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- name, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Option.name)
-}
// .google.protobuf.Any value = 2;
inline bool Option::_internal_has_value() const {
diff --git a/src/google/protobuf/util/field_mask_util.h b/src/google/protobuf/util/field_mask_util.h
index cc2148d..3ca9359 100644
--- a/src/google/protobuf/util/field_mask_util.h
+++ b/src/google/protobuf/util/field_mask_util.h
@@ -106,7 +106,7 @@
template <typename T>
static void AddPathToFieldMask(StringPiece path, FieldMask* mask) {
GOOGLE_CHECK(IsValidPath<T>(path)) << path;
- mask->add_paths(path);
+ mask->add_paths(std::string(path));
}
// Creates a FieldMask with all fields of type T. This FieldMask only
diff --git a/src/google/protobuf/util/internal/expecting_objectwriter.h b/src/google/protobuf/util/internal/expecting_objectwriter.h
index 71ecb1d..2cb7f69 100644
--- a/src/google/protobuf/util/internal/expecting_objectwriter.h
+++ b/src/google/protobuf/util/internal/expecting_objectwriter.h
@@ -60,6 +60,7 @@
namespace util {
namespace converter {
+using testing::Eq;
using testing::IsEmpty;
using testing::NanSensitiveDoubleEq;
using testing::NanSensitiveFloatEq;
@@ -100,7 +101,7 @@
virtual ObjectWriter* StartObject(StringPiece name) {
(name.empty() ? EXPECT_CALL(*mock_, StartObject(IsEmpty()))
- : EXPECT_CALL(*mock_, StartObject(StrEq(std::string(name)))))
+ : EXPECT_CALL(*mock_, StartObject(Eq(std::string(name)))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
return this;
@@ -115,7 +116,7 @@
virtual ObjectWriter* StartList(StringPiece name) {
(name.empty() ? EXPECT_CALL(*mock_, StartList(IsEmpty()))
- : EXPECT_CALL(*mock_, StartList(StrEq(std::string(name)))))
+ : EXPECT_CALL(*mock_, StartList(Eq(std::string(name)))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
return this;
@@ -131,8 +132,8 @@
virtual ObjectWriter* RenderBool(StringPiece name, bool value) {
(name.empty()
? EXPECT_CALL(*mock_, RenderBool(IsEmpty(), TypedEq<bool>(value)))
- : EXPECT_CALL(*mock_, RenderBool(StrEq(std::string(name)),
- TypedEq<bool>(value))))
+ : EXPECT_CALL(*mock_,
+ RenderBool(Eq(std::string(name)), TypedEq<bool>(value))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
return this;
@@ -141,7 +142,7 @@
virtual ObjectWriter* RenderInt32(StringPiece name, int32 value) {
(name.empty()
? EXPECT_CALL(*mock_, RenderInt32(IsEmpty(), TypedEq<int32>(value)))
- : EXPECT_CALL(*mock_, RenderInt32(StrEq(std::string(name)),
+ : EXPECT_CALL(*mock_, RenderInt32(Eq(std::string(name)),
TypedEq<int32>(value))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
@@ -151,7 +152,7 @@
virtual ObjectWriter* RenderUint32(StringPiece name, uint32 value) {
(name.empty()
? EXPECT_CALL(*mock_, RenderUint32(IsEmpty(), TypedEq<uint32>(value)))
- : EXPECT_CALL(*mock_, RenderUint32(StrEq(std::string(name)),
+ : EXPECT_CALL(*mock_, RenderUint32(Eq(std::string(name)),
TypedEq<uint32>(value))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
@@ -161,7 +162,7 @@
virtual ObjectWriter* RenderInt64(StringPiece name, int64 value) {
(name.empty()
? EXPECT_CALL(*mock_, RenderInt64(IsEmpty(), TypedEq<int64>(value)))
- : EXPECT_CALL(*mock_, RenderInt64(StrEq(std::string(name)),
+ : EXPECT_CALL(*mock_, RenderInt64(Eq(std::string(name)),
TypedEq<int64>(value))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
@@ -171,7 +172,7 @@
virtual ObjectWriter* RenderUint64(StringPiece name, uint64 value) {
(name.empty()
? EXPECT_CALL(*mock_, RenderUint64(IsEmpty(), TypedEq<uint64>(value)))
- : EXPECT_CALL(*mock_, RenderUint64(StrEq(std::string(name)),
+ : EXPECT_CALL(*mock_, RenderUint64(Eq(std::string(name)),
TypedEq<uint64>(value))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
@@ -182,7 +183,7 @@
(name.empty()
? EXPECT_CALL(*mock_,
RenderDouble(IsEmpty(), NanSensitiveDoubleEq(value)))
- : EXPECT_CALL(*mock_, RenderDouble(StrEq(std::string(name)),
+ : EXPECT_CALL(*mock_, RenderDouble(Eq(std::string(name)),
NanSensitiveDoubleEq(value))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
@@ -193,7 +194,7 @@
(name.empty()
? EXPECT_CALL(*mock_,
RenderFloat(IsEmpty(), NanSensitiveFloatEq(value)))
- : EXPECT_CALL(*mock_, RenderFloat(StrEq(std::string(name)),
+ : EXPECT_CALL(*mock_, RenderFloat(Eq(std::string(name)),
NanSensitiveFloatEq(value))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
@@ -205,7 +206,7 @@
(name.empty() ? EXPECT_CALL(*mock_, RenderString(IsEmpty(),
TypedEq<StringPiece>(
std::string(value))))
- : EXPECT_CALL(*mock_, RenderString(StrEq(std::string(name)),
+ : EXPECT_CALL(*mock_, RenderString(Eq(std::string(name)),
TypedEq<StringPiece>(
std::string(value)))))
.WillOnce(Return(mock_))
@@ -217,7 +218,7 @@
? EXPECT_CALL(*mock_, RenderBytes(IsEmpty(), TypedEq<StringPiece>(
value.ToString())))
: EXPECT_CALL(*mock_,
- RenderBytes(StrEq(name.ToString()),
+ RenderBytes(Eq(std::string(name)),
TypedEq<StringPiece>(value.ToString()))))
.WillOnce(Return(mock_))
.RetiresOnSaturation();
@@ -226,7 +227,7 @@
virtual ObjectWriter* RenderNull(StringPiece name) {
(name.empty() ? EXPECT_CALL(*mock_, RenderNull(IsEmpty()))
- : EXPECT_CALL(*mock_, RenderNull(StrEq(std::string(name))))
+ : EXPECT_CALL(*mock_, RenderNull(Eq(std::string(name))))
.WillOnce(Return(mock_))
.RetiresOnSaturation());
return this;
diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h
index 7a1cc4d..d6ee3fc 100644
--- a/src/google/protobuf/wrappers.pb.h
+++ b/src/google/protobuf/wrappers.pb.h
@@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3011000
+#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3011004 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3012002 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
@@ -45,7 +45,7 @@
struct PROTOBUF_EXPORT TableStruct_google_2fprotobuf_2fwrappers_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
- static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[]
+ static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[9]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
@@ -1182,15 +1182,6 @@
std::string* mutable_value();
std::string* release_value();
void set_allocated_value(std::string* value);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_value();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_value(
- std::string* value);
private:
const std::string& _internal_value() const;
void _internal_set_value(const std::string& value);
@@ -1335,15 +1326,6 @@
std::string* mutable_value();
std::string* release_value();
void set_allocated_value(std::string* value);
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- std::string* unsafe_arena_release_value();
- GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
- " string fields are deprecated and will be removed in a"
- " future release.")
- void unsafe_arena_set_allocated_value(
- std::string* value);
private:
const std::string& _internal_value() const;
void _internal_set_value(const std::string& value);
@@ -1601,25 +1583,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.StringValue.value)
}
-inline std::string* StringValue::unsafe_arena_release_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.StringValue.value)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return value_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void StringValue::unsafe_arena_set_allocated_value(
- std::string* value) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (value != nullptr) {
-
- } else {
-
- }
- value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- value, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.StringValue.value)
-}
// -------------------------------------------------------------------
@@ -1686,25 +1649,6 @@
GetArena());
// @@protoc_insertion_point(field_set_allocated:google.protobuf.BytesValue.value)
}
-inline std::string* BytesValue::unsafe_arena_release_value() {
- // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.BytesValue.value)
- GOOGLE_DCHECK(GetArena() != nullptr);
-
- return value_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- GetArena());
-}
-inline void BytesValue::unsafe_arena_set_allocated_value(
- std::string* value) {
- GOOGLE_DCHECK(GetArena() != nullptr);
- if (value != nullptr) {
-
- } else {
-
- }
- value_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
- value, GetArena());
- // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.BytesValue.value)
-}
#ifdef __GNUC__
#pragma GCC diagnostic pop
diff --git a/tests.sh b/tests.sh
index 59c4162..0a0e798 100755
--- a/tests.sh
+++ b/tests.sh
@@ -492,24 +492,12 @@
use_php() {
VERSION=$1
export PATH=/usr/local/php-${VERSION}/bin:$PATH
- export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$CPLUS_INCLUDE_PATH
- export C_INCLUDE_PATH=/usr/local/php-${VERSION}/include/php/main:/usr/local/php-${VERSION}/include/php/:$C_INCLUDE_PATH
generate_php_test_proto
}
use_php_zts() {
VERSION=$1
export PATH=/usr/local/php-${VERSION}-zts/bin:$PATH
- export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}-zts/include/php/main:/usr/local/php-${VERSION}-zts/include/php/:$CPLUS_INCLUDE_PATH
- export C_INCLUDE_PATH=/usr/local/php-${VERSION}-zts/include/php/main:/usr/local/php-${VERSION}-zts/include/php/:$C_INCLUDE_PATH
- generate_php_test_proto
-}
-
-use_php_bc() {
- VERSION=$1
- export PATH=/usr/local/php-${VERSION}-bc/bin:$PATH
- export CPLUS_INCLUDE_PATH=/usr/local/php-${VERSION}-bc/include/php/main:/usr/local/php-${VERSION}-bc/include/php/:$CPLUS_INCLUDE_PATH
- export C_INCLUDE_PATH=/usr/local/php-${VERSION}-bc/include/php/main:/usr/local/php-${VERSION}-bc/include/php/:$C_INCLUDE_PATH
generate_php_test_proto
}
@@ -529,9 +517,7 @@
build_php5.5_c() {
IS_64BIT=$1
use_php 5.5
- pushd php/tests
- /bin/bash ./test.sh 5.5
- popd
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -547,9 +533,7 @@
pushd php
rm -rf vendor
composer update
- pushd tests
- /bin/bash ./compile_extension.sh 5.5
- popd
+ tests/compile_extension.sh
php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit
popd
}
@@ -557,7 +541,7 @@
build_php5.5_zts_c() {
IS_64BIT=$1
use_php_zts 5.5
- cd php/tests && /bin/bash ./test.sh 5.5-zts && cd ../..
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -583,7 +567,7 @@
build_php5.6_c() {
IS_64BIT=$1
use_php 5.6
- cd php/tests && /bin/bash ./test.sh 5.6 && cd ../..
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -599,9 +583,7 @@
pushd php
rm -rf vendor
composer update
- pushd tests
- /bin/bash ./compile_extension.sh 5.6
- popd
+ tests/compile_extension.sh
php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit
popd
}
@@ -609,7 +591,7 @@
build_php5.6_zts_c() {
IS_64BIT=$1
use_php_zts 5.6
- cd php/tests && /bin/bash ./test.sh 5.6-zts && cd ../..
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -639,10 +621,8 @@
sudo mv valgrind /usr/local/bin/valgrind
# Test
- cd php/tests && /bin/bash ./test.sh && cd ../..
- pushd conformance
- make test_php_c
- popd
+ php/tests/test.sh
+ (cd conformance && make test_php_c)
}
build_php7.0() {
@@ -652,15 +632,13 @@
composer update
./vendor/bin/phpunit
popd
- pushd conformance
- make test_php
- popd
+ (cd conformance && make test_php)
}
build_php7.0_c() {
IS_64BIT=$1
use_php 7.0
- cd php/tests && /bin/bash ./test.sh 7.0 && cd ../..
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -676,9 +654,7 @@
pushd php
rm -rf vendor
composer update
- pushd tests
- /bin/bash ./compile_extension.sh 7.0
- popd
+ tests/compile_extension.sh
php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit
popd
}
@@ -686,7 +662,7 @@
build_php7.0_zts_c() {
IS_64BIT=$1
use_php_zts 7.0
- cd php/tests && /bin/bash ./test.sh 7.0-zts && cd ../..
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -716,10 +692,8 @@
sudo mv valgrind /usr/local/bin/valgrind
# Test
- cd php/tests && /bin/bash ./test.sh && cd ../..
- pushd conformance
- make test_php_c
- popd
+ php/tests/test.sh
+ (cd conformance && make test_php_c)
}
build_php7.3_mac() {
@@ -743,10 +717,8 @@
sudo mv valgrind /usr/local/bin/valgrind
# Test
- cd php/tests && /bin/bash ./test.sh && cd ../..
- pushd conformance
- make test_php_c
- popd
+ php/tests/test.sh
+ (cd conformance && make test_php_c)
}
build_php_compatibility() {
@@ -756,9 +728,7 @@
build_php_multirequest() {
use_php 7.4
- pushd php/tests
- ./multirequest.sh
- popd
+ php/tests/multirequest.sh
}
build_php7.1() {
@@ -768,15 +738,13 @@
composer update
./vendor/bin/phpunit
popd
- pushd conformance
- make test_php
- popd
+ (cd conformance && make test_php)
}
build_php7.1_c() {
IS_64BIT=$1
use_php 7.1
- cd php/tests && /bin/bash ./test.sh 7.1 && cd ../..
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -792,9 +760,7 @@
pushd php
rm -rf vendor
composer update
- pushd tests
- /bin/bash ./compile_extension.sh 7.1
- popd
+ tests/compile_extension.sh
php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit
popd
}
@@ -802,7 +768,7 @@
build_php7.1_zts_c() {
IS_64BIT=$1
use_php_zts 7.1
- cd php/tests && /bin/bash ./test.sh 7.1-zts && cd ../..
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -820,15 +786,13 @@
composer update
./vendor/bin/phpunit
popd
- pushd conformance
- make test_php
- popd
+ (cd conformance && make test_php)
}
build_php7.4_c() {
IS_64BIT=$1
use_php 7.4
- cd php/tests && /bin/bash ./test.sh 7.4 && cd ../..
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -837,9 +801,7 @@
make test_php_c_32
fi
popd
- pushd php/ext/google/protobuf
- phpize --clean
- popd
+ (cd php/ext/google/protobuf && phpize --clean)
}
build_php7.4_mixed() {
@@ -847,20 +809,16 @@
pushd php
rm -rf vendor
composer update
- pushd tests
- /bin/bash ./compile_extension.sh 7.4
- popd
+ tests/compile_extension.sh
php -dextension=./ext/google/protobuf/modules/protobuf.so ./vendor/bin/phpunit
popd
- pushd php/ext/google/protobuf
- phpize --clean
- popd
+ (cd php/ext/google/protobuf && phpize --clean)
}
build_php7.4_zts_c() {
IS_64BIT=$1
use_php_zts 7.4
- cd php/tests && /bin/bash ./test.sh 7.4-zts && cd ../..
+ php/tests/test.sh
pushd conformance
if [ "$IS_64BIT" = "true" ]
then
@@ -869,9 +827,7 @@
make test_php_c_32
fi
popd
- pushd php/ext/google/protobuf
- phpize --clean
- popd
+ (cd php/ext/google/protobuf && phpize --clean)
}
build_php_all_32() {