aboutsummaryrefslogtreecommitdiff
path: root/src/google
diff options
context:
space:
mode:
Diffstat (limited to 'src/google')
-rw-r--r--src/google/protobuf/any.pb.cc5
-rw-r--r--src/google/protobuf/any.pb.h2
-rw-r--r--src/google/protobuf/api.pb.cc7
-rw-r--r--src/google/protobuf/api.pb.h2
-rw-r--r--src/google/protobuf/compiler/code_generator.h4
-rw-r--r--src/google/protobuf/compiler/command_line_interface.cc38
-rw-r--r--src/google/protobuf/compiler/command_line_interface_unittest.cc28
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_enum_field.cc18
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_file.cc33
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_message.cc5
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_primitive_field.cc6
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc8
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_field_base.cc4
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_field_base.h6
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message.cc8
-rw-r--r--src/google/protobuf/compiler/importer.cc18
-rw-r--r--src/google/protobuf/compiler/java/java_message_builder.cc6
-rw-r--r--src/google/protobuf/compiler/java/java_message_lite.cc4
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_enum_field.cc2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_enum_field.h6
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_extension.cc2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_extension.h2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_field.cc6
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_field.h6
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_helpers.cc2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_helpers.h2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_map_field.cc2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_map_field.h2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_message.cc2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_message_field.cc2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_message_field.h6
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_params.h4
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_primitive_field.cc2
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_primitive_field.h8
-rwxr-xr-xsrc/google/protobuf/compiler/js/js_generator.cc1
-rw-r--r--src/google/protobuf/compiler/mock_code_generator.cc7
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc4
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_enum_field.h2
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_extension.cc4
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_field.cc4
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_field.h4
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_file.cc14
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_helpers.cc29
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_helpers.h6
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_map_field.cc2
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_map_field.h2
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_message.cc4
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_message.h2
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_message_field.cc6
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_message_field.h4
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_oneof.h2
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc2
-rw-r--r--src/google/protobuf/compiler/php/php_generator.cc149
-rw-r--r--src/google/protobuf/compiler/plugin.cc17
-rw-r--r--src/google/protobuf/compiler/plugin.pb.cc8
-rw-r--r--src/google/protobuf/compiler/plugin.pb.h2
-rw-r--r--src/google/protobuf/compiler/profile.pb.cc7
-rw-r--r--src/google/protobuf/compiler/profile.pb.h2
-rw-r--r--src/google/protobuf/descriptor.pb.cc348
-rw-r--r--src/google/protobuf/descriptor.pb.h54
-rw-r--r--src/google/protobuf/descriptor.proto1
-rw-r--r--src/google/protobuf/duration.pb.cc7
-rw-r--r--src/google/protobuf/duration.pb.h2
-rw-r--r--src/google/protobuf/empty.pb.cc7
-rw-r--r--src/google/protobuf/empty.pb.h2
-rw-r--r--src/google/protobuf/field_mask.pb.cc5
-rw-r--r--src/google/protobuf/field_mask.pb.h2
-rw-r--r--src/google/protobuf/generated_message_table_driven.cc6
-rw-r--r--src/google/protobuf/generated_message_util.h2
-rw-r--r--src/google/protobuf/io/coded_stream.h2
-rw-r--r--src/google/protobuf/io/zero_copy_stream_impl.cc13
-rw-r--r--src/google/protobuf/io/zero_copy_stream_unittest.cc11
-rw-r--r--src/google/protobuf/map.h7
-rw-r--r--src/google/protobuf/map_field_inl.h4
-rw-r--r--src/google/protobuf/message_unittest.cc12
-rw-r--r--src/google/protobuf/source_context.pb.cc5
-rw-r--r--src/google/protobuf/source_context.pb.h2
-rw-r--r--src/google/protobuf/struct.pb.cc13
-rw-r--r--src/google/protobuf/struct.pb.h2
-rw-r--r--src/google/protobuf/stubs/atomicops.h35
-rw-r--r--src/google/protobuf/stubs/common.h4
-rw-r--r--src/google/protobuf/stubs/hash.h8
-rw-r--r--src/google/protobuf/stubs/io_win32.cc362
-rw-r--r--src/google/protobuf/stubs/io_win32.h96
-rw-r--r--src/google/protobuf/stubs/io_win32_unittest.cc367
-rw-r--r--src/google/protobuf/stubs/port.h7
-rw-r--r--src/google/protobuf/test_messages_proto2.proto216
-rw-r--r--src/google/protobuf/test_messages_proto3.proto7
-rw-r--r--src/google/protobuf/testing/file.cc19
-rw-r--r--src/google/protobuf/testing/googletest.cc36
-rw-r--r--src/google/protobuf/testing/googletest.h2
-rw-r--r--src/google/protobuf/timestamp.pb.cc7
-rw-r--r--src/google/protobuf/timestamp.pb.h2
-rw-r--r--src/google/protobuf/type.pb.cc19
-rw-r--r--src/google/protobuf/type.pb.h2
-rw-r--r--src/google/protobuf/wrappers.pb.cc31
-rw-r--r--src/google/protobuf/wrappers.pb.h2
97 files changed, 1809 insertions, 462 deletions
diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc
index f1cf6d46..948530ba 100644
--- a/src/google/protobuf/any.pb.cc
+++ b/src/google/protobuf/any.pb.cc
@@ -102,6 +102,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -118,12 +119,13 @@ void AddDescriptorsImpl() {
"google/protobuf/any.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -309,6 +311,7 @@ void Any::SerializeWithCachedSizes(
::google::protobuf::uint8* Any::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Any)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h
index bc05fb35..ad2073a8 100644
--- a/src/google/protobuf/any.pb.h
+++ b/src/google/protobuf/any.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc
index 30dd8dbc..093bf1cb 100644
--- a/src/google/protobuf/api.pb.cc
+++ b/src/google/protobuf/api.pb.cc
@@ -146,6 +146,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -177,12 +178,13 @@ void AddDescriptorsImpl() {
::google::protobuf::protobuf_google_2fprotobuf_2ftype_2eproto::AddDescriptors();
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -486,6 +488,7 @@ void Api::SerializeWithCachedSizes(
::google::protobuf::uint8* Api::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Api)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1254,6 +1257,7 @@ void Method::SerializeWithCachedSizes(
::google::protobuf::uint8* Method::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Method)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1868,6 +1872,7 @@ void Mixin::SerializeWithCachedSizes(
::google::protobuf::uint8* Mixin::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Mixin)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h
index 729e4ad1..f857f220 100644
--- a/src/google/protobuf/api.pb.h
+++ b/src/google/protobuf/api.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/compiler/code_generator.h b/src/google/protobuf/compiler/code_generator.h
index b917d373..6ea5f18d 100644
--- a/src/google/protobuf/compiler/code_generator.h
+++ b/src/google/protobuf/compiler/code_generator.h
@@ -162,8 +162,8 @@ typedef GeneratorContext OutputDirectory;
// "foo=bar,baz,qux=corge"
// parses to the pairs:
// ("foo", "bar"), ("baz", ""), ("qux", "corge")
-extern void ParseGeneratorParameter(const string&,
- std::vector<std::pair<string, string> >*);
+LIBPROTOC_EXPORT void ParseGeneratorParameter(
+ const string&, std::vector<std::pair<string, string> >*);
} // namespace compiler
} // namespace protobuf
diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc
index df03907d..4d894c82 100644
--- a/src/google/protobuf/compiler/command_line_interface.cc
+++ b/src/google/protobuf/compiler/command_line_interface.cc
@@ -45,10 +45,7 @@
#endif
#include <sys/stat.h>
#include <fcntl.h>
-#ifdef _MSC_VER
-#include <io.h>
-#include <direct.h>
-#else
+#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <errno.h>
@@ -80,6 +77,7 @@
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/io/printer.h>
+#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/strutil.h>
#include <google/protobuf/stubs/substitute.h>
@@ -91,22 +89,6 @@ namespace google {
namespace protobuf {
namespace compiler {
-#if defined(_WIN32)
-#define mkdir(name, mode) mkdir(name)
-#ifndef W_OK
-#define W_OK 02 // not defined by MSVC for whatever reason
-#endif
-#ifndef F_OK
-#define F_OK 00 // not defined by MSVC for whatever reason
-#endif
-#ifndef STDIN_FILENO
-#define STDIN_FILENO 0
-#endif
-#ifndef STDOUT_FILENO
-#define STDOUT_FILENO 1
-#endif
-#endif
-
#ifndef O_BINARY
#ifdef _O_BINARY
#define O_BINARY _O_BINARY
@@ -118,6 +100,14 @@ namespace compiler {
namespace {
#if defined(_WIN32) && !defined(__CYGWIN__)
static const char* kPathSeparator = ";";
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::access;
+using google::protobuf::internal::win32::close;
+using google::protobuf::internal::win32::mkdir;
+using google::protobuf::internal::win32::open;
+using google::protobuf::internal::win32::setmode;
+using google::protobuf::internal::win32::write;
#else
static const char* kPathSeparator = ":";
#endif
@@ -141,9 +131,9 @@ static bool IsWindowsAbsolutePath(const string& text) {
void SetFdToTextMode(int fd) {
#ifdef _WIN32
- if (_setmode(fd, _O_TEXT) == -1) {
+ if (setmode(fd, _O_TEXT) == -1) {
// This should never happen, I think.
- GOOGLE_LOG(WARNING) << "_setmode(" << fd << ", _O_TEXT): " << strerror(errno);
+ GOOGLE_LOG(WARNING) << "setmode(" << fd << ", _O_TEXT): " << strerror(errno);
}
#endif
// (Text and binary are the same on non-Windows platforms.)
@@ -151,9 +141,9 @@ void SetFdToTextMode(int fd) {
void SetFdToBinaryMode(int fd) {
#ifdef _WIN32
- if (_setmode(fd, _O_BINARY) == -1) {
+ if (setmode(fd, _O_BINARY) == -1) {
// This should never happen, I think.
- GOOGLE_LOG(WARNING) << "_setmode(" << fd << ", _O_BINARY): " << strerror(errno);
+ GOOGLE_LOG(WARNING) << "setmode(" << fd << ", _O_BINARY): " << strerror(errno);
}
#endif
// (Text and binary are the same on non-Windows platforms.)
diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc
index 366e623f..5fbb37a4 100644
--- a/src/google/protobuf/compiler/command_line_interface_unittest.cc
+++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc
@@ -35,9 +35,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
-#ifdef _MSC_VER
-#include <io.h>
-#else
+#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <memory>
@@ -65,27 +63,27 @@
#include <gtest/gtest.h>
#include <google/protobuf/stubs/strutil.h>
+#include <google/protobuf/stubs/io_win32.h>
namespace google {
namespace protobuf {
namespace compiler {
+#if defined(_WIN32)
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::access;
+using google::protobuf::internal::win32::dup;
+using google::protobuf::internal::win32::dup2;
+using google::protobuf::internal::win32::close;
+using google::protobuf::internal::win32::open;
+using google::protobuf::internal::win32::write;
+#endif
+
// Disable the whole test when we use tcmalloc for "draconian" heap checks, in
// which case tcmalloc will print warnings that fail the plugin tests.
#if !GOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN
-#if defined(_WIN32)
-#ifndef STDIN_FILENO
-#define STDIN_FILENO 0
-#endif
-#ifndef STDOUT_FILENO
-#define STDOUT_FILENO 1
-#endif
-#ifndef F_OK
-#define F_OK 00 // not defined by MSVC for whatever reason
-#endif
-#endif
-
namespace {
bool FileExists(const string& path) {
diff --git a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc
index 0d3fdcbe..960730ca 100644
--- a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc
@@ -144,13 +144,13 @@ GenerateMergeFromCodedStream(io::Printer* printer) const {
printer->Print(variables_,
"} else {\n"
" mutable_unknown_fields()->AddVarint(\n"
- " $number$, static_cast<::google::protobuf::uint64>(value));\n");
+ " $number$, static_cast< ::google::protobuf::uint64>(value));\n");
} else {
printer->Print(
"} else {\n"
" unknown_fields_stream.WriteVarint32($tag$u);\n"
" unknown_fields_stream.WriteVarint32(\n"
- " static_cast<::google::protobuf::uint32>(value));\n",
+ " static_cast< ::google::protobuf::uint32>(value));\n",
"tag", SimpleItoa(internal::WireFormat::MakeTag(descriptor_)));
}
printer->Print(variables_,
@@ -347,13 +347,13 @@ GenerateMergeFromCodedStream(io::Printer* printer) const {
printer->Print(variables_,
"} else {\n"
" mutable_unknown_fields()->AddVarint(\n"
- " $number$, static_cast<::google::protobuf::uint64>(value));\n");
+ " $number$, static_cast< ::google::protobuf::uint64>(value));\n");
} else {
printer->Print(
"} else {\n"
" unknown_fields_stream.WriteVarint32(tag);\n"
" unknown_fields_stream.WriteVarint32(\n"
- " static_cast<::google::protobuf::uint32>(value));\n");
+ " static_cast< ::google::protobuf::uint32>(value));\n");
}
printer->Print("}\n");
}
@@ -412,12 +412,12 @@ GenerateMergeFromCodedStreamWithPacking(io::Printer* printer) const {
if (UseUnknownFieldSet(descriptor_->file(), options_)) {
printer->Print(variables_,
" mutable_unknown_fields()->AddVarint(\n"
- " $number$, static_cast<::google::protobuf::uint64>(value));\n");
+ " $number$, static_cast< ::google::protobuf::uint64>(value));\n");
} else {
printer->Print(variables_,
" unknown_fields_stream.WriteVarint32(tag);\n"
" unknown_fields_stream.WriteVarint32(\n"
- " static_cast<::google::protobuf::uint32>(value));\n");
+ " static_cast< ::google::protobuf::uint32>(value));\n");
}
printer->Print(
" }\n");
@@ -439,7 +439,7 @@ GenerateSerializeWithCachedSizes(io::Printer* printer) const {
" ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,\n"
" output);\n"
" output->WriteVarint32(\n"
- " static_cast<::google::protobuf::uint32>(_$name$_cached_byte_size_));\n"
+ " static_cast< ::google::protobuf::uint32>(_$name$_cached_byte_size_));\n"
"}\n");
}
printer->Print(variables_,
@@ -467,7 +467,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const {
" ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,\n"
" target);\n"
" target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray("
- " static_cast<::google::protobuf::uint32>(\n"
+ " static_cast< ::google::protobuf::uint32>(\n"
" _$name$_cached_byte_size_), target);\n"
" target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(\n"
" this->$name$_, target);\n"
@@ -497,7 +497,7 @@ GenerateByteSize(io::Printer* printer) const {
"if (data_size > 0) {\n"
" total_size += $tag_size$ +\n"
" ::google::protobuf::internal::WireFormatLite::Int32Size(\n"
- " static_cast<google::protobuf::int32>(data_size));\n"
+ " static_cast< ::google::protobuf::int32>(data_size));\n"
"}\n"
"int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);\n"
"GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n"
diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc
index 1f7a66c5..feb8ba65 100644
--- a/src/google/protobuf/compiler/cpp/cpp_file.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_file.cc
@@ -526,11 +526,10 @@ class FileGenerator::ForwardDeclarations {
void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) {
// AddDescriptors() is a file-level procedure which adds the encoded
// FileDescriptorProto for this .proto file to the global DescriptorPool for
- // generated files (DescriptorPool::generated_pool()). It either runs at
- // static initialization time (by default) or when default_instance() is
- // called for the first time (in LITE_RUNTIME mode with
- // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER flag enabled). This procedure also
- // constructs default instances and registers extensions.
+ // generated files (DescriptorPool::generated_pool()). It ordinarily runs at
+ // static initialization time, but is not used at all in LITE_RUNTIME mode
+ // except when extensions are used. This procedure also constructs default
+ // instances and registers extensions.
//
// Its sibling, AssignDescriptors(), actually pulls the compiled
// FileDescriptor from the DescriptorPool and uses it to populate all of
@@ -812,6 +811,7 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) {
// Now generate the AddDescriptors() function.
printer->Print(
+ "namespace {\n"
"void AddDescriptorsImpl() {\n"
" InitDefaults();\n");
@@ -883,25 +883,22 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) {
printer->Outdent();
printer->Print(
"}\n"
+ "} // anonymous namespace\n"
"\n"
"void AddDescriptors() {\n"
" static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n"
" ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);\n"
"}\n");
- if (!StaticInitializersForced(file_, options_)) {
- printer->Print("#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n");
- }
- printer->Print(
- // With static initializers.
- "// Force AddDescriptors() to be called at static initialization time.\n"
- "struct StaticDescriptorInitializer {\n"
- " StaticDescriptorInitializer() {\n"
- " AddDescriptors();\n"
- " }\n"
- "} static_descriptor_initializer;\n");
- if (!StaticInitializersForced(file_, options_)) {
- printer->Print("#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n");
+ if (StaticInitializersForced(file_, options_)) {
+ printer->Print(
+ "// Force AddDescriptors() to be called at dynamic initialization "
+ "time.\n"
+ "struct StaticDescriptorInitializer {\n"
+ " StaticDescriptorInitializer() {\n"
+ " AddDescriptors();\n"
+ " }\n"
+ "} static_descriptor_initializer;\n");
}
}
diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc
index 1ab87638..33231ae3 100644
--- a/src/google/protobuf/compiler/cpp/cpp_message.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_message.cc
@@ -2411,11 +2411,7 @@ GenerateStructors(io::Printer* printer) {
printer->Print(
"$classname$::$classname$(::google::protobuf::Arena* arena)\n"
" : $initializer$ {\n"
- // When arenas are used it's safe to assume we have finished
- // static init time (protos with arenas are unsafe during static init)
- "#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n"
" $file_namespace$::InitDefaults();\n"
- "#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n"
" SharedCtor();\n"
" RegisterArenaDtor(arena);\n"
" // @@protoc_insertion_point(arena_constructor:$full_name$)\n"
@@ -3717,6 +3713,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) {
"classname", classname_);
printer->Indent();
+ printer->Print("(void)deterministic; // Unused\n");
printer->Print(
"// @@protoc_insertion_point(serialize_to_array_start:$full_name$)\n",
"full_name", descriptor_->full_name());
diff --git a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
index 83bc096f..e45f35b3 100644
--- a/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
@@ -382,7 +382,7 @@ GenerateSerializeWithCachedSizes(io::Printer* printer) const {
"$number$, "
"::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, "
"output);\n"
- " output->WriteVarint32(static_cast<::google::protobuf::uint32>(\n"
+ " output->WriteVarint32(static_cast< ::google::protobuf::uint32>(\n"
" _$name$_cached_byte_size_));\n");
if (FixedSize(descriptor_->type()) > 0) {
@@ -423,7 +423,7 @@ GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const {
" ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,\n"
" target);\n"
" target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(\n"
- " static_cast<::google::protobuf::uint32>(\n"
+ " static_cast< ::google::protobuf::uint32>(\n"
" _$name$_cached_byte_size_), target);\n"
" target = ::google::protobuf::internal::WireFormatLite::\n"
" Write$declared_type$NoTagToArray(this->$name$_, target);\n"
@@ -455,7 +455,7 @@ GenerateByteSize(io::Printer* printer) const {
"if (data_size > 0) {\n"
" total_size += $tag_size$ +\n"
" ::google::protobuf::internal::WireFormatLite::Int32Size(\n"
- " static_cast<google::protobuf::int32>(data_size));\n"
+ " static_cast< ::google::protobuf::int32>(data_size));\n"
"}\n"
"int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);\n"
"GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();\n"
diff --git a/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc b/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc
index 4e44b578..5c54270e 100644
--- a/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc
@@ -134,6 +134,14 @@ class GenerateAndTest {
};
TEST(CsharpBootstrapTest, GeneratedCsharpDescriptorMatches) {
+ // Skip this whole test if the csharp directory doesn't exist (i.e., a C++11
+ // only distribution).
+ string descriptor_file_name =
+ "../csharp/src/Google.Protobuf/Reflection/Descriptor.cs";
+ if (!File::Exists(TestSourceDir() + "/" + descriptor_file_name)) {
+ return;
+ }
+
MockErrorCollector error_collector;
DiskSourceTree source_tree;
Importer importer(&source_tree, &error_collector);
diff --git a/src/google/protobuf/compiler/csharp/csharp_field_base.cc b/src/google/protobuf/compiler/csharp/csharp_field_base.cc
index ebb8fbc2..ecf29ece 100644
--- a/src/google/protobuf/compiler/csharp/csharp_field_base.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_field_base.cc
@@ -54,7 +54,7 @@ namespace compiler {
namespace csharp {
void FieldGeneratorBase::SetCommonFieldVariables(
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
// Note: this will be valid even though the tag emitted for packed and unpacked versions of
// repeated fields varies by wire format. The wire format is encoded in the bottom 3 bits, which
// never effects the tag size.
@@ -92,7 +92,7 @@ void FieldGeneratorBase::SetCommonFieldVariables(
}
void FieldGeneratorBase::SetCommonOneofFieldVariables(
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
(*variables)["oneof_name"] = oneof_name();
(*variables)["has_property_check"] =
oneof_name() + "Case_ == " + oneof_property_name() +
diff --git a/src/google/protobuf/compiler/csharp/csharp_field_base.h b/src/google/protobuf/compiler/csharp/csharp_field_base.h
index 4109f3ca..df26853b 100644
--- a/src/google/protobuf/compiler/csharp/csharp_field_base.h
+++ b/src/google/protobuf/compiler/csharp/csharp_field_base.h
@@ -66,14 +66,14 @@ class FieldGeneratorBase : public SourceGeneratorBase {
protected:
const FieldDescriptor* descriptor_;
const int fieldOrdinal_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
void AddDeprecatedFlag(io::Printer* printer);
void AddNullCheck(io::Printer* printer);
void AddNullCheck(io::Printer* printer, const std::string& name);
void AddPublicMemberAttributes(io::Printer* printer);
- void SetCommonOneofFieldVariables(map<string, string>* variables);
+ void SetCommonOneofFieldVariables(std::map<string, string>* variables);
std::string oneof_property_name();
std::string oneof_name();
@@ -89,7 +89,7 @@ class FieldGeneratorBase : public SourceGeneratorBase {
std::string capitalized_type_name();
private:
- void SetCommonFieldVariables(map<string, string>* variables);
+ void SetCommonFieldVariables(std::map<string, string>* variables);
std::string GetStringDefaultValueInternal();
std::string GetBytesDefaultValueInternal();
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc
index 0f00a438..5ef0e4e8 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_message.cc
@@ -105,7 +105,7 @@ void MessageGenerator::AddDeprecatedFlag(io::Printer* printer) {
}
void MessageGenerator::Generate(io::Printer* printer) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars["class_name"] = class_name();
vars["access_level"] = class_access_level();
@@ -280,7 +280,7 @@ bool MessageGenerator::HasNestedGeneratedTypes()
}
void MessageGenerator::GenerateCloningCode(io::Printer* printer) {
- map<string, string> vars;
+ std::map<string, string> vars;
WriteGeneratedCodeAttributes(printer);
vars["class_name"] = class_name();
printer->Print(
@@ -333,7 +333,7 @@ void MessageGenerator::GenerateFreezingCode(io::Printer* printer) {
}
void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars["class_name"] = class_name();
// Equality
@@ -432,7 +432,7 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
// Note: These are separate from GenerateMessageSerializationMethods()
// because they need to be generated even for messages that are optimized
// for code size.
- map<string, string> vars;
+ std::map<string, string> vars;
vars["class_name"] = class_name();
WriteGeneratedCodeAttributes(printer);
diff --git a/src/google/protobuf/compiler/importer.cc b/src/google/protobuf/compiler/importer.cc
index 844edc1c..71e3c6de 100644
--- a/src/google/protobuf/compiler/importer.cc
+++ b/src/google/protobuf/compiler/importer.cc
@@ -33,7 +33,7 @@
// Sanjay Ghemawat, Jeff Dean, and others.
#ifdef _MSC_VER
-#include <io.h>
+#include <direct.h>
#else
#include <unistd.h>
#endif
@@ -53,19 +53,21 @@
#include <google/protobuf/compiler/parser.h>
#include <google/protobuf/io/tokenizer.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
+#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/strutil.h>
-namespace google {
-namespace protobuf {
-namespace compiler {
-
#ifdef _WIN32
-#ifndef F_OK
-#define F_OK 00 // not defined by MSVC for whatever reason
-#endif
#include <ctype.h>
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::access;
+using google::protobuf::internal::win32::open;
#endif
+namespace google {
+namespace protobuf {
+namespace compiler {
+
// Returns true if the text looks like a Windows-style absolute path, starting
// with a drive letter. Example: "C:\foo". TODO(kenton): Share this with
// copy in command_line_interface.cc?
diff --git a/src/google/protobuf/compiler/java/java_message_builder.cc b/src/google/protobuf/compiler/java/java_message_builder.cc
index f5643abc..56017171 100644
--- a/src/google/protobuf/compiler/java/java_message_builder.cc
+++ b/src/google/protobuf/compiler/java/java_message_builder.cc
@@ -472,7 +472,7 @@ GenerateCommonBuilderMethods(io::Printer* printer) {
"}\n"
"public Builder setField(\n"
" com.google.protobuf.Descriptors.FieldDescriptor field,\n"
- " Object value) {\n"
+ " java.lang.Object value) {\n"
" return (Builder) super.setField(field, value);\n"
"}\n"
"public Builder clearField(\n"
@@ -485,12 +485,12 @@ GenerateCommonBuilderMethods(io::Printer* printer) {
"}\n"
"public Builder setRepeatedField(\n"
" com.google.protobuf.Descriptors.FieldDescriptor field,\n"
- " int index, Object value) {\n"
+ " int index, java.lang.Object value) {\n"
" return (Builder) super.setRepeatedField(field, index, value);\n"
"}\n"
"public Builder addRepeatedField(\n"
" com.google.protobuf.Descriptors.FieldDescriptor field,\n"
- " Object value) {\n"
+ " java.lang.Object value) {\n"
" return (Builder) super.addRepeatedField(field, value);\n"
"}\n");
diff --git a/src/google/protobuf/compiler/java/java_message_lite.cc b/src/google/protobuf/compiler/java/java_message_lite.cc
index 5007ecee..aad10bb1 100644
--- a/src/google/protobuf/compiler/java/java_message_lite.cc
+++ b/src/google/protobuf/compiler/java/java_message_lite.cc
@@ -346,9 +346,9 @@ void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) {
printer->Print(
"@java.lang.SuppressWarnings({\"unchecked\", \"fallthrough\"})\n"
- "protected final Object dynamicMethod(\n"
+ "protected final java.lang.Object dynamicMethod(\n"
" com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,\n"
- " Object arg0, Object arg1) {\n"
+ " java.lang.Object arg0, java.lang.Object arg1) {\n"
" switch (method) {\n"
" case NEW_MUTABLE_INSTANCE: {\n"
" return new $classname$();\n"
diff --git a/src/google/protobuf/compiler/javanano/javanano_enum_field.cc b/src/google/protobuf/compiler/javanano/javanano_enum_field.cc
index 7666db38..26bc7f85 100644
--- a/src/google/protobuf/compiler/javanano/javanano_enum_field.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_enum_field.cc
@@ -52,7 +52,7 @@ namespace {
// TODO(kenton): Factor out a "SetCommonFieldVariables()" to get rid of
// repeat code between this and the other field types.
void SetEnumVariables(const Params& params,
- const FieldDescriptor* descriptor, map<string, string>* variables) {
+ const FieldDescriptor* descriptor, std::map<string, string>* variables) {
(*variables)["name"] =
RenameJavaKeywords(UnderscoresToCamelCase(descriptor));
(*variables)["capitalized_name"] =
diff --git a/src/google/protobuf/compiler/javanano/javanano_enum_field.h b/src/google/protobuf/compiler/javanano/javanano_enum_field.h
index b94790d6..1be25d10 100644
--- a/src/google/protobuf/compiler/javanano/javanano_enum_field.h
+++ b/src/google/protobuf/compiler/javanano/javanano_enum_field.h
@@ -62,7 +62,7 @@ class EnumFieldGenerator : public FieldGenerator {
private:
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
vector<string> canonical_values_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator);
@@ -85,7 +85,7 @@ class AccessorEnumFieldGenerator : public FieldGenerator {
private:
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
vector<string> canonical_values_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AccessorEnumFieldGenerator);
@@ -112,7 +112,7 @@ class RepeatedEnumFieldGenerator : public FieldGenerator {
void GenerateRepeatedDataSizeCode(io::Printer* printer) const;
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
vector<string> canonical_values_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedEnumFieldGenerator);
diff --git a/src/google/protobuf/compiler/javanano/javanano_extension.cc b/src/google/protobuf/compiler/javanano/javanano_extension.cc
index 0b9d1d8d..4c61f915 100644
--- a/src/google/protobuf/compiler/javanano/javanano_extension.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_extension.cc
@@ -78,7 +78,7 @@ const char* GetTypeConstantName(const FieldDescriptor::Type type) {
} // namespace
void SetVariables(const FieldDescriptor* descriptor, const Params params,
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
(*variables)["extends"] = ClassName(params, descriptor->containing_type());
(*variables)["name"] = RenameJavaKeywords(UnderscoresToCamelCase(descriptor));
bool repeated = descriptor->is_repeated();
diff --git a/src/google/protobuf/compiler/javanano/javanano_extension.h b/src/google/protobuf/compiler/javanano/javanano_extension.h
index 4843e296..f4e9eb2d 100644
--- a/src/google/protobuf/compiler/javanano/javanano_extension.h
+++ b/src/google/protobuf/compiler/javanano/javanano_extension.h
@@ -61,7 +61,7 @@ class ExtensionGenerator {
private:
const Params& params_;
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator);
};
diff --git a/src/google/protobuf/compiler/javanano/javanano_field.cc b/src/google/protobuf/compiler/javanano/javanano_field.cc
index 85257f3f..e31d1177 100644
--- a/src/google/protobuf/compiler/javanano/javanano_field.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_field.cc
@@ -151,7 +151,7 @@ const FieldGenerator& FieldGeneratorMap::get(
}
void SetCommonOneofVariables(const FieldDescriptor* descriptor,
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
(*variables)["oneof_name"] =
UnderscoresToCamelCase(descriptor->containing_oneof());
(*variables)["oneof_capitalized_name"] =
@@ -169,7 +169,7 @@ void SetCommonOneofVariables(const FieldDescriptor* descriptor,
}
void GenerateOneofFieldEquals(const FieldDescriptor* descriptor,
- const map<string, string>& variables,
+ const std::map<string, string>& variables,
io::Printer* printer) {
if (GetJavaType(descriptor) == JAVATYPE_BYTES) {
printer->Print(variables,
@@ -190,7 +190,7 @@ void GenerateOneofFieldEquals(const FieldDescriptor* descriptor,
}
void GenerateOneofFieldHashCode(const FieldDescriptor* descriptor,
- const map<string, string>& variables,
+ const std::map<string, string>& variables,
io::Printer* printer) {
if (GetJavaType(descriptor) == JAVATYPE_BYTES) {
printer->Print(variables,
diff --git a/src/google/protobuf/compiler/javanano/javanano_field.h b/src/google/protobuf/compiler/javanano/javanano_field.h
index 57c221f4..347c888c 100644
--- a/src/google/protobuf/compiler/javanano/javanano_field.h
+++ b/src/google/protobuf/compiler/javanano/javanano_field.h
@@ -114,12 +114,12 @@ class FieldGeneratorMap {
};
void SetCommonOneofVariables(const FieldDescriptor* descriptor,
- map<string, string>* variables);
+ std::map<string, string>* variables);
void GenerateOneofFieldEquals(const FieldDescriptor* descriptor,
- const map<string, string>& variables,
+ const std::map<string, string>& variables,
io::Printer* printer);
void GenerateOneofFieldHashCode(const FieldDescriptor* descriptor,
- const map<string, string>& variables,
+ const std::map<string, string>& variables,
io::Printer* printer);
} // namespace javanano
diff --git a/src/google/protobuf/compiler/javanano/javanano_helpers.cc b/src/google/protobuf/compiler/javanano/javanano_helpers.cc
index 5018250c..1927ba12 100644
--- a/src/google/protobuf/compiler/javanano/javanano_helpers.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_helpers.cc
@@ -567,7 +567,7 @@ string GenerateDifferentBit(int bit_index) {
}
void SetBitOperationVariables(const string name,
- int bitIndex, map<string, string>* variables) {
+ int bitIndex, std::map<string, string>* variables) {
(*variables)["get_" + name] = GenerateGetBit(bitIndex);
(*variables)["set_" + name] = GenerateSetBit(bitIndex);
(*variables)["clear_" + name] = GenerateClearBit(bitIndex);
diff --git a/src/google/protobuf/compiler/javanano/javanano_helpers.h b/src/google/protobuf/compiler/javanano/javanano_helpers.h
index 014c85ae..04b2d633 100644
--- a/src/google/protobuf/compiler/javanano/javanano_helpers.h
+++ b/src/google/protobuf/compiler/javanano/javanano_helpers.h
@@ -181,7 +181,7 @@ string GenerateDifferentBit(int bit_index);
// the given name of the bit, to the appropriate Java expressions for the given
// bit index.
void SetBitOperationVariables(const string name,
- int bitIndex, map<string, string>* variables);
+ int bitIndex, std::map<string, string>* variables);
inline bool IsMapEntry(const Descriptor* descriptor) {
// TODO(liujisi): Add an option to turn on maps for proto2 syntax as well.
diff --git a/src/google/protobuf/compiler/javanano/javanano_map_field.cc b/src/google/protobuf/compiler/javanano/javanano_map_field.cc
index 83b2b0ce..a4ab8858 100644
--- a/src/google/protobuf/compiler/javanano/javanano_map_field.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_map_field.cc
@@ -84,7 +84,7 @@ const FieldDescriptor* ValueField(const FieldDescriptor* descriptor) {
}
void SetMapVariables(const Params& params,
- const FieldDescriptor* descriptor, map<string, string>* variables) {
+ const FieldDescriptor* descriptor, std::map<string, string>* variables) {
const FieldDescriptor* key = KeyField(descriptor);
const FieldDescriptor* value = ValueField(descriptor);
(*variables)["name"] =
diff --git a/src/google/protobuf/compiler/javanano/javanano_map_field.h b/src/google/protobuf/compiler/javanano/javanano_map_field.h
index c01bde38..81e5915d 100644
--- a/src/google/protobuf/compiler/javanano/javanano_map_field.h
+++ b/src/google/protobuf/compiler/javanano/javanano_map_field.h
@@ -58,7 +58,7 @@ class MapFieldGenerator : public FieldGenerator {
private:
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapFieldGenerator);
};
diff --git a/src/google/protobuf/compiler/javanano/javanano_message.cc b/src/google/protobuf/compiler/javanano/javanano_message.cc
index f81f7f9a..78421887 100644
--- a/src/google/protobuf/compiler/javanano/javanano_message.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_message.cc
@@ -182,7 +182,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
}
// oneof
- map<string, string> vars;
+ std::map<string, string> vars;
vars["message_name"] = descriptor_->name();
for (int i = 0; i < descriptor_->oneof_decl_count(); i++) {
const OneofDescriptor* oneof_desc = descriptor_->oneof_decl(i);
diff --git a/src/google/protobuf/compiler/javanano/javanano_message_field.cc b/src/google/protobuf/compiler/javanano/javanano_message_field.cc
index d1d04b52..2ed8a3aa 100644
--- a/src/google/protobuf/compiler/javanano/javanano_message_field.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_message_field.cc
@@ -54,7 +54,7 @@ namespace {
// TODO(kenton): Factor out a "SetCommonFieldVariables()" to get rid of
// repeat code between this and the other field types.
void SetMessageVariables(const Params& params,
- const FieldDescriptor* descriptor, map<string, string>* variables) {
+ const FieldDescriptor* descriptor, std::map<string, string>* variables) {
(*variables)["name"] =
RenameJavaKeywords(UnderscoresToCamelCase(descriptor));
(*variables)["capitalized_name"] =
diff --git a/src/google/protobuf/compiler/javanano/javanano_message_field.h b/src/google/protobuf/compiler/javanano/javanano_message_field.h
index e074735c..0ae8879b 100644
--- a/src/google/protobuf/compiler/javanano/javanano_message_field.h
+++ b/src/google/protobuf/compiler/javanano/javanano_message_field.h
@@ -62,7 +62,7 @@ class MessageFieldGenerator : public FieldGenerator {
private:
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator);
};
@@ -85,7 +85,7 @@ class MessageOneofFieldGenerator : public FieldGenerator {
private:
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageOneofFieldGenerator);
};
@@ -108,7 +108,7 @@ class RepeatedMessageFieldGenerator : public FieldGenerator {
private:
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator);
};
diff --git a/src/google/protobuf/compiler/javanano/javanano_params.h b/src/google/protobuf/compiler/javanano/javanano_params.h
index e3b4bb93..3594767d 100644
--- a/src/google/protobuf/compiler/javanano/javanano_params.h
+++ b/src/google/protobuf/compiler/javanano/javanano_params.h
@@ -47,8 +47,8 @@ enum eMultipleFiles { JAVANANO_MUL_UNSET, JAVANANO_MUL_FALSE, JAVANANO_MUL_TRUE
// Parameters for used by the generators
class Params {
public:
- typedef map<string, string> NameMap;
- typedef set<string> NameSet;
+ typedef std::map<string, string> NameMap;
+ typedef std::set<string> NameSet;
private:
string empty_;
string base_name_;
diff --git a/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc b/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc
index 978abf2c..66a0ff05 100644
--- a/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc
@@ -166,7 +166,7 @@ bool AllAscii(const string& text) {
void SetPrimitiveVariables(const FieldDescriptor* descriptor, const Params params,
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
(*variables)["name"] =
RenameJavaKeywords(UnderscoresToCamelCase(descriptor));
(*variables)["capitalized_name"] =
diff --git a/src/google/protobuf/compiler/javanano/javanano_primitive_field.h b/src/google/protobuf/compiler/javanano/javanano_primitive_field.h
index a01981dd..d7d72d57 100644
--- a/src/google/protobuf/compiler/javanano/javanano_primitive_field.h
+++ b/src/google/protobuf/compiler/javanano/javanano_primitive_field.h
@@ -65,7 +65,7 @@ class PrimitiveFieldGenerator : public FieldGenerator {
void GenerateSerializationConditional(io::Printer* printer) const;
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveFieldGenerator);
};
@@ -89,7 +89,7 @@ class AccessorPrimitiveFieldGenerator : public FieldGenerator {
private:
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AccessorPrimitiveFieldGenerator);
};
@@ -111,7 +111,7 @@ class PrimitiveOneofFieldGenerator : public FieldGenerator {
private:
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveOneofFieldGenerator);
};
@@ -137,7 +137,7 @@ class RepeatedPrimitiveFieldGenerator : public FieldGenerator {
void GenerateRepeatedDataSizeCode(io::Printer* printer) const;
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPrimitiveFieldGenerator);
};
diff --git a/src/google/protobuf/compiler/js/js_generator.cc b/src/google/protobuf/compiler/js/js_generator.cc
index 7c63e58f..2d86d1c8 100755
--- a/src/google/protobuf/compiler/js/js_generator.cc
+++ b/src/google/protobuf/compiler/js/js_generator.cc
@@ -193,6 +193,7 @@ string ModuleAlias(const string& filename) {
string basename = StripProto(filename);
StripString(&basename, "-", '$');
StripString(&basename, "/", '_');
+ StripString(&basename, ".", '_');
return basename + "_pb";
}
diff --git a/src/google/protobuf/compiler/mock_code_generator.cc b/src/google/protobuf/compiler/mock_code_generator.cc
index 0ddb99e5..8b7a6146 100644
--- a/src/google/protobuf/compiler/mock_code_generator.cc
+++ b/src/google/protobuf/compiler/mock_code_generator.cc
@@ -55,6 +55,13 @@
#include <google/protobuf/stubs/substitute.h>
#include <gtest/gtest.h>
+#ifdef major
+#undef major
+#endif
+#ifdef minor
+#undef minor
+#endif
+
namespace google {
namespace protobuf {
namespace compiler {
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
index 7a774a09..8899a13a 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
@@ -46,7 +46,7 @@ namespace objectivec {
namespace {
void SetEnumVariables(const FieldDescriptor* descriptor,
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
string type = EnumName(descriptor->enum_type());
(*variables)["storage_type"] = type;
// For non repeated fields, if it was defined in a different file, the
@@ -118,7 +118,7 @@ void EnumFieldGenerator::GenerateCFunctionImplementations(
}
void EnumFieldGenerator::DetermineForwardDeclarations(
- set<string>* fwd_decls) const {
+ std::set<string>* fwd_decls) const {
SingleFieldGenerator::DetermineForwardDeclarations(fwd_decls);
// If it is an enum defined in a different file, then we'll need a forward
// declaration for it. When it is in our file, all the enums are output
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h b/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h
index 946faa81..ae56c069 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h
+++ b/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h
@@ -47,7 +47,7 @@ class EnumFieldGenerator : public SingleFieldGenerator {
public:
virtual void GenerateCFunctionDeclarations(io::Printer* printer) const;
virtual void GenerateCFunctionImplementations(io::Printer* printer) const;
- virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+ virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
protected:
EnumFieldGenerator(const FieldDescriptor* descriptor, const Options& options);
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_extension.cc b/src/google/protobuf/compiler/objectivec/objectivec_extension.cc
index 73e4b86e..b788d0a3 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_extension.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_extension.cc
@@ -59,7 +59,7 @@ ExtensionGenerator::ExtensionGenerator(const string& root_class_name,
ExtensionGenerator::~ExtensionGenerator() {}
void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars["method_name"] = method_name_;
SourceLocation location;
if (descriptor_->GetSourceLocation(&location)) {
@@ -77,7 +77,7 @@ void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) {
void ExtensionGenerator::GenerateStaticVariablesInitialization(
io::Printer* printer) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars["root_class_and_method_name"] = root_class_and_method_name_;
vars["extended_type"] = ClassName(descriptor_->containing_type());
vars["number"] = SimpleItoa(descriptor_->number());
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_field.cc
index 9f7e84f2..b6123fad 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_field.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_field.cc
@@ -49,7 +49,7 @@ namespace objectivec {
namespace {
void SetCommonFieldVariables(const FieldDescriptor* descriptor,
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
string camel_case_name = FieldName(descriptor);
string raw_field_name;
if (descriptor->type() == FieldDescriptor::TYPE_GROUP) {
@@ -178,7 +178,7 @@ void FieldGenerator::GenerateCFunctionImplementations(
}
void FieldGenerator::DetermineForwardDeclarations(
- set<string>* fwd_decls) const {
+ std::set<string>* fwd_decls) const {
// Nothing
}
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_field.h b/src/google/protobuf/compiler/objectivec/objectivec_field.h
index a3a4b1b6..6bd5db2e 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_field.h
+++ b/src/google/protobuf/compiler/objectivec/objectivec_field.h
@@ -67,7 +67,7 @@ class FieldGenerator {
virtual void GenerateCFunctionImplementations(io::Printer* printer) const;
// Exposed for subclasses, should always call it on the parent class also.
- virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+ virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
// Used during generation, not intended to be extended by subclasses.
void GenerateFieldDescription(
@@ -100,7 +100,7 @@ class FieldGenerator {
virtual bool WantsHasProperty(void) const = 0;
const FieldDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGenerator);
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_file.cc b/src/google/protobuf/compiler/objectivec/objectivec_file.cc
index 7ad127bb..954b2688 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_file.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_file.cc
@@ -89,7 +89,7 @@ bool FileContainsExtensions(const FileDescriptor* file) {
void PruneFileAndDepsMarkingAsVisited(
const FileDescriptor* file,
vector<const FileDescriptor*>* files,
- set<const FileDescriptor*>* files_visited) {
+ std::set<const FileDescriptor*>* files_visited) {
vector<const FileDescriptor*>::iterator iter =
std::find(files->begin(), files->end(), file);
if (iter != files->end()) {
@@ -105,7 +105,7 @@ void PruneFileAndDepsMarkingAsVisited(
void CollectMinimalFileDepsContainingExtensionsWorker(
const FileDescriptor* file,
vector<const FileDescriptor*>* files,
- set<const FileDescriptor*>* files_visited) {
+ std::set<const FileDescriptor*>* files_visited) {
if (files_visited->find(file) != files_visited->end()) {
return;
}
@@ -138,7 +138,7 @@ void CollectMinimalFileDepsContainingExtensionsWorker(
void CollectMinimalFileDepsContainingExtensions(
const FileDescriptor* file,
vector<const FileDescriptor*>* files) {
- set<const FileDescriptor*> files_visited;
+ std::set<const FileDescriptor*> files_visited;
for (int i = 0; i < file->dependency_count(); i++) {
const FileDescriptor* dep = file->dependency(i);
CollectMinimalFileDepsContainingExtensionsWorker(dep, files,
@@ -229,12 +229,12 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
"CF_EXTERN_C_BEGIN\n"
"\n");
- set<string> fwd_decls;
+ std::set<string> fwd_decls;
for (vector<MessageGenerator *>::iterator iter = message_generators_.begin();
iter != message_generators_.end(); ++iter) {
(*iter)->DetermineForwardDeclarations(&fwd_decls);
}
- for (set<string>::const_iterator i(fwd_decls.begin());
+ for (std::set<string>::const_iterator i(fwd_decls.begin());
i != fwd_decls.end(); ++i) {
printer->Print("$value$;\n", "value", *i);
}
@@ -325,7 +325,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
// #import the headers for anything that a plain dependency of this proto
// file (that means they were just an include, not a "public" include).
- set<string> public_import_names;
+ std::set<string> public_import_names;
for (int i = 0; i < file_->public_dependency_count(); i++) {
public_import_names.insert(file_->public_dependency(i)->name());
}
@@ -468,7 +468,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
// File descriptor only needed if there are messages to use it.
if (message_generators_.size() > 0) {
- map<string, string> vars;
+ std::map<string, string> vars;
vars["root_class_name"] = root_class_name_;
vars["package"] = file_->package();
vars["objc_prefix"] = FileClassPrefix(file_);
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
index bb8170a9..72b5d5f5 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
@@ -28,9 +28,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifdef _MSC_VER
-#include <io.h>
-#else
+#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <climits>
@@ -49,8 +47,15 @@
#include <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/strutil.h>
+#if defined(_WIN32)
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::open;
+#endif
+
// NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some
// error cases, so it seems to be ok to use as a back door for errors.
@@ -980,13 +985,13 @@ namespace {
class ExpectedPrefixesCollector : public LineConsumer {
public:
- ExpectedPrefixesCollector(map<string, string>* inout_package_to_prefix_map)
+ ExpectedPrefixesCollector(std::map<string, string>* inout_package_to_prefix_map)
: prefix_map_(inout_package_to_prefix_map) {}
virtual bool ConsumeLine(const StringPiece& line, string* out_error);
private:
- map<string, string>* prefix_map_;
+ std::map<string, string>* prefix_map_;
};
bool ExpectedPrefixesCollector::ConsumeLine(
@@ -1009,7 +1014,7 @@ bool ExpectedPrefixesCollector::ConsumeLine(
}
bool LoadExpectedPackagePrefixes(const Options &generation_options,
- map<string, string>* prefix_map,
+ std::map<string, string>* prefix_map,
string* out_error) {
if (generation_options.expected_prefixes_path.empty()) {
return true;
@@ -1023,7 +1028,7 @@ bool LoadExpectedPackagePrefixes(const Options &generation_options,
bool ValidateObjCClassPrefix(
const FileDescriptor* file,
const string& expected_prefixes_path,
- const map<string, string>& expected_package_prefixes,
+ const std::map<string, string>& expected_package_prefixes,
string* out_error) {
const string prefix = file->options().objc_class_prefix();
const string package = file->package();
@@ -1033,7 +1038,7 @@ bool ValidateObjCClassPrefix(
// Check: Error - See if there was an expected prefix for the package and
// report if it doesn't match (wrong or missing).
- map<string, string>::const_iterator package_match =
+ std::map<string, string>::const_iterator package_match =
expected_package_prefixes.find(package);
if (package_match != expected_package_prefixes.end()) {
// There was an entry, and...
@@ -1082,7 +1087,7 @@ bool ValidateObjCClassPrefix(
// Look for any other package that uses the same prefix.
string other_package_for_prefix;
- for (map<string, string>::const_iterator i = expected_package_prefixes.begin();
+ for (std::map<string, string>::const_iterator i = expected_package_prefixes.begin();
i != expected_package_prefixes.end(); ++i) {
if (i->second == prefix) {
other_package_for_prefix = i->first;
@@ -1150,7 +1155,7 @@ bool ValidateObjCClassPrefixes(const vector<const FileDescriptor*>& files,
const Options& generation_options,
string* out_error) {
// Load the expected package prefixes, if available, to validate against.
- map<string, string> expected_package_prefixes;
+ std::map<string, string> expected_package_prefixes;
if (!LoadExpectedPackagePrefixes(generation_options,
&expected_package_prefixes,
out_error)) {
@@ -1519,7 +1524,7 @@ void ImportWriter::AddFile(const FileDescriptor* file,
ParseFrameworkMappings();
}
- map<string, string>::iterator proto_lookup =
+ std::map<string, string>::iterator proto_lookup =
proto_file_to_framework_name_.find(file->name());
if (proto_lookup != proto_file_to_framework_name_.end()) {
other_framework_imports_.push_back(
@@ -1640,7 +1645,7 @@ bool ImportWriter::ProtoFrameworkCollector::ConsumeLine(
StringPiece proto_file(proto_file_list, start, offset - start);
StringPieceTrimWhitespace(&proto_file);
if (proto_file.size() != 0) {
- map<string, string>::iterator existing_entry =
+ std::map<string, string>::iterator existing_entry =
map_->find(proto_file.ToString());
if (existing_entry != map_->end()) {
std::cerr << "warning: duplicate proto file reference, replacing framework entry for '"
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.h b/src/google/protobuf/compiler/objectivec/objectivec_helpers.h
index c99262a1..daea7609 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_helpers.h
+++ b/src/google/protobuf/compiler/objectivec/objectivec_helpers.h
@@ -262,20 +262,20 @@ class LIBPROTOC_EXPORT ImportWriter {
private:
class ProtoFrameworkCollector : public LineConsumer {
public:
- ProtoFrameworkCollector(map<string, string>* inout_proto_file_to_framework_name)
+ ProtoFrameworkCollector(std::map<string, string>* inout_proto_file_to_framework_name)
: map_(inout_proto_file_to_framework_name) {}
virtual bool ConsumeLine(const StringPiece& line, string* out_error);
private:
- map<string, string>* map_;
+ std::map<string, string>* map_;
};
void ParseFrameworkMappings();
const string generate_for_named_framework_;
const string named_framework_to_proto_path_mappings_path_;
- map<string, string> proto_file_to_framework_name_;
+ std::map<string, string> proto_file_to_framework_name_;
bool need_to_parse_mapping_file_;
vector<string> protobuf_framework_imports_;
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc
index 0bc9dc10..bcaf5709 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc
@@ -162,7 +162,7 @@ void MapFieldGenerator::FinishInitialization(void) {
}
void MapFieldGenerator::DetermineForwardDeclarations(
- set<string>* fwd_decls) const {
+ std::set<string>* fwd_decls) const {
RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls);
const FieldDescriptor* value_descriptor =
descriptor_->message_type()->FindFieldByName("value");
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_map_field.h b/src/google/protobuf/compiler/objectivec/objectivec_map_field.h
index bc68a682..6664d849 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_map_field.h
+++ b/src/google/protobuf/compiler/objectivec/objectivec_map_field.h
@@ -51,7 +51,7 @@ class MapFieldGenerator : public RepeatedFieldGenerator {
MapFieldGenerator(const FieldDescriptor* descriptor, const Options& options);
virtual ~MapFieldGenerator();
- virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+ virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
private:
scoped_ptr<FieldGenerator> value_field_generator_;
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_message.cc b/src/google/protobuf/compiler/objectivec/objectivec_message.cc
index 0a554a83..4f22e290 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_message.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_message.cc
@@ -233,7 +233,7 @@ void MessageGenerator::GenerateStaticVariablesInitialization(
}
}
-void MessageGenerator::DetermineForwardDeclarations(set<string>* fwd_decls) {
+void MessageGenerator::DetermineForwardDeclarations(std::set<string>* fwd_decls) {
if (!IsMapEntryMessage(descriptor_)) {
for (int i = 0; i < descriptor_->field_count(); i++) {
const FieldDescriptor* fieldDescriptor = descriptor_->field(i);
@@ -514,7 +514,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
" };\n");
}
- map<string, string> vars;
+ std::map<string, string> vars;
vars["classname"] = class_name_;
vars["rootclassname"] = root_classname_;
vars["fields"] = has_fields ? "fields" : "NULL";
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_message.h b/src/google/protobuf/compiler/objectivec/objectivec_message.h
index 0fb78bc0..8f317ac0 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_message.h
+++ b/src/google/protobuf/compiler/objectivec/objectivec_message.h
@@ -64,7 +64,7 @@ class MessageGenerator {
void GenerateMessageHeader(io::Printer* printer);
void GenerateSource(io::Printer* printer);
void GenerateExtensionRegistrationSource(io::Printer* printer);
- void DetermineForwardDeclarations(set<string>* fwd_decls);
+ void DetermineForwardDeclarations(std::set<string>* fwd_decls);
// Checks if the message or a nested message includes a oneof definition.
bool IncludesOneOfDefinition() const;
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc
index d6ccd6d1..699d25b3 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc
@@ -45,7 +45,7 @@ namespace objectivec {
namespace {
void SetMessageVariables(const FieldDescriptor* descriptor,
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
const string& message_type = ClassName(descriptor->message_type());
(*variables)["type"] = message_type;
(*variables)["containing_class"] = ClassName(descriptor->containing_type());
@@ -67,7 +67,7 @@ MessageFieldGenerator::MessageFieldGenerator(const FieldDescriptor* descriptor,
MessageFieldGenerator::~MessageFieldGenerator() {}
void MessageFieldGenerator::DetermineForwardDeclarations(
- set<string>* fwd_decls) const {
+ std::set<string>* fwd_decls) const {
ObjCObjFieldGenerator::DetermineForwardDeclarations(fwd_decls);
// Class name is already in "storage_type".
fwd_decls->insert("@class " + variable("storage_type"));
@@ -95,7 +95,7 @@ RepeatedMessageFieldGenerator::RepeatedMessageFieldGenerator(
RepeatedMessageFieldGenerator::~RepeatedMessageFieldGenerator() {}
void RepeatedMessageFieldGenerator::DetermineForwardDeclarations(
- set<string>* fwd_decls) const {
+ std::set<string>* fwd_decls) const {
RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls);
// Class name is already in "storage_type".
fwd_decls->insert("@class " + variable("storage_type"));
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_message_field.h b/src/google/protobuf/compiler/objectivec/objectivec_message_field.h
index d2dba153..50f4b6d4 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_message_field.h
+++ b/src/google/protobuf/compiler/objectivec/objectivec_message_field.h
@@ -51,7 +51,7 @@ class MessageFieldGenerator : public ObjCObjFieldGenerator {
virtual bool WantsHasProperty(void) const;
public:
- virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+ virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator);
@@ -67,7 +67,7 @@ class RepeatedMessageFieldGenerator : public RepeatedFieldGenerator {
virtual ~RepeatedMessageFieldGenerator();
public:
- virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+ virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator);
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_oneof.h b/src/google/protobuf/compiler/objectivec/objectivec_oneof.h
index 3d9df4db..ff353a6c 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_oneof.h
+++ b/src/google/protobuf/compiler/objectivec/objectivec_oneof.h
@@ -67,7 +67,7 @@ class OneofGenerator {
private:
const OneofDescriptor* descriptor_;
- map<string, string> variables_;
+ std::map<string, string> variables_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(OneofGenerator);
};
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc b/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
index d49350f4..aa8ac324 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
@@ -118,7 +118,7 @@ const char* PrimitiveArrayTypeName(const FieldDescriptor* descriptor) {
}
void SetPrimitiveVariables(const FieldDescriptor* descriptor,
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
std::string primitive_name = PrimitiveTypeName(descriptor);
(*variables)["type"] = primitive_name;
(*variables)["storage_type"] = primitive_name;
diff --git a/src/google/protobuf/compiler/php/php_generator.cc b/src/google/protobuf/compiler/php/php_generator.cc
index 03aebdb9..60e6fce9 100644
--- a/src/google/protobuf/compiler/php/php_generator.cc
+++ b/src/google/protobuf/compiler/php/php_generator.cc
@@ -82,6 +82,10 @@ void GenerateEnumDocComment(io::Printer* printer, const EnumDescriptor* enum_,
int is_descriptor);
void GenerateEnumValueDocComment(io::Printer* printer,
const EnumValueDescriptor* value);
+void GenerateServiceDocComment(io::Printer* printer,
+ const ServiceDescriptor* service);
+void GenerateServiceMethodDocComment(io::Printer* printer,
+ const MethodDescriptor* method);
std::string RenameEmpty(const std::string& name) {
if (name == "Empty") {
@@ -139,17 +143,9 @@ std::string ClassNamePrefix(const string& classname,
return "";
}
-
template <typename DescriptorType>
-std::string FullClassName(const DescriptorType* desc, bool is_descriptor) {
- string classname = desc->name();
- const Descriptor* containing = desc->containing_type();
- while (containing != NULL) {
- classname = containing->name() + '_' + classname;
- containing = containing->containing_type();
- }
- classname = ClassNamePrefix(classname, desc) + classname;
-
+std::string NamespacedName(const string& classname,
+ const DescriptorType* desc, bool is_descriptor) {
if (desc->file()->options().has_php_namespace()) {
const string& php_namespace = desc->file()->options().php_namespace();
if (php_namespace != "") {
@@ -167,6 +163,24 @@ std::string FullClassName(const DescriptorType* desc, bool is_descriptor) {
}
}
+template <typename DescriptorType>
+std::string FullClassName(const DescriptorType* desc, bool is_descriptor) {
+ string classname = desc->name();
+ const Descriptor* containing = desc->containing_type();
+ while (containing != NULL) {
+ classname = containing->name() + '_' + classname;
+ containing = containing->containing_type();
+ }
+ classname = ClassNamePrefix(classname, desc) + classname;
+ return NamespacedName(classname, desc, is_descriptor);
+}
+
+std::string FullClassName(const ServiceDescriptor* desc, bool is_descriptor) {
+ string classname = desc->name();
+ classname = ClassNamePrefix(classname, desc) + classname;
+ return NamespacedName(classname, desc, is_descriptor);
+}
+
std::string PhpName(const std::string& full_name, bool is_descriptor) {
if (is_descriptor) {
return kDescriptorPackageName;
@@ -272,6 +286,17 @@ std::string GeneratedEnumFileName(const EnumDescriptor* en,
return result + ".php";
}
+std::string GeneratedServiceFileName(const ServiceDescriptor* service,
+ bool is_descriptor) {
+ std::string result = FullClassName(service, is_descriptor) + "Interface";
+ for (int i = 0; i < result.size(); i++) {
+ if (result[i] == '\\') {
+ result[i] = '/';
+ }
+ }
+ return result + ".php";
+}
+
std::string IntToString(int32 value) {
std::ostringstream os;
os << value;
@@ -534,12 +559,9 @@ void GenerateFieldAccessor(const FieldDescriptor* field, bool is_descriptor,
// Generate setter.
GenerateFieldDocComment(printer, field, is_descriptor, kFieldSetter);
printer->Print(
- "public function set^camel_name^(^var^)\n"
+ "public function set^camel_name^($var)\n"
"{\n",
- "camel_name", UnderscoresToCamelCase(field->name(), true),
- "var", (field->is_repeated() ||
- field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) ?
- "&$var": "$var");
+ "camel_name", UnderscoresToCamelCase(field->name(), true));
Indent(printer);
@@ -663,6 +685,16 @@ void GenerateEnumToPool(const EnumDescriptor* en, io::Printer* printer) {
Outdent(printer);
}
+void GenerateServiceMethod(const MethodDescriptor* method,
+ io::Printer* printer) {
+ printer->Print(
+ "public function ^camel_name^(\\^request_name^ $request);\n\n",
+ "camel_name", UnderscoresToCamelCase(method->name(), false),
+ "request_name", FullClassName(
+ method->input_type(), false)
+ );
+}
+
void GenerateMessageToPool(const string& name_prefix, const Descriptor* message,
io::Printer* printer) {
// Don't generate MapEntry messages -- we use the PHP extension's native
@@ -844,7 +876,7 @@ void GenerateUseDeclaration(bool is_descriptor, io::Printer* printer) {
"use Google\\Protobuf\\Internal\\GPBType;\n"
"use Google\\Protobuf\\Internal\\GPBWire;\n"
"use Google\\Protobuf\\Internal\\RepeatedField;\n"
- "use Google\\Protobuf\\Internal\\InputStream;\n\n"
+ "use Google\\Protobuf\\Internal\\InputStream;\n"
"use Google\\Protobuf\\Internal\\GPBUtil;\n\n");
}
}
@@ -1064,6 +1096,58 @@ void GenerateMessageFile(const FileDescriptor* file, const Descriptor* message,
}
}
+void GenerateServiceFile(const FileDescriptor* file,
+ const ServiceDescriptor* service, bool is_descriptor,
+ GeneratorContext* generator_context) {
+ std::string filename = GeneratedServiceFileName(service, is_descriptor);
+ scoped_ptr<io::ZeroCopyOutputStream> output(
+ generator_context->Open(filename));
+ io::Printer printer(output.get(), '^');
+
+ GenerateHead(file, &printer);
+
+ std::string fullname = FilenameToClassname(filename);
+ int lastindex = fullname.find_last_of("\\");
+
+ if (file->options().has_php_namespace()) {
+ const string& php_namespace = file->options().php_namespace();
+ if (!php_namespace.empty()) {
+ printer.Print(
+ "namespace ^name^;\n\n",
+ "name", php_namespace);
+ }
+ } else if (!file->package().empty()) {
+ printer.Print(
+ "namespace ^name^;\n\n",
+ "name", fullname.substr(0, lastindex));
+ }
+
+ GenerateServiceDocComment(&printer, service);
+
+ if (lastindex != string::npos) {
+ printer.Print(
+ "interface ^name^\n"
+ "{\n",
+ "name", fullname.substr(lastindex + 1));
+ } else {
+ printer.Print(
+ "interface ^name^\n"
+ "{\n",
+ "name", fullname);
+ }
+
+ Indent(&printer);
+
+ for (int i = 0; i < service->method_count(); i++) {
+ const MethodDescriptor* method = service->method(i);
+ GenerateServiceMethodDocComment(&printer, method);
+ GenerateServiceMethod(method, &printer);
+ }
+
+ Outdent(&printer);
+ printer.Print("}\n\n");
+}
+
void GenerateFile(const FileDescriptor* file, bool is_descriptor,
GeneratorContext* generator_context) {
GenerateMetadataFile(file, is_descriptor, generator_context);
@@ -1075,6 +1159,12 @@ void GenerateFile(const FileDescriptor* file, bool is_descriptor,
GenerateEnumFile(file, file->enum_type(i), is_descriptor,
generator_context);
}
+ if (file->options().php_generic_services()) {
+ for (int i = 0; i < file->service_count(); i++) {
+ GenerateServiceFile(file, file->service(i), is_descriptor,
+ generator_context);
+ }
+ }
}
static string EscapePhpdoc(const string& input) {
@@ -1183,6 +1273,16 @@ void GenerateMessageDocComment(io::Printer* printer,
"messagename", EscapePhpdoc(message->full_name()));
}
+void GenerateServiceDocComment(io::Printer* printer,
+ const ServiceDescriptor* service) {
+ printer->Print("/**\n");
+ GenerateDocCommentBody(printer, service);
+ printer->Print(
+ " * Protobuf type <code>^fullname^</code>\n"
+ " */\n",
+ "fullname", EscapePhpdoc(service->full_name()));
+}
+
void GenerateFieldDocComment(io::Printer* printer, const FieldDescriptor* field,
int is_descriptor, int function_type) {
// In theory we should have slightly different comments for setters, getters,
@@ -1229,6 +1329,23 @@ void GenerateEnumValueDocComment(io::Printer* printer,
"def", EscapePhpdoc(FirstLineOf(value->DebugString())));
}
+void GenerateServiceMethodDocComment(io::Printer* printer,
+ const MethodDescriptor* method) {
+ printer->Print("/**\n");
+ GenerateDocCommentBody(printer, method);
+ printer->Print(
+ " * Method <code>^method_name^</code>\n"
+ " *\n",
+ "method_name", EscapePhpdoc(UnderscoresToCamelCase(method->name(), false)));
+ printer->Print(
+ " * @param \\^input_type^ $request\n",
+ "input_type", EscapePhpdoc(FullClassName(method->input_type(), false)));
+ printer->Print(
+ " * @return \\^return_type^\n"
+ " */\n",
+ "return_type", EscapePhpdoc(FullClassName(method->output_type(), false)));
+}
+
bool Generator::Generate(const FileDescriptor* file, const string& parameter,
GeneratorContext* generator_context,
string* error) const {
diff --git a/src/google/protobuf/compiler/plugin.cc b/src/google/protobuf/compiler/plugin.cc
index 3848101d..e8ffbb51 100644
--- a/src/google/protobuf/compiler/plugin.cc
+++ b/src/google/protobuf/compiler/plugin.cc
@@ -36,18 +36,12 @@
#include <set>
#ifdef _WIN32
-#include <io.h>
#include <fcntl.h>
-#ifndef STDIN_FILENO
-#define STDIN_FILENO 0
-#endif
-#ifndef STDOUT_FILENO
-#define STDOUT_FILENO 1
-#endif
#else
#include <unistd.h>
#endif
+#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/compiler/plugin.pb.h>
@@ -55,6 +49,11 @@
#include <google/protobuf/descriptor.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
+#if defined(_WIN32)
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::setmode;
+#endif
namespace google {
namespace protobuf {
@@ -150,8 +149,8 @@ int PluginMain(int argc, char* argv[], const CodeGenerator* generator) {
}
#ifdef _WIN32
- _setmode(STDIN_FILENO, _O_BINARY);
- _setmode(STDOUT_FILENO, _O_BINARY);
+ setmode(STDIN_FILENO, _O_BINARY);
+ setmode(STDOUT_FILENO, _O_BINARY);
#endif
CodeGeneratorRequest request;
diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc
index 87fcc40f..516a5878 100644
--- a/src/google/protobuf/compiler/plugin.pb.cc
+++ b/src/google/protobuf/compiler/plugin.pb.cc
@@ -169,6 +169,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -196,12 +197,13 @@ void AddDescriptorsImpl() {
::google::protobuf::protobuf_google_2fprotobuf_2fdescriptor_2eproto::AddDescriptors();
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -430,6 +432,7 @@ void Version::SerializeWithCachedSizes(
::google::protobuf::uint8* Version::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.Version)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -967,6 +970,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes(
::google::protobuf::uint8* CodeGeneratorRequest::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorRequest)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1577,6 +1581,7 @@ void CodeGeneratorResponse_File::SerializeWithCachedSizes(
::google::protobuf::uint8* CodeGeneratorResponse_File::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse.File)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -2101,6 +2106,7 @@ void CodeGeneratorResponse::SerializeWithCachedSizes(
::google::protobuf::uint8* CodeGeneratorResponse::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorResponse)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h
index c8ae8774..57e1f77b 100644
--- a/src/google/protobuf/compiler/plugin.pb.h
+++ b/src/google/protobuf/compiler/plugin.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/compiler/profile.pb.cc b/src/google/protobuf/compiler/profile.pb.cc
index 223dcc21..4616b514 100644
--- a/src/google/protobuf/compiler/profile.pb.cc
+++ b/src/google/protobuf/compiler/profile.pb.cc
@@ -143,6 +143,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -162,12 +163,13 @@ void AddDescriptorsImpl() {
"google/protobuf/compiler/profile.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -396,6 +398,7 @@ void FieldAccessInfo::SerializeWithCachedSizes(
::google::protobuf::uint8* FieldAccessInfo::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.FieldAccessInfo)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -892,6 +895,7 @@ void MessageAccessInfo::SerializeWithCachedSizes(
::google::protobuf::uint8* MessageAccessInfo::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.MessageAccessInfo)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1298,6 +1302,7 @@ void AccessInfo::SerializeWithCachedSizes(
::google::protobuf::uint8* AccessInfo::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.AccessInfo)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/compiler/profile.pb.h b/src/google/protobuf/compiler/profile.pb.h
index d20b87ed..b4931cf1 100644
--- a/src/google/protobuf/compiler/profile.pb.h
+++ b/src/google/protobuf/compiler/profile.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc
index 6e4e4088..78935211 100644
--- a/src/google/protobuf/descriptor.pb.cc
+++ b/src/google/protobuf/descriptor.pb.cc
@@ -297,6 +297,7 @@ const ::google::protobuf::uint32 TableStruct::offsets[] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_generic_services_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generic_services_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, py_generic_services_),
+ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, php_generic_services_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, deprecated_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_enable_arenas_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, objc_class_prefix_),
@@ -310,13 +311,14 @@ const ::google::protobuf::uint32 TableStruct::offsets[] = {
8,
9,
10,
- 16,
+ 17,
2,
11,
12,
13,
14,
15,
+ 16,
3,
4,
5,
@@ -488,20 +490,20 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] = {
{ 124, 132, sizeof(EnumValueDescriptorProto)},
{ 135, 143, sizeof(ServiceDescriptorProto)},
{ 146, 157, sizeof(MethodDescriptorProto)},
- { 163, 186, sizeof(FileOptions)},
- { 204, 214, sizeof(MessageOptions)},
- { 219, 231, sizeof(FieldOptions)},
- { 238, 244, sizeof(OneofOptions)},
- { 245, 253, sizeof(EnumOptions)},
- { 256, 263, sizeof(EnumValueOptions)},
- { 265, 272, sizeof(ServiceOptions)},
- { 274, 282, sizeof(MethodOptions)},
- { 285, 292, sizeof(UninterpretedOption_NamePart)},
- { 294, 306, sizeof(UninterpretedOption)},
- { 313, 323, sizeof(SourceCodeInfo_Location)},
- { 328, 334, sizeof(SourceCodeInfo)},
- { 335, 344, sizeof(GeneratedCodeInfo_Annotation)},
- { 348, 354, sizeof(GeneratedCodeInfo)},
+ { 163, 187, sizeof(FileOptions)},
+ { 206, 216, sizeof(MessageOptions)},
+ { 221, 233, sizeof(FieldOptions)},
+ { 240, 246, sizeof(OneofOptions)},
+ { 247, 255, sizeof(EnumOptions)},
+ { 258, 265, sizeof(EnumValueOptions)},
+ { 267, 274, sizeof(ServiceOptions)},
+ { 276, 284, sizeof(MethodOptions)},
+ { 287, 294, sizeof(UninterpretedOption_NamePart)},
+ { 296, 308, sizeof(UninterpretedOption)},
+ { 315, 325, sizeof(SourceCodeInfo_Location)},
+ { 330, 336, sizeof(SourceCodeInfo)},
+ { 337, 346, sizeof(GeneratedCodeInfo_Annotation)},
+ { 350, 356, sizeof(GeneratedCodeInfo)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -661,6 +663,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -729,7 +732,7 @@ void AddDescriptorsImpl() {
"\n\013output_type\030\003 \001(\t\022/\n\007options\030\004 \001(\0132\036.g"
"oogle.protobuf.MethodOptions\022\037\n\020client_s"
"treaming\030\005 \001(\010:\005false\022\037\n\020server_streamin"
- "g\030\006 \001(\010:\005false\"\313\005\n\013FileOptions\022\024\n\014java_p"
+ "g\030\006 \001(\010:\005false\"\360\005\n\013FileOptions\022\024\n\014java_p"
"ackage\030\001 \001(\t\022\034\n\024java_outer_classname\030\010 \001"
"(\t\022\"\n\023java_multiple_files\030\n \001(\010:\005false\022)"
"\n\035java_generate_equals_and_hash\030\024 \001(\010B\002\030"
@@ -739,85 +742,87 @@ void AddDescriptorsImpl() {
"ackage\030\013 \001(\t\022\"\n\023cc_generic_services\030\020 \001("
"\010:\005false\022$\n\025java_generic_services\030\021 \001(\010:"
"\005false\022\"\n\023py_generic_services\030\022 \001(\010:\005fal"
- "se\022\031\n\ndeprecated\030\027 \001(\010:\005false\022\037\n\020cc_enab"
- "le_arenas\030\037 \001(\010:\005false\022\031\n\021objc_class_pre"
- "fix\030$ \001(\t\022\030\n\020csharp_namespace\030% \001(\t\022\024\n\014s"
- "wift_prefix\030\' \001(\t\022\030\n\020php_class_prefix\030( "
- "\001(\t\022\025\n\rphp_namespace\030) \001(\t\022C\n\024uninterpre"
- "ted_option\030\347\007 \003(\0132$.google.protobuf.Unin"
- "terpretedOption\":\n\014OptimizeMode\022\t\n\005SPEED"
- "\020\001\022\r\n\tCODE_SIZE\020\002\022\020\n\014LITE_RUNTIME\020\003*\t\010\350\007"
- "\020\200\200\200\200\002J\004\010&\020\'\"\362\001\n\016MessageOptions\022&\n\027messa"
- "ge_set_wire_format\030\001 \001(\010:\005false\022.\n\037no_st"
- "andard_descriptor_accessor\030\002 \001(\010:\005false\022"
- "\031\n\ndeprecated\030\003 \001(\010:\005false\022\021\n\tmap_entry\030"
- "\007 \001(\010\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.g"
- "oogle.protobuf.UninterpretedOption*\t\010\350\007\020"
- "\200\200\200\200\002J\004\010\010\020\tJ\004\010\t\020\n\"\236\003\n\014FieldOptions\022:\n\005ct"
- "ype\030\001 \001(\0162#.google.protobuf.FieldOptions"
- ".CType:\006STRING\022\016\n\006packed\030\002 \001(\010\022\?\n\006jstype"
- "\030\006 \001(\0162$.google.protobuf.FieldOptions.JS"
- "Type:\tJS_NORMAL\022\023\n\004lazy\030\005 \001(\010:\005false\022\031\n\n"
- "deprecated\030\003 \001(\010:\005false\022\023\n\004weak\030\n \001(\010:\005f"
- "alse\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.go"
- "ogle.protobuf.UninterpretedOption\"/\n\005CTy"
- "pe\022\n\n\006STRING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRING_PIECE"
- "\020\002\"5\n\006JSType\022\r\n\tJS_NORMAL\020\000\022\r\n\tJS_STRING"
- "\020\001\022\r\n\tJS_NUMBER\020\002*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005\"^\n\014On"
- "eofOptions\022C\n\024uninterpreted_option\030\347\007 \003("
- "\0132$.google.protobuf.UninterpretedOption*"
- "\t\010\350\007\020\200\200\200\200\002\"\223\001\n\013EnumOptions\022\023\n\013allow_alia"
- "s\030\002 \001(\010\022\031\n\ndeprecated\030\003 \001(\010:\005false\022C\n\024un"
- "interpreted_option\030\347\007 \003(\0132$.google.proto"
- "buf.UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020\006"
- "\"}\n\020EnumValueOptions\022\031\n\ndeprecated\030\001 \001(\010"
- ":\005false\022C\n\024uninterpreted_option\030\347\007 \003(\0132$"
+ "se\022#\n\024php_generic_services\030\023 \001(\010:\005false\022"
+ "\031\n\ndeprecated\030\027 \001(\010:\005false\022\037\n\020cc_enable_"
+ "arenas\030\037 \001(\010:\005false\022\031\n\021objc_class_prefix"
+ "\030$ \001(\t\022\030\n\020csharp_namespace\030% \001(\t\022\024\n\014swif"
+ "t_prefix\030\' \001(\t\022\030\n\020php_class_prefix\030( \001(\t"
+ "\022\025\n\rphp_namespace\030) \001(\t\022C\n\024uninterpreted"
+ "_option\030\347\007 \003(\0132$.google.protobuf.Uninter"
+ "pretedOption\":\n\014OptimizeMode\022\t\n\005SPEED\020\001\022"
+ "\r\n\tCODE_SIZE\020\002\022\020\n\014LITE_RUNTIME\020\003*\t\010\350\007\020\200\200"
+ "\200\200\002J\004\010&\020\'\"\362\001\n\016MessageOptions\022&\n\027message_"
+ "set_wire_format\030\001 \001(\010:\005false\022.\n\037no_stand"
+ "ard_descriptor_accessor\030\002 \001(\010:\005false\022\031\n\n"
+ "deprecated\030\003 \001(\010:\005false\022\021\n\tmap_entry\030\007 \001"
+ "(\010\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.goog"
+ "le.protobuf.UninterpretedOption*\t\010\350\007\020\200\200\200"
+ "\200\002J\004\010\010\020\tJ\004\010\t\020\n\"\236\003\n\014FieldOptions\022:\n\005ctype"
+ "\030\001 \001(\0162#.google.protobuf.FieldOptions.CT"
+ "ype:\006STRING\022\016\n\006packed\030\002 \001(\010\022\?\n\006jstype\030\006 "
+ "\001(\0162$.google.protobuf.FieldOptions.JSTyp"
+ "e:\tJS_NORMAL\022\023\n\004lazy\030\005 \001(\010:\005false\022\031\n\ndep"
+ "recated\030\003 \001(\010:\005false\022\023\n\004weak\030\n \001(\010:\005fals"
+ "e\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.googl"
+ "e.protobuf.UninterpretedOption\"/\n\005CType\022"
+ "\n\n\006STRING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRING_PIECE\020\002\""
+ "5\n\006JSType\022\r\n\tJS_NORMAL\020\000\022\r\n\tJS_STRING\020\001\022"
+ "\r\n\tJS_NUMBER\020\002*\t\010\350\007\020\200\200\200\200\002J\004\010\004\020\005\"^\n\014Oneof"
+ "Options\022C\n\024uninterpreted_option\030\347\007 \003(\0132$"
".google.protobuf.UninterpretedOption*\t\010\350"
- "\007\020\200\200\200\200\002\"{\n\016ServiceOptions\022\031\n\ndeprecated\030"
- "! \001(\010:\005false\022C\n\024uninterpreted_option\030\347\007 "
- "\003(\0132$.google.protobuf.UninterpretedOptio"
- "n*\t\010\350\007\020\200\200\200\200\002\"\255\002\n\rMethodOptions\022\031\n\ndeprec"
- "ated\030! \001(\010:\005false\022_\n\021idempotency_level\030\""
- " \001(\0162/.google.protobuf.MethodOptions.Ide"
- "mpotencyLevel:\023IDEMPOTENCY_UNKNOWN\022C\n\024un"
- "interpreted_option\030\347\007 \003(\0132$.google.proto"
- "buf.UninterpretedOption\"P\n\020IdempotencyLe"
- "vel\022\027\n\023IDEMPOTENCY_UNKNOWN\020\000\022\023\n\017NO_SIDE_"
- "EFFECTS\020\001\022\016\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200\002\"\236\002\n"
- "\023UninterpretedOption\022;\n\004name\030\002 \003(\0132-.goo"
- "gle.protobuf.UninterpretedOption.NamePar"
- "t\022\030\n\020identifier_value\030\003 \001(\t\022\032\n\022positive_"
- "int_value\030\004 \001(\004\022\032\n\022negative_int_value\030\005 "
- "\001(\003\022\024\n\014double_value\030\006 \001(\001\022\024\n\014string_valu"
- "e\030\007 \001(\014\022\027\n\017aggregate_value\030\010 \001(\t\0323\n\010Name"
- "Part\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_extension\030"
- "\002 \002(\010\"\325\001\n\016SourceCodeInfo\022:\n\010location\030\001 \003"
- "(\0132(.google.protobuf.SourceCodeInfo.Loca"
- "tion\032\206\001\n\010Location\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004s"
- "pan\030\002 \003(\005B\002\020\001\022\030\n\020leading_comments\030\003 \001(\t\022"
- "\031\n\021trailing_comments\030\004 \001(\t\022!\n\031leading_de"
- "tached_comments\030\006 \003(\t\"\247\001\n\021GeneratedCodeI"
- "nfo\022A\n\nannotation\030\001 \003(\0132-.google.protobu"
- "f.GeneratedCodeInfo.Annotation\032O\n\nAnnota"
- "tion\022\020\n\004path\030\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 "
- "\001(\t\022\r\n\005begin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005B\214\001\n\023com."
- "google.protobufB\020DescriptorProtosH\001Z>git"
- "hub.com/golang/protobuf/protoc-gen-go/de"
- "scriptor;descriptor\242\002\003GPB\252\002\032Google.Proto"
- "buf.Reflection"
+ "\007\020\200\200\200\200\002\"\223\001\n\013EnumOptions\022\023\n\013allow_alias\030\002"
+ " \001(\010\022\031\n\ndeprecated\030\003 \001(\010:\005false\022C\n\024unint"
+ "erpreted_option\030\347\007 \003(\0132$.google.protobuf"
+ ".UninterpretedOption*\t\010\350\007\020\200\200\200\200\002J\004\010\005\020\006\"}\n"
+ "\020EnumValueOptions\022\031\n\ndeprecated\030\001 \001(\010:\005f"
+ "alse\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.go"
+ "ogle.protobuf.UninterpretedOption*\t\010\350\007\020\200"
+ "\200\200\200\002\"{\n\016ServiceOptions\022\031\n\ndeprecated\030! \001"
+ "(\010:\005false\022C\n\024uninterpreted_option\030\347\007 \003(\013"
+ "2$.google.protobuf.UninterpretedOption*\t"
+ "\010\350\007\020\200\200\200\200\002\"\255\002\n\rMethodOptions\022\031\n\ndeprecate"
+ "d\030! \001(\010:\005false\022_\n\021idempotency_level\030\" \001("
+ "\0162/.google.protobuf.MethodOptions.Idempo"
+ "tencyLevel:\023IDEMPOTENCY_UNKNOWN\022C\n\024unint"
+ "erpreted_option\030\347\007 \003(\0132$.google.protobuf"
+ ".UninterpretedOption\"P\n\020IdempotencyLevel"
+ "\022\027\n\023IDEMPOTENCY_UNKNOWN\020\000\022\023\n\017NO_SIDE_EFF"
+ "ECTS\020\001\022\016\n\nIDEMPOTENT\020\002*\t\010\350\007\020\200\200\200\200\002\"\236\002\n\023Un"
+ "interpretedOption\022;\n\004name\030\002 \003(\0132-.google"
+ ".protobuf.UninterpretedOption.NamePart\022\030"
+ "\n\020identifier_value\030\003 \001(\t\022\032\n\022positive_int"
+ "_value\030\004 \001(\004\022\032\n\022negative_int_value\030\005 \001(\003"
+ "\022\024\n\014double_value\030\006 \001(\001\022\024\n\014string_value\030\007"
+ " \001(\014\022\027\n\017aggregate_value\030\010 \001(\t\0323\n\010NamePar"
+ "t\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_extension\030\002 \002"
+ "(\010\"\325\001\n\016SourceCodeInfo\022:\n\010location\030\001 \003(\0132"
+ "(.google.protobuf.SourceCodeInfo.Locatio"
+ "n\032\206\001\n\010Location\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span"
+ "\030\002 \003(\005B\002\020\001\022\030\n\020leading_comments\030\003 \001(\t\022\031\n\021"
+ "trailing_comments\030\004 \001(\t\022!\n\031leading_detac"
+ "hed_comments\030\006 \003(\t\"\247\001\n\021GeneratedCodeInfo"
+ "\022A\n\nannotation\030\001 \003(\0132-.google.protobuf.G"
+ "eneratedCodeInfo.Annotation\032O\n\nAnnotatio"
+ "n\022\020\n\004path\030\001 \003(\005B\002\020\001\022\023\n\013source_file\030\002 \001(\t"
+ "\022\r\n\005begin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005B\214\001\n\023com.goo"
+ "gle.protobufB\020DescriptorProtosH\001Z>github"
+ ".com/golang/protobuf/protoc-gen-go/descr"
+ "iptor;descriptor\242\002\003GPB\252\002\032Google.Protobuf"
+ ".Reflection"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
- descriptor, 5614);
+ descriptor, 5651);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"google/protobuf/descriptor.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -1127,6 +1132,7 @@ void FileDescriptorSet::SerializeWithCachedSizes(
::google::protobuf::uint8* FileDescriptorSet::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorSet)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1730,6 +1736,7 @@ void FileDescriptorProto::SerializeWithCachedSizes(
::google::protobuf::uint8* FileDescriptorProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -2762,6 +2769,7 @@ void DescriptorProto_ExtensionRange::SerializeWithCachedSizes(
::google::protobuf::uint8* DescriptorProto_ExtensionRange::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ExtensionRange)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -3101,6 +3109,7 @@ void DescriptorProto_ReservedRange::SerializeWithCachedSizes(
::google::protobuf::uint8* DescriptorProto_ReservedRange::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ReservedRange)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -3644,6 +3653,7 @@ void DescriptorProto::SerializeWithCachedSizes(
::google::protobuf::uint8* DescriptorProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -4565,7 +4575,7 @@ bool FieldDescriptorProto::MergePartialFromCodedStream(
set_label(static_cast< ::google::protobuf::FieldDescriptorProto_Label >(value));
} else {
mutable_unknown_fields()->AddVarint(
- 4, static_cast<::google::protobuf::uint64>(value));
+ 4, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
@@ -4585,7 +4595,7 @@ bool FieldDescriptorProto::MergePartialFromCodedStream(
set_type(static_cast< ::google::protobuf::FieldDescriptorProto_Type >(value));
} else {
mutable_unknown_fields()->AddVarint(
- 5, static_cast<::google::protobuf::uint64>(value));
+ 5, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
@@ -4783,6 +4793,7 @@ void FieldDescriptorProto::SerializeWithCachedSizes(
::google::protobuf::uint8* FieldDescriptorProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldDescriptorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -5725,6 +5736,7 @@ void OneofDescriptorProto::SerializeWithCachedSizes(
::google::protobuf::uint8* OneofDescriptorProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofDescriptorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -6177,6 +6189,7 @@ void EnumDescriptorProto::SerializeWithCachedSizes(
::google::protobuf::uint8* EnumDescriptorProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumDescriptorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -6683,6 +6696,7 @@ void EnumValueDescriptorProto::SerializeWithCachedSizes(
::google::protobuf::uint8* EnumValueDescriptorProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueDescriptorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -7176,6 +7190,7 @@ void ServiceDescriptorProto::SerializeWithCachedSizes(
::google::protobuf::uint8* ServiceDescriptorProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceDescriptorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -7782,6 +7797,7 @@ void MethodDescriptorProto::SerializeWithCachedSizes(
::google::protobuf::uint8* MethodDescriptorProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodDescriptorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -8292,6 +8308,7 @@ const int FileOptions::kGoPackageFieldNumber;
const int FileOptions::kCcGenericServicesFieldNumber;
const int FileOptions::kJavaGenericServicesFieldNumber;
const int FileOptions::kPyGenericServicesFieldNumber;
+const int FileOptions::kPhpGenericServicesFieldNumber;
const int FileOptions::kDeprecatedFieldNumber;
const int FileOptions::kCcEnableArenasFieldNumber;
const int FileOptions::kObjcClassPrefixFieldNumber;
@@ -8451,10 +8468,13 @@ void FileOptions::Clear() {
}
if (_has_bits_[8 / 32] & 65280u) {
::memset(&java_multiple_files_, 0, static_cast<size_t>(
- reinterpret_cast<char*>(&cc_enable_arenas_) -
- reinterpret_cast<char*>(&java_multiple_files_)) + sizeof(cc_enable_arenas_));
+ reinterpret_cast<char*>(&deprecated_) -
+ reinterpret_cast<char*>(&java_multiple_files_)) + sizeof(deprecated_));
+ }
+ if (_has_bits_[16 / 32] & 196608u) {
+ cc_enable_arenas_ = false;
+ optimize_for_ = 1;
}
- optimize_for_ = 1;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
@@ -8513,7 +8533,7 @@ bool FileOptions::MergePartialFromCodedStream(
set_optimize_for(static_cast< ::google::protobuf::FileOptions_OptimizeMode >(value));
} else {
mutable_unknown_fields()->AddVarint(
- 9, static_cast<::google::protobuf::uint64>(value));
+ 9, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
@@ -8593,6 +8613,20 @@ bool FileOptions::MergePartialFromCodedStream(
break;
}
+ // optional bool php_generic_services = 19 [default = false];
+ case 19: {
+ if (static_cast< ::google::protobuf::uint8>(tag) ==
+ static_cast< ::google::protobuf::uint8>(152u)) {
+ set_has_php_generic_services();
+ DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+ bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
+ input, &php_generic_services_)));
+ } else {
+ goto handle_unusual;
+ }
+ break;
+ }
+
// optional bool java_generate_equals_and_hash = 20 [deprecated = true];
case 20: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
@@ -8796,7 +8830,7 @@ void FileOptions::SerializeWithCachedSizes(
}
// optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
- if (cached_has_bits & 0x00010000u) {
+ if (cached_has_bits & 0x00020000u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
9, this->optimize_for(), output);
}
@@ -8831,13 +8865,18 @@ void FileOptions::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::WriteBool(18, this->py_generic_services(), output);
}
+ // optional bool php_generic_services = 19 [default = false];
+ if (cached_has_bits & 0x00004000u) {
+ ::google::protobuf::internal::WireFormatLite::WriteBool(19, this->php_generic_services(), output);
+ }
+
// optional bool java_generate_equals_and_hash = 20 [deprecated = true];
if (cached_has_bits & 0x00000200u) {
::google::protobuf::internal::WireFormatLite::WriteBool(20, this->java_generate_equals_and_hash(), output);
}
// optional bool deprecated = 23 [default = false];
- if (cached_has_bits & 0x00004000u) {
+ if (cached_has_bits & 0x00008000u) {
::google::protobuf::internal::WireFormatLite::WriteBool(23, this->deprecated(), output);
}
@@ -8847,7 +8886,7 @@ void FileOptions::SerializeWithCachedSizes(
}
// optional bool cc_enable_arenas = 31 [default = false];
- if (cached_has_bits & 0x00008000u) {
+ if (cached_has_bits & 0x00010000u) {
::google::protobuf::internal::WireFormatLite::WriteBool(31, this->cc_enable_arenas(), output);
}
@@ -8921,6 +8960,7 @@ void FileOptions::SerializeWithCachedSizes(
::google::protobuf::uint8* FileOptions::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileOptions)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -8949,7 +8989,7 @@ void FileOptions::SerializeWithCachedSizes(
}
// optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
- if (cached_has_bits & 0x00010000u) {
+ if (cached_has_bits & 0x00020000u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
9, this->optimize_for(), target);
}
@@ -8985,13 +9025,18 @@ void FileOptions::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(18, this->py_generic_services(), target);
}
+ // optional bool php_generic_services = 19 [default = false];
+ if (cached_has_bits & 0x00004000u) {
+ target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(19, this->php_generic_services(), target);
+ }
+
// optional bool java_generate_equals_and_hash = 20 [deprecated = true];
if (cached_has_bits & 0x00000200u) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(20, this->java_generate_equals_and_hash(), target);
}
// optional bool deprecated = 23 [default = false];
- if (cached_has_bits & 0x00004000u) {
+ if (cached_has_bits & 0x00008000u) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(23, this->deprecated(), target);
}
@@ -9001,7 +9046,7 @@ void FileOptions::SerializeWithCachedSizes(
}
// optional bool cc_enable_arenas = 31 [default = false];
- if (cached_has_bits & 0x00008000u) {
+ if (cached_has_bits & 0x00010000u) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(31, this->cc_enable_arenas(), target);
}
@@ -9191,23 +9236,30 @@ size_t FileOptions::ByteSizeLong() const {
total_size += 2 + 1;
}
+ // optional bool php_generic_services = 19 [default = false];
+ if (has_php_generic_services()) {
+ total_size += 2 + 1;
+ }
+
// optional bool deprecated = 23 [default = false];
if (has_deprecated()) {
total_size += 2 + 1;
}
+ }
+ if (_has_bits_[16 / 32] & 196608u) {
// optional bool cc_enable_arenas = 31 [default = false];
if (has_cc_enable_arenas()) {
total_size += 2 + 1;
}
- }
- // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
- if (has_optimize_for()) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->optimize_for());
- }
+ // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
+ if (has_optimize_for()) {
+ total_size += 1 +
+ ::google::protobuf::internal::WireFormatLite::EnumSize(this->optimize_for());
+ }
+ }
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = cached_size;
@@ -9294,15 +9346,21 @@ void FileOptions::MergeFrom(const FileOptions& from) {
py_generic_services_ = from.py_generic_services_;
}
if (cached_has_bits & 0x00004000u) {
- deprecated_ = from.deprecated_;
+ php_generic_services_ = from.php_generic_services_;
}
if (cached_has_bits & 0x00008000u) {
- cc_enable_arenas_ = from.cc_enable_arenas_;
+ deprecated_ = from.deprecated_;
}
_has_bits_[0] |= cached_has_bits;
}
- if (cached_has_bits & 0x00010000u) {
- set_optimize_for(from.optimize_for());
+ if (cached_has_bits & 196608u) {
+ if (cached_has_bits & 0x00010000u) {
+ cc_enable_arenas_ = from.cc_enable_arenas_;
+ }
+ if (cached_has_bits & 0x00020000u) {
+ optimize_for_ = from.optimize_for_;
+ }
+ _has_bits_[0] |= cached_has_bits;
}
}
@@ -9349,6 +9407,7 @@ void FileOptions::InternalSwap(FileOptions* other) {
std::swap(cc_generic_services_, other->cc_generic_services_);
std::swap(java_generic_services_, other->java_generic_services_);
std::swap(py_generic_services_, other->py_generic_services_);
+ std::swap(php_generic_services_, other->php_generic_services_);
std::swap(deprecated_, other->deprecated_);
std::swap(cc_enable_arenas_, other->cc_enable_arenas_);
std::swap(optimize_for_, other->optimize_for_);
@@ -9566,13 +9625,13 @@ void FileOptions::set_java_string_check_utf8(bool value) {
// optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
bool FileOptions::has_optimize_for() const {
- return (_has_bits_[0] & 0x00010000u) != 0;
+ return (_has_bits_[0] & 0x00020000u) != 0;
}
void FileOptions::set_has_optimize_for() {
- _has_bits_[0] |= 0x00010000u;
+ _has_bits_[0] |= 0x00020000u;
}
void FileOptions::clear_has_optimize_for() {
- _has_bits_[0] &= ~0x00010000u;
+ _has_bits_[0] &= ~0x00020000u;
}
void FileOptions::clear_optimize_for() {
optimize_for_ = 1;
@@ -9724,15 +9783,39 @@ void FileOptions::set_py_generic_services(bool value) {
// @@protoc_insertion_point(field_set:google.protobuf.FileOptions.py_generic_services)
}
+// optional bool php_generic_services = 19 [default = false];
+bool FileOptions::has_php_generic_services() const {
+ return (_has_bits_[0] & 0x00004000u) != 0;
+}
+void FileOptions::set_has_php_generic_services() {
+ _has_bits_[0] |= 0x00004000u;
+}
+void FileOptions::clear_has_php_generic_services() {
+ _has_bits_[0] &= ~0x00004000u;
+}
+void FileOptions::clear_php_generic_services() {
+ php_generic_services_ = false;
+ clear_has_php_generic_services();
+}
+bool FileOptions::php_generic_services() const {
+ // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_generic_services)
+ return php_generic_services_;
+}
+void FileOptions::set_php_generic_services(bool value) {
+ set_has_php_generic_services();
+ php_generic_services_ = value;
+ // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_generic_services)
+}
+
// optional bool deprecated = 23 [default = false];
bool FileOptions::has_deprecated() const {
- return (_has_bits_[0] & 0x00004000u) != 0;
+ return (_has_bits_[0] & 0x00008000u) != 0;
}
void FileOptions::set_has_deprecated() {
- _has_bits_[0] |= 0x00004000u;
+ _has_bits_[0] |= 0x00008000u;
}
void FileOptions::clear_has_deprecated() {
- _has_bits_[0] &= ~0x00004000u;
+ _has_bits_[0] &= ~0x00008000u;
}
void FileOptions::clear_deprecated() {
deprecated_ = false;
@@ -9750,13 +9833,13 @@ void FileOptions::set_deprecated(bool value) {
// optional bool cc_enable_arenas = 31 [default = false];
bool FileOptions::has_cc_enable_arenas() const {
- return (_has_bits_[0] & 0x00008000u) != 0;
+ return (_has_bits_[0] & 0x00010000u) != 0;
}
void FileOptions::set_has_cc_enable_arenas() {
- _has_bits_[0] |= 0x00008000u;
+ _has_bits_[0] |= 0x00010000u;
}
void FileOptions::clear_has_cc_enable_arenas() {
- _has_bits_[0] &= ~0x00008000u;
+ _has_bits_[0] &= ~0x00010000u;
}
void FileOptions::clear_cc_enable_arenas() {
cc_enable_arenas_ = false;
@@ -10354,6 +10437,7 @@ void MessageOptions::SerializeWithCachedSizes(
::google::protobuf::uint8* MessageOptions::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MessageOptions)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -10774,7 +10858,7 @@ bool FieldOptions::MergePartialFromCodedStream(
set_ctype(static_cast< ::google::protobuf::FieldOptions_CType >(value));
} else {
mutable_unknown_fields()->AddVarint(
- 1, static_cast<::google::protobuf::uint64>(value));
+ 1, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
@@ -10836,7 +10920,7 @@ bool FieldOptions::MergePartialFromCodedStream(
set_jstype(static_cast< ::google::protobuf::FieldOptions_JSType >(value));
} else {
mutable_unknown_fields()->AddVarint(
- 6, static_cast<::google::protobuf::uint64>(value));
+ 6, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
@@ -10956,6 +11040,7 @@ void FieldOptions::SerializeWithCachedSizes(
::google::protobuf::uint8* FieldOptions::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldOptions)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -11494,6 +11579,7 @@ void OneofOptions::SerializeWithCachedSizes(
::google::protobuf::uint8* OneofOptions::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofOptions)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -11843,6 +11929,7 @@ void EnumOptions::SerializeWithCachedSizes(
::google::protobuf::uint8* EnumOptions::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumOptions)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -12247,6 +12334,7 @@ void EnumValueOptions::SerializeWithCachedSizes(
::google::protobuf::uint8* EnumValueOptions::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueOptions)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -12607,6 +12695,7 @@ void ServiceOptions::SerializeWithCachedSizes(
::google::protobuf::uint8* ServiceOptions::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceOptions)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -12917,7 +13006,7 @@ bool MethodOptions::MergePartialFromCodedStream(
set_idempotency_level(static_cast< ::google::protobuf::MethodOptions_IdempotencyLevel >(value));
} else {
mutable_unknown_fields()->AddVarint(
- 34, static_cast<::google::protobuf::uint64>(value));
+ 34, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
@@ -13002,6 +13091,7 @@ void MethodOptions::SerializeWithCachedSizes(
::google::protobuf::uint8* MethodOptions::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodOptions)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -13413,6 +13503,7 @@ void UninterpretedOption_NamePart::SerializeWithCachedSizes(
::google::protobuf::uint8* UninterpretedOption_NamePart::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption.NamePart)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -13960,6 +14051,7 @@ void UninterpretedOption::SerializeWithCachedSizes(
::google::protobuf::uint8* UninterpretedOption::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -14703,7 +14795,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes(
// repeated int32 path = 1 [packed = true];
if (this->path_size() > 0) {
::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
- output->WriteVarint32(static_cast<::google::protobuf::uint32>(
+ output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
_path_cached_byte_size_));
}
for (int i = 0, n = this->path_size(); i < n; i++) {
@@ -14714,7 +14806,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes(
// repeated int32 span = 2 [packed = true];
if (this->span_size() > 0) {
::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
- output->WriteVarint32(static_cast<::google::protobuf::uint32>(
+ output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
_span_cached_byte_size_));
}
for (int i = 0, n = this->span_size(); i < n; i++) {
@@ -14762,6 +14854,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes(
::google::protobuf::uint8* SourceCodeInfo_Location::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo.Location)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -14773,7 +14866,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
target);
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
- static_cast<::google::protobuf::uint32>(
+ static_cast< ::google::protobuf::uint32>(
_path_cached_byte_size_), target);
target = ::google::protobuf::internal::WireFormatLite::
WriteInt32NoTagToArray(this->path_, target);
@@ -14786,7 +14879,7 @@ void SourceCodeInfo_Location::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
target);
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
- static_cast<::google::protobuf::uint32>(
+ static_cast< ::google::protobuf::uint32>(
_span_cached_byte_size_), target);
target = ::google::protobuf::internal::WireFormatLite::
WriteInt32NoTagToArray(this->span_, target);
@@ -14849,7 +14942,7 @@ size_t SourceCodeInfo_Location::ByteSizeLong() const {
if (data_size > 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
- static_cast<google::protobuf::int32>(data_size));
+ static_cast< ::google::protobuf::int32>(data_size));
}
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
@@ -14865,7 +14958,7 @@ size_t SourceCodeInfo_Location::ByteSizeLong() const {
if (data_size > 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
- static_cast<google::protobuf::int32>(data_size));
+ static_cast< ::google::protobuf::int32>(data_size));
}
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
@@ -15373,6 +15466,7 @@ void SourceCodeInfo::SerializeWithCachedSizes(
::google::protobuf::uint8* SourceCodeInfo::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -15707,7 +15801,7 @@ void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes(
// repeated int32 path = 1 [packed = true];
if (this->path_size() > 0) {
::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
- output->WriteVarint32(static_cast<::google::protobuf::uint32>(
+ output->WriteVarint32(static_cast< ::google::protobuf::uint32>(
_path_cached_byte_size_));
}
for (int i = 0, n = this->path_size(); i < n; i++) {
@@ -15745,6 +15839,7 @@ void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes(
::google::protobuf::uint8* GeneratedCodeInfo_Annotation::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo.Annotation)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -15756,7 +15851,7 @@ void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
target);
target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
- static_cast<::google::protobuf::uint32>(
+ static_cast< ::google::protobuf::uint32>(
_path_cached_byte_size_), target);
target = ::google::protobuf::internal::WireFormatLite::
WriteInt32NoTagToArray(this->path_, target);
@@ -15808,7 +15903,7 @@ size_t GeneratedCodeInfo_Annotation::ByteSizeLong() const {
if (data_size > 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
- static_cast<google::protobuf::int32>(data_size));
+ static_cast< ::google::protobuf::int32>(data_size));
}
int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
@@ -16201,6 +16296,7 @@ void GeneratedCodeInfo::SerializeWithCachedSizes(
::google::protobuf::uint8* GeneratedCodeInfo::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h
index f64a339c..2aaa9fde 100644
--- a/src/google/protobuf/descriptor.pb.h
+++ b/src/google/protobuf/descriptor.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
@@ -2290,6 +2290,13 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p
bool py_generic_services() const;
void set_py_generic_services(bool value);
+ // optional bool php_generic_services = 19 [default = false];
+ bool has_php_generic_services() const;
+ void clear_php_generic_services();
+ static const int kPhpGenericServicesFieldNumber = 19;
+ bool php_generic_services() const;
+ void set_php_generic_services(bool value);
+
// optional bool deprecated = 23 [default = false];
bool has_deprecated() const;
void clear_deprecated();
@@ -2334,6 +2341,8 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p
void clear_has_java_generic_services();
void set_has_py_generic_services();
void clear_has_py_generic_services();
+ void set_has_php_generic_services();
+ void clear_has_php_generic_services();
void set_has_deprecated();
void clear_has_deprecated();
void set_has_cc_enable_arenas();
@@ -2369,6 +2378,7 @@ class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@p
bool cc_generic_services_;
bool java_generic_services_;
bool py_generic_services_;
+ bool php_generic_services_;
bool deprecated_;
bool cc_enable_arenas_;
int optimize_for_;
@@ -6644,13 +6654,13 @@ inline void FileOptions::set_java_string_check_utf8(bool value) {
// optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED];
inline bool FileOptions::has_optimize_for() const {
- return (_has_bits_[0] & 0x00010000u) != 0;
+ return (_has_bits_[0] & 0x00020000u) != 0;
}
inline void FileOptions::set_has_optimize_for() {
- _has_bits_[0] |= 0x00010000u;
+ _has_bits_[0] |= 0x00020000u;
}
inline void FileOptions::clear_has_optimize_for() {
- _has_bits_[0] &= ~0x00010000u;
+ _has_bits_[0] &= ~0x00020000u;
}
inline void FileOptions::clear_optimize_for() {
optimize_for_ = 1;
@@ -6802,15 +6812,39 @@ inline void FileOptions::set_py_generic_services(bool value) {
// @@protoc_insertion_point(field_set:google.protobuf.FileOptions.py_generic_services)
}
+// optional bool php_generic_services = 19 [default = false];
+inline bool FileOptions::has_php_generic_services() const {
+ return (_has_bits_[0] & 0x00004000u) != 0;
+}
+inline void FileOptions::set_has_php_generic_services() {
+ _has_bits_[0] |= 0x00004000u;
+}
+inline void FileOptions::clear_has_php_generic_services() {
+ _has_bits_[0] &= ~0x00004000u;
+}
+inline void FileOptions::clear_php_generic_services() {
+ php_generic_services_ = false;
+ clear_has_php_generic_services();
+}
+inline bool FileOptions::php_generic_services() const {
+ // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.php_generic_services)
+ return php_generic_services_;
+}
+inline void FileOptions::set_php_generic_services(bool value) {
+ set_has_php_generic_services();
+ php_generic_services_ = value;
+ // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.php_generic_services)
+}
+
// optional bool deprecated = 23 [default = false];
inline bool FileOptions::has_deprecated() const {
- return (_has_bits_[0] & 0x00004000u) != 0;
+ return (_has_bits_[0] & 0x00008000u) != 0;
}
inline void FileOptions::set_has_deprecated() {
- _has_bits_[0] |= 0x00004000u;
+ _has_bits_[0] |= 0x00008000u;
}
inline void FileOptions::clear_has_deprecated() {
- _has_bits_[0] &= ~0x00004000u;
+ _has_bits_[0] &= ~0x00008000u;
}
inline void FileOptions::clear_deprecated() {
deprecated_ = false;
@@ -6828,13 +6862,13 @@ inline void FileOptions::set_deprecated(bool value) {
// optional bool cc_enable_arenas = 31 [default = false];
inline bool FileOptions::has_cc_enable_arenas() const {
- return (_has_bits_[0] & 0x00008000u) != 0;
+ return (_has_bits_[0] & 0x00010000u) != 0;
}
inline void FileOptions::set_has_cc_enable_arenas() {
- _has_bits_[0] |= 0x00008000u;
+ _has_bits_[0] |= 0x00010000u;
}
inline void FileOptions::clear_has_cc_enable_arenas() {
- _has_bits_[0] &= ~0x00008000u;
+ _has_bits_[0] &= ~0x00010000u;
}
inline void FileOptions::clear_cc_enable_arenas() {
cc_enable_arenas_ = false;
diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto
index c7fbaaf6..70b82a4d 100644
--- a/src/google/protobuf/descriptor.proto
+++ b/src/google/protobuf/descriptor.proto
@@ -351,6 +351,7 @@ message FileOptions {
optional bool cc_generic_services = 16 [default=false];
optional bool java_generic_services = 17 [default=false];
optional bool py_generic_services = 18 [default=false];
+ optional bool php_generic_services = 19 [default=false];
// Is this file deprecated?
// Depending on the target platform, this can emit Deprecated annotations
diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc
index 1933c6d2..e3c522f5 100644
--- a/src/google/protobuf/duration.pb.cc
+++ b/src/google/protobuf/duration.pb.cc
@@ -102,6 +102,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -118,12 +119,13 @@ void AddDescriptorsImpl() {
"google/protobuf/duration.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -151,9 +153,7 @@ Duration::Duration()
Duration::Duration(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fduration_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Duration)
@@ -301,6 +301,7 @@ void Duration::SerializeWithCachedSizes(
::google::protobuf::uint8* Duration::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Duration)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h
index 34873d97..02679c6a 100644
--- a/src/google/protobuf/duration.pb.h
+++ b/src/google/protobuf/duration.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc
index 71195056..9ff146f0 100644
--- a/src/google/protobuf/empty.pb.cc
+++ b/src/google/protobuf/empty.pb.cc
@@ -100,6 +100,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -115,12 +116,13 @@ void AddDescriptorsImpl() {
"google/protobuf/empty.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -146,9 +148,7 @@ Empty::Empty()
Empty::Empty(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fempty_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Empty)
@@ -244,6 +244,7 @@ void Empty::SerializeWithCachedSizes(
::google::protobuf::uint8* Empty::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Empty)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h
index f28dc19b..306301a4 100644
--- a/src/google/protobuf/empty.pb.h
+++ b/src/google/protobuf/empty.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc
index d7efd083..5b29d247 100644
--- a/src/google/protobuf/field_mask.pb.cc
+++ b/src/google/protobuf/field_mask.pb.cc
@@ -101,6 +101,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -117,12 +118,13 @@ void AddDescriptorsImpl() {
"google/protobuf/field_mask.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -264,6 +266,7 @@ void FieldMask::SerializeWithCachedSizes(
::google::protobuf::uint8* FieldMask::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h
index 742c1cf9..42110be6 100644
--- a/src/google/protobuf/field_mask.pb.h
+++ b/src/google/protobuf/field_mask.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/generated_message_table_driven.cc b/src/google/protobuf/generated_message_table_driven.cc
index e281266d..f8fda9c6 100644
--- a/src/google/protobuf/generated_message_table_driven.cc
+++ b/src/google/protobuf/generated_message_table_driven.cc
@@ -74,7 +74,7 @@ inline Arena* GetArena(MessageLite* msg, int64 arena_offset) {
template <typename Type>
inline Type* AddField(MessageLite* msg, int64 offset) {
#if LANG_CXX11
- static_assert(std::is_trivially_copy_assignable<Type>::value,
+ static_assert(google::protobuf::internal::has_trivial_copy<Type>::value,
"Do not assign");
#endif
@@ -94,7 +94,7 @@ inline string* AddField<string>(MessageLite* msg, int64 offset) {
template <typename Type>
inline void AddField(MessageLite* msg, int64 offset, Type value) {
#if LANG_CXX11
- static_assert(std::is_trivially_copy_assignable<Type>::value,
+ static_assert(google::protobuf::internal::has_trivial_copy<Type>::value,
"Do not assign");
#endif
*AddField<Type>(msg, offset) = value;
@@ -118,7 +118,7 @@ template <typename Type>
inline void SetField(MessageLite* msg, uint32* has_bits, uint32 has_bit_index,
int64 offset, Type value) {
#if LANG_CXX11
- static_assert(std::is_trivially_copy_assignable<Type>::value,
+ static_assert(google::protobuf::internal::has_trivial_copy<Type>::value,
"Do not assign");
#endif
*MutableField<Type>(msg, has_bits, has_bit_index, offset) = value;
diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h
index a7154b40..c16bd728 100644
--- a/src/google/protobuf/generated_message_util.h
+++ b/src/google/protobuf/generated_message_util.h
@@ -100,7 +100,7 @@ namespace internal {
// choose 16 rather than some other number just in case the compiler would
// be confused by an unaligned pointer.
#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD) \
- static_cast<int>( \
+ static_cast< ::google::protobuf::uint32>( \
reinterpret_cast<const char*>( \
&reinterpret_cast<const TYPE*>(16)->FIELD) - \
reinterpret_cast<const char*>(16))
diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h
index 20d86143..9f1cf88c 100644
--- a/src/google/protobuf/io/coded_stream.h
+++ b/src/google/protobuf/io/coded_stream.h
@@ -1434,7 +1434,7 @@ inline bool CodedInputStream::IsFlat() const {
} // namespace protobuf
-#if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
+#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
#pragma runtime_checks("c", restore)
#endif // _MSC_VER && !defined(__INTEL_COMPILER)
diff --git a/src/google/protobuf/io/zero_copy_stream_impl.cc b/src/google/protobuf/io/zero_copy_stream_impl.cc
index 109c55c1..c7372ac2 100644
--- a/src/google/protobuf/io/zero_copy_stream_impl.cc
+++ b/src/google/protobuf/io/zero_copy_stream_impl.cc
@@ -32,9 +32,7 @@
// Based on original Protocol Buffers design by
// Sanjay Ghemawat, Jeff Dean, and others.
-#ifdef _MSC_VER
-#include <io.h>
-#else
+#ifndef _MSC_VER
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -43,9 +41,9 @@
#include <errno.h>
#include <iostream>
#include <algorithm>
-
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/stl_util.h>
@@ -58,6 +56,13 @@ namespace io {
// Win32 lseek is broken: If invoked on a non-seekable file descriptor, its
// return value is undefined. We re-define it to always produce an error.
#define lseek(fd, offset, origin) ((off_t)-1)
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::access;
+using google::protobuf::internal::win32::close;
+using google::protobuf::internal::win32::open;
+using google::protobuf::internal::win32::read;
+using google::protobuf::internal::win32::write;
#endif
namespace {
diff --git a/src/google/protobuf/io/zero_copy_stream_unittest.cc b/src/google/protobuf/io/zero_copy_stream_unittest.cc
index 235cbca4..f3754087 100644
--- a/src/google/protobuf/io/zero_copy_stream_unittest.cc
+++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc
@@ -47,9 +47,7 @@
// implementations.
-#ifdef _MSC_VER
-#include <io.h>
-#else
+#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <stdlib.h>
@@ -72,6 +70,7 @@
#endif
#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/testing/googletest.h>
#include <google/protobuf/testing/file.h>
@@ -84,6 +83,12 @@ namespace {
#ifdef _WIN32
#define pipe(fds) _pipe(fds, 4096, O_BINARY)
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::access;
+using google::protobuf::internal::win32::mkdir;
+using google::protobuf::internal::win32::open;
+using google::protobuf::internal::win32::close;
#endif
#ifndef O_BINARY
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h
index 28eaf031..6a88600c 100644
--- a/src/google/protobuf/map.h
+++ b/src/google/protobuf/map.h
@@ -862,14 +862,7 @@ class Map {
size_type BucketNumber(const Key& k) const {
// We inherit from hasher, so one-arg operator() provides a hash function.
size_type h = (*const_cast<InnerMap*>(this))(k);
- // To help prevent people from making assumptions about the hash function,
- // we use the seed differently depending on NDEBUG. The default hash
- // function, the seeding, etc., are all likely to change in the future.
-#ifndef NDEBUG
- return (h * (seed_ | 1)) & (num_buckets_ - 1);
-#else
return (h + seed_) & (num_buckets_ - 1);
-#endif
}
bool IsMatch(const Key& k0, const Key& k1) const {
diff --git a/src/google/protobuf/map_field_inl.h b/src/google/protobuf/map_field_inl.h
index 0cfed72f..e317b5ed 100644
--- a/src/google/protobuf/map_field_inl.h
+++ b/src/google/protobuf/map_field_inl.h
@@ -252,9 +252,9 @@ template <typename Derived, typename Key, typename T,
WireFormatLite::FieldType kValueFieldType, int default_enum_value>
void MapField<Derived, Key, T, kKeyFieldType, kValueFieldType,
default_enum_value>::Swap(MapField* other) {
- std::swap(MapFieldBase::repeated_field_, other->repeated_field_);
+ std::swap(this->MapFieldBase::repeated_field_, other->repeated_field_);
impl_.Swap(&other->impl_);
- std::swap(MapFieldBase::state_, other->state_);
+ std::swap(this->MapFieldBase::state_, other->state_);
}
template <typename Derived, typename Key, typename T,
diff --git a/src/google/protobuf/message_unittest.cc b/src/google/protobuf/message_unittest.cc
index 0469f4ca..cbf9051a 100644
--- a/src/google/protobuf/message_unittest.cc
+++ b/src/google/protobuf/message_unittest.cc
@@ -37,9 +37,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#ifdef _MSC_VER
-#include <io.h>
-#else
+#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <sstream>
@@ -56,6 +54,7 @@
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/testing/googletest.h>
#include <gtest/gtest.h>
@@ -63,6 +62,13 @@
namespace google {
namespace protobuf {
+#if defined(_WIN32)
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::close;
+using google::protobuf::internal::win32::open;
+#endif
+
#ifndef O_BINARY
#ifdef _O_BINARY
#define O_BINARY _O_BINARY
diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc
index 8ecb2d19..9d394f70 100644
--- a/src/google/protobuf/source_context.pb.cc
+++ b/src/google/protobuf/source_context.pb.cc
@@ -101,6 +101,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -118,12 +119,13 @@ void AddDescriptorsImpl() {
"google/protobuf/source_context.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -269,6 +271,7 @@ void SourceContext::SerializeWithCachedSizes(
::google::protobuf::uint8* SourceContext::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceContext)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h
index 23cd7f3e..66ee1886 100644
--- a/src/google/protobuf/source_context.pb.h
+++ b/src/google/protobuf/source_context.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc
index 26684c57..a7ce0040 100644
--- a/src/google/protobuf/struct.pb.cc
+++ b/src/google/protobuf/struct.pb.cc
@@ -161,6 +161,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -188,12 +189,13 @@ void AddDescriptorsImpl() {
"google/protobuf/struct.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -253,9 +255,7 @@ Struct::Struct(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena),
fields_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Struct)
@@ -436,6 +436,7 @@ void Struct::SerializeWithCachedSizes(
::google::protobuf::uint8* Struct::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -651,9 +652,7 @@ Value::Value()
Value::Value(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Value)
@@ -952,6 +951,7 @@ void Value::SerializeWithCachedSizes(
::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1560,9 +1560,7 @@ ListValue::ListValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena),
values_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fstruct_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.ListValue)
@@ -1684,6 +1682,7 @@ void ListValue::SerializeWithCachedSizes(
::google::protobuf::uint8* ListValue::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h
index a37a5652..c70912cd 100644
--- a/src/google/protobuf/struct.pb.h
+++ b/src/google/protobuf/struct.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h
index 75aee306..64c838fb 100644
--- a/src/google/protobuf/stubs/atomicops.h
+++ b/src/google/protobuf/stubs/atomicops.h
@@ -63,28 +63,21 @@ namespace google {
namespace protobuf {
namespace internal {
-#if defined(GOOGLE_PROTOBUF_ARCH_POWER)
-#if defined(_LP64) || defined(__LP64__)
-typedef int32 Atomic32;
-typedef intptr_t Atomic64;
+#ifdef GOOGLE_PROTOBUF_ARCH_32_BIT
+ typedef intptr_t Atomic32;
+ typedef int64 Atomic64;
#else
-typedef intptr_t Atomic32;
-typedef int64 Atomic64;
-#endif
-#else
-typedef int32 Atomic32;
-#ifdef GOOGLE_PROTOBUF_ARCH_64_BIT
-// We need to be able to go between Atomic64 and AtomicWord implicitly. This
-// means Atomic64 and AtomicWord should be the same type on 64-bit.
-#if defined(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL)
-// NaCl's intptr_t is not actually 64-bits on 64-bit!
-// http://code.google.com/p/nativeclient/issues/detail?id=1162
-// sparcv9's pointer type is 32bits
-typedef int64 Atomic64;
-#else
-typedef intptr_t Atomic64;
-#endif
-#endif
+ typedef int32 Atomic32;
+ // We need to be able to go between Atomic64 and AtomicWord implicitly. This
+ // means Atomic64 and AtomicWord should be the same type on 64-bit.
+ #if defined(__ILP32__) || defined(GOOGLE_PROTOBUF_OS_NACL)
+ // NaCl's intptr_t is not actually 64-bits on 64-bit!
+ // http://code.google.com/p/nativeclient/issues/detail?id=1162
+ // sparcv9's pointer type is 32bits
+ typedef int64 Atomic64;
+ #else
+ typedef intptr_t Atomic64;
+ #endif
#endif
// Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h
index 60874e09..a56f8e89 100644
--- a/src/google/protobuf/stubs/common.h
+++ b/src/google/protobuf/stubs/common.h
@@ -101,7 +101,7 @@ namespace internal {
// The current version, represented as a single integer to make comparison
// easier: major * 10^6 + minor * 10^3 + micro
-#define GOOGLE_PROTOBUF_VERSION 3003000
+#define GOOGLE_PROTOBUF_VERSION 3003002
// A suffix string for alpha, beta or rc releases. Empty for stable releases.
#define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
@@ -227,10 +227,8 @@ class FatalException : public std::exception {
// in some versions of MSVC.
// TODO(acozzette): remove these using statements
using std::istream;
-using std::map;
using std::ostream;
using std::pair;
-using std::set;
using std::string;
using std::vector;
diff --git a/src/google/protobuf/stubs/hash.h b/src/google/protobuf/stubs/hash.h
index a997e04b..612b5861 100644
--- a/src/google/protobuf/stubs/hash.h
+++ b/src/google/protobuf/stubs/hash.h
@@ -40,10 +40,9 @@
#define GOOGLE_PROTOBUF_HAVE_HASH_MAP 1
#define GOOGLE_PROTOBUF_HAVE_HASH_SET 1
-#define GOOGLE_PROTOBUF_HAVE_64BIT_HASH 1
// Use C++11 unordered_{map|set} if available.
-#if ((_LIBCPP_STD_VER >= 11) || \
+#if ((defined(_LIBCPP_STD_VER) && _LIBCPP_STD_VER >= 11) || \
(((__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X)) && \
(__GLIBCXX__ > 20090421)))
# define GOOGLE_PROTOBUF_HAS_CXX11_HASH
@@ -93,8 +92,11 @@
# define GOOGLE_PROTOBUF_HASH_SET_CLASS hash_set
# endif
+// GCC <= 4.1 does not define std::tr1::hash for `long long int` or `long long unsigned int`
# if __GNUC__ == 4 && __GNUC__MINOR__ <= 1
-# undef GOOGLE_PROTOBUF_HAVE_64BIT_HASH
+# define GOOGLE_PROTOBUF_MISSING_HASH
+# include <map>
+# include <set>
# endif
// Version checks for MSC.
diff --git a/src/google/protobuf/stubs/io_win32.cc b/src/google/protobuf/stubs/io_win32.cc
new file mode 100644
index 00000000..6f0295e1
--- /dev/null
+++ b/src/google/protobuf/stubs/io_win32.cc
@@ -0,0 +1,362 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Author: laszlocsomor@google.com (Laszlo Csomor)
+//
+// Implementation for long-path-aware open/mkdir/etc. on Windows.
+//
+// These functions convert the input path to an absolute Windows path
+// with "\\?\" prefix if necessary, then pass that to _wopen/_wmkdir/etc.
+// (declared in <io.h>) respectively. This allows working with files/directories
+// whose paths are longer than MAX_PATH (260 chars).
+//
+// This file is only used on Windows, it's empty on other platforms.
+
+#if defined(_WIN32)
+
+// Comment this out to fall back to using the ANSI versions (open, mkdir, ...)
+// instead of the Unicode ones (_wopen, _wmkdir, ...). Doing so can be useful to
+// debug failing tests if that's caused by the long path support.
+#define SUPPORT_LONGPATHS
+
+#include <ctype.h>
+#include <direct.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <io.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <wctype.h>
+#include <windows.h>
+
+#include <google/protobuf/stubs/io_win32.h>
+
+#include <cassert>
+#include <memory>
+#include <sstream>
+#include <string>
+#include <vector>
+
+namespace google {
+namespace protobuf {
+namespace internal {
+namespace win32 {
+namespace {
+
+using std::string;
+using std::unique_ptr;
+using std::wstring;
+
+template <typename char_type>
+struct CharTraits {
+ static bool is_alpha(char_type ch);
+};
+
+template <>
+struct CharTraits<char> {
+ static bool is_alpha(char ch) { return isalpha(ch); }
+};
+
+template <>
+struct CharTraits<wchar_t> {
+ static bool is_alpha(wchar_t ch) { return iswalpha(ch); }
+};
+
+// Returns true if the path starts with a drive letter, e.g. "c:".
+// Note that this won't check for the "\" after the drive letter, so this also
+// returns true for "c:foo" (which is "c:\${PWD}\foo").
+// This check requires that a path not have a longpath prefix ("\\?\").
+template <typename char_type>
+bool has_drive_letter(const char_type* ch) {
+ return CharTraits<char_type>::is_alpha(ch[0]) && ch[1] == ':';
+}
+
+// Returns true if the path starts with a longpath prefix ("\\?\").
+template <typename char_type>
+bool has_longpath_prefix(const char_type* path) {
+ return path[0] == '\\' && path[1] == '\\' && path[2] == '?' &&
+ path[3] == '\\';
+}
+
+// Returns true if the path starts with a drive specifier (e.g. "c:\").
+template <typename char_type>
+bool is_path_absolute(const char_type* path) {
+ return has_drive_letter(path) && is_separator(path[2]);
+}
+
+template <typename char_type>
+bool is_separator(char_type c) {
+ return c == '/' || c == '\\';
+}
+
+template <typename char_type>
+bool is_drive_relative(const char_type* path) {
+ return has_drive_letter(path) && (path[2] == 0 || !is_separator(path[2]));
+}
+
+template <typename char_type>
+void replace_directory_separators(char_type* p) {
+ for (; *p; ++p) {
+ if (*p == '/') {
+ *p = '\\';
+ }
+ }
+}
+
+string join_paths(const string& path1, const string& path2) {
+ if (path1.empty() || is_path_absolute(path2.c_str()) ||
+ has_longpath_prefix(path2.c_str())) {
+ return path2;
+ }
+ if (path2.empty()) {
+ return path1;
+ }
+
+ if (is_separator(path1.back())) {
+ return is_separator(path2.front()) ? (path1 + path2.substr(1))
+ : (path1 + path2);
+ } else {
+ return is_separator(path2.front()) ? (path1 + path2)
+ : (path1 + '\\' + path2);
+ }
+}
+
+string normalize(string path) {
+ if (has_longpath_prefix(path.c_str())) {
+ path = path.substr(4);
+ }
+
+ static const string dot(".");
+ static const string dotdot("..");
+
+ std::vector<string> segments;
+ int segment_start = -1;
+ // Find the path segments in `path` (separated by "/").
+ for (int i = 0;; ++i) {
+ if (!is_separator(path[i]) && path[i] != '\0') {
+ // The current character does not end a segment, so start one unless it's
+ // already started.
+ if (segment_start < 0) {
+ segment_start = i;
+ }
+ } else if (segment_start >= 0 && i > segment_start) {
+ // The current character is "/" or "\0", so this ends a segment.
+ // Add that to `segments` if there's anything to add; handle "." and "..".
+ string segment(path, segment_start, i - segment_start);
+ segment_start = -1;
+ if (segment == dotdot) {
+ if (!segments.empty() &&
+ (!has_drive_letter(segments[0].c_str()) || segments.size() > 1)) {
+ segments.pop_back();
+ }
+ } else if (segment != dot && !segment.empty()) {
+ segments.push_back(segment);
+ }
+ }
+ if (path[i] == '\0') {
+ break;
+ }
+ }
+
+ // Handle the case when `path` is just a drive specifier (or some degenerate
+ // form of it, e.g. "c:\..").
+ if (segments.size() == 1 && segments[0].size() == 2 &&
+ has_drive_letter(segments[0].c_str())) {
+ return segments[0] + '\\';
+ }
+
+ // Join all segments.
+ bool first = true;
+ std::ostringstream result;
+ for (const auto& s : segments) {
+ if (!first) {
+ result << '\\';
+ }
+ first = false;
+ result << s;
+ }
+ // Preserve trailing separator if the input contained it.
+ if (is_separator(path.back())) {
+ result << '\\';
+ }
+ return result.str();
+}
+
+std::unique_ptr<WCHAR[]> as_wstring(const string& s) {
+ int len = ::MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.size(), NULL, 0);
+ std::unique_ptr<WCHAR[]> result(new WCHAR[len + 1]);
+ ::MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.size(), result.get(), len + 1);
+ result.get()[len] = 0;
+ return std::move(result);
+}
+
+wstring as_wchar_path(const string& path) {
+ std::unique_ptr<WCHAR[]> wbuf(as_wstring(path));
+ replace_directory_separators(wbuf.get());
+ return wstring(wbuf.get());
+}
+
+bool as_windows_path(const string& path, wstring* result) {
+ if (path.empty()) {
+ result->clear();
+ return true;
+ }
+ if (is_separator(path[0]) || is_drive_relative(path.c_str())) {
+ return false;
+ }
+
+ string mutable_path = path;
+ if (!is_path_absolute(mutable_path.c_str()) &&
+ !has_longpath_prefix(mutable_path.c_str())) {
+ char cwd[MAX_PATH];
+ ::GetCurrentDirectoryA(MAX_PATH, cwd);
+ mutable_path = join_paths(cwd, mutable_path);
+ }
+ *result = as_wchar_path(normalize(mutable_path));
+ if (!has_longpath_prefix(result->c_str())) {
+ // Add the "\\?\" prefix unconditionally. This way we prevent the Win32 API
+ // from processing the path and "helpfully" removing trailing dots from the
+ // path, for example.
+ // See https://github.com/bazelbuild/bazel/issues/2935
+ *result = wstring(L"\\\\?\\") + *result;
+ }
+ return true;
+}
+
+} // namespace
+
+int open(const char* path, int flags, int mode) {
+#ifdef SUPPORT_LONGPATHS
+ wstring wpath;
+ if (!as_windows_path(path, &wpath)) {
+ errno = ENOENT;
+ return -1;
+ }
+ return ::_wopen(wpath.c_str(), flags, mode);
+#else
+ return ::_open(path, flags, mode);
+#endif
+}
+
+int mkdir(const char* path, int _mode) {
+#ifdef SUPPORT_LONGPATHS
+ wstring wpath;
+ if (!as_windows_path(path, &wpath)) {
+ errno = ENOENT;
+ return -1;
+ }
+ return ::_wmkdir(wpath.c_str());
+#else // not SUPPORT_LONGPATHS
+ return ::_mkdir(path);
+#endif // not SUPPORT_LONGPATHS
+}
+
+int access(const char* path, int mode) {
+#ifdef SUPPORT_LONGPATHS
+ wstring wpath;
+ if (!as_windows_path(path, &wpath)) {
+ errno = ENOENT;
+ return -1;
+ }
+ return ::_waccess(wpath.c_str(), mode);
+#else
+ return ::_access(path, mode);
+#endif
+}
+
+int chdir(const char* path) {
+#ifdef SUPPORT_LONGPATHS
+ wstring wpath;
+ if (!as_windows_path(path, &wpath)) {
+ errno = ENOENT;
+ return -1;
+ }
+ return ::_wchdir(wpath.c_str());
+#else
+ return ::_chdir(path);
+#endif
+}
+
+int stat(const char* path, struct _stat* buffer) {
+#ifdef SUPPORT_LONGPATHS
+ wstring wpath;
+ if (!as_windows_path(path, &wpath)) {
+ errno = ENOENT;
+ return -1;
+ }
+ return ::_wstat(wpath.c_str(), buffer);
+#else // not SUPPORT_LONGPATHS
+ return ::_stat(path, buffer);
+#endif // not SUPPORT_LONGPATHS
+}
+
+FILE* fopen(const char* path, const char* mode) {
+#ifdef SUPPORT_LONGPATHS
+ wstring wpath;
+ if (!as_windows_path(path, &wpath)) {
+ errno = ENOENT;
+ return NULL;
+ }
+ std::unique_ptr<WCHAR[]> wmode(as_wstring(mode));
+ return ::_wfopen(wpath.c_str(), wmode.get());
+#else
+ return ::fopen(path, mode);
+#endif
+}
+
+int close(int fd) { return ::close(fd); }
+
+int dup(int fd) { return ::_dup(fd); }
+
+int dup2(int fd1, int fd2) { return ::_dup2(fd1, fd2); }
+
+int read(int fd, void* buffer, size_t size) {
+ return ::_read(fd, buffer, size);
+}
+
+int setmode(int fd, int mode) { return ::_setmode(fd, mode); }
+
+int write(int fd, const void* buffer, size_t size) {
+ return ::_write(fd, buffer, size);
+}
+
+wstring testonly_path_to_winpath(const string& path) {
+ wstring wpath;
+ as_windows_path(path, &wpath);
+ return wpath;
+}
+
+} // namespace win32
+} // namespace internal
+} // namespace protobuf
+} // namespace google
+
+#endif // defined(_WIN32)
+
diff --git a/src/google/protobuf/stubs/io_win32.h b/src/google/protobuf/stubs/io_win32.h
new file mode 100644
index 00000000..daccf16c
--- /dev/null
+++ b/src/google/protobuf/stubs/io_win32.h
@@ -0,0 +1,96 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Author: laszlocsomor@google.com (Laszlo Csomor)
+//
+// This file contains the declarations for Windows implementations of
+// commonly used POSIX functions such as open(2) and access(2), as well
+// as macro definitions for flags of these functions.
+//
+// By including this file you'll redefine open/access/etc. to
+// ::google::protobuf::internal::win32::{open/access/etc.}.
+// Make sure you don't include a header that attempts to redeclare or
+// redefine these functions, that'll lead to confusing compilation
+// errors. It's best to #include this file as the last one to ensure that.
+//
+// This file is only used on Windows, it's empty on other platforms.
+
+#ifndef GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
+#define GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
+
+#if defined(_WIN32)
+
+#include <string>
+
+namespace google {
+namespace protobuf {
+namespace internal {
+namespace win32 {
+
+FILE* fopen(const char* path, const char* mode);
+int access(const char* path, int mode);
+int chdir(const char* path);
+int close(int fd);
+int dup(int fd);
+int dup2(int fd1, int fd2);
+int mkdir(const char* path, int _mode);
+int open(const char* path, int flags, int mode = 0);
+int read(int fd, void* buffer, size_t size);
+int setmode(int fd, int mode);
+int stat(const char* path, struct _stat* buffer);
+int write(int fd, const void* buffer, size_t size);
+std::wstring testonly_path_to_winpath(const std::string& path);
+
+} // namespace win32
+} // namespace internal
+} // namespace protobuf
+} // namespace google
+
+#ifndef W_OK
+#define W_OK 02 // not defined by MSVC for whatever reason
+#endif
+
+#ifndef F_OK
+#define F_OK 00 // not defined by MSVC for whatever reason
+#endif
+
+#ifndef STDIN_FILENO
+#define STDIN_FILENO 0
+#endif
+
+#ifndef STDOUT_FILENO
+#define STDOUT_FILENO 1
+#endif
+
+#endif // defined(_WIN32)
+
+#endif // GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
+
+
diff --git a/src/google/protobuf/stubs/io_win32_unittest.cc b/src/google/protobuf/stubs/io_win32_unittest.cc
new file mode 100644
index 00000000..90bd9c96
--- /dev/null
+++ b/src/google/protobuf/stubs/io_win32_unittest.cc
@@ -0,0 +1,367 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Author: laszlocsomor@google.com (Laszlo Csomor)
+//
+// Unit tests for long-path-aware open/mkdir/access on Windows.
+//
+// This file is only used on Windows, it's empty on other platforms.
+
+#if defined(_WIN32)
+
+#define WIN32_LEAN_AND_MEAN
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <wchar.h>
+#include <windows.h>
+
+#include <google/protobuf/stubs/io_win32.h>
+#include <google/protobuf/testing/googletest.h>
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <sstream>
+#include <string>
+
+namespace google {
+namespace protobuf {
+namespace internal {
+namespace win32 {
+namespace {
+
+using std::string;
+using std::unique_ptr;
+using std::wstring;
+
+class IoWin32Test : public ::testing::Test {
+ public:
+ void SetUp() override;
+ void TearDown() override;
+
+ protected:
+ bool CreateAllUnder(wstring path);
+ bool DeleteAllUnder(wstring path);
+
+ string test_tmpdir;
+ wstring wtest_tmpdir;
+};
+
+#define ASSERT_INITIALIZED \
+ { \
+ EXPECT_FALSE(test_tmpdir.empty()); \
+ EXPECT_FALSE(wtest_tmpdir.empty()); \
+ }
+
+void IoWin32Test::SetUp() {
+ test_tmpdir = string(TestTempDir());
+ wtest_tmpdir.clear();
+ if (test_tmpdir.empty()) {
+ const char* test_tmpdir_env = getenv("TEST_TMPDIR");
+ if (test_tmpdir_env != nullptr && *test_tmpdir_env) {
+ test_tmpdir = string(test_tmpdir_env);
+ }
+
+ // Only Bazel defines TEST_TMPDIR, CMake does not, so look for other
+ // suitable environment variables.
+ if (test_tmpdir.empty()) {
+ for (const char* name : {"TEMP", "TMP"}) {
+ test_tmpdir_env = getenv(name);
+ if (test_tmpdir_env != nullptr && *test_tmpdir_env) {
+ test_tmpdir = string(test_tmpdir_env);
+ break;
+ }
+ }
+ }
+
+ // No other temp directory was found. Use the current director
+ if (test_tmpdir.empty()) {
+ char buffer[MAX_PATH];
+ // Use GetCurrentDirectoryA instead of GetCurrentDirectoryW, because the
+ // current working directory must always be shorter than MAX_PATH, even
+ // with
+ // "\\?\" prefix (except on Windows 10 version 1607 and beyond, after
+ // opting in to long paths by default [1]).
+ //
+ // [1] https://msdn.microsoft.com/en-us/library/windows/ \
+ // desktop/aa365247(v=vs.85).aspx#maxpath
+ DWORD result = ::GetCurrentDirectoryA(MAX_PATH, buffer);
+ if (result > 0) {
+ test_tmpdir = string(buffer);
+ } else {
+ // Using assertions in SetUp/TearDown seems to confuse the test
+ // framework, so just leave the member variables empty in case of
+ // failure.
+ GOOGLE_CHECK_OK(false);
+ return;
+ }
+ }
+ }
+
+ while (test_tmpdir.back() == '/' || test_tmpdir.back() == '\\') {
+ test_tmpdir.pop_back();
+ }
+ test_tmpdir += "\\io_win32_unittest.tmp";
+
+ // CreateDirectoryA's limit is 248 chars, see MSDN.
+ // https://msdn.microsoft.com/en-us/library/windows/ \
+ // desktop/aa363855(v=vs.85).aspx
+ wtest_tmpdir = testonly_path_to_winpath(test_tmpdir);
+ if (!DeleteAllUnder(wtest_tmpdir) || !CreateAllUnder(wtest_tmpdir)) {
+ GOOGLE_CHECK_OK(false);
+ test_tmpdir.clear();
+ wtest_tmpdir.clear();
+ }
+}
+
+void IoWin32Test::TearDown() {
+ if (!wtest_tmpdir.empty()) {
+ DeleteAllUnder(wtest_tmpdir);
+ }
+}
+
+bool IoWin32Test::CreateAllUnder(wstring path) {
+ // Prepend UNC prefix if the path doesn't have it already. Don't bother
+ // checking if the path is shorter than MAX_PATH, let's just do it
+ // unconditionally.
+ if (path.find(L"\\\\?\\") != 0) {
+ path = wstring(L"\\\\?\\") + path;
+ }
+ if (::CreateDirectoryW(path.c_str(), NULL) ||
+ GetLastError() == ERROR_ALREADY_EXISTS ||
+ GetLastError() == ERROR_ACCESS_DENIED) {
+ return true;
+ }
+ if (GetLastError() == ERROR_PATH_NOT_FOUND) {
+ size_t pos = path.find_last_of(L'\\');
+ if (pos != wstring::npos) {
+ wstring parent(path, 0, pos);
+ if (CreateAllUnder(parent) && CreateDirectoryW(path.c_str(), NULL)) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool IoWin32Test::DeleteAllUnder(wstring path) {
+ static const wstring kDot(L".");
+ static const wstring kDotDot(L"..");
+
+ // Prepend UNC prefix if the path doesn't have it already. Don't bother
+ // checking if the path is shorter than MAX_PATH, let's just do it
+ // unconditionally.
+ if (path.find(L"\\\\?\\") != 0) {
+ path = wstring(L"\\\\?\\") + path;
+ }
+ // Append "\" if necessary.
+ if (path.back() != '\\') {
+ path.push_back('\\');
+ }
+
+ WIN32_FIND_DATAW metadata;
+ HANDLE handle = ::FindFirstFileW((path + L"*").c_str(), &metadata);
+ if (handle == INVALID_HANDLE_VALUE) {
+ return true; // directory doesn't exist
+ }
+
+ bool result = true;
+ do {
+ wstring childname = metadata.cFileName;
+ if (kDot != childname && kDotDot != childname) {
+ wstring childpath = path + childname;
+ if ((metadata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
+ // If this is not a junction, delete its contents recursively.
+ // Finally delete this directory/junction too.
+ if (((metadata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) == 0 &&
+ !DeleteAllUnder(childpath)) ||
+ !::RemoveDirectoryW(childpath.c_str())) {
+ result = false;
+ break;
+ }
+ } else {
+ if (!::DeleteFileW(childpath.c_str())) {
+ result = false;
+ break;
+ }
+ }
+ }
+ } while (::FindNextFileW(handle, &metadata));
+ ::FindClose(handle);
+ return result;
+}
+
+TEST_F(IoWin32Test, AccessTest) {
+ ASSERT_INITIALIZED;
+
+ string path = test_tmpdir;
+ while (path.size() < MAX_PATH - 30) {
+ path += "\\accesstest";
+ EXPECT_EQ(mkdir(path.c_str(), 0644), 0);
+ }
+ string file = path + "\\file.txt";
+ int fd = open(file.c_str(), O_CREAT | O_WRONLY, 0644);
+ if (fd > 0) {
+ EXPECT_EQ(close(fd), 0);
+ } else {
+ EXPECT_TRUE(false);
+ }
+
+ EXPECT_EQ(access(test_tmpdir.c_str(), F_OK), 0);
+ EXPECT_EQ(access(path.c_str(), F_OK), 0);
+ EXPECT_EQ(access(path.c_str(), W_OK), 0);
+ EXPECT_EQ(access(file.c_str(), F_OK | W_OK), 0);
+ EXPECT_NE(access((file + ".blah").c_str(), F_OK), 0);
+ EXPECT_NE(access((file + ".blah").c_str(), W_OK), 0);
+
+ EXPECT_EQ(access(".", F_OK), 0);
+ EXPECT_EQ(access(".", W_OK), 0);
+ EXPECT_EQ(access((test_tmpdir + "/accesstest").c_str(), F_OK | W_OK), 0);
+ ASSERT_EQ(access((test_tmpdir + "/./normalize_me/.././accesstest").c_str(),
+ F_OK | W_OK),
+ 0);
+ EXPECT_NE(access("io_win32_unittest.AccessTest.nonexistent", F_OK), 0);
+ EXPECT_NE(access("io_win32_unittest.AccessTest.nonexistent", W_OK), 0);
+
+ ASSERT_EQ(access("c:bad", F_OK), -1);
+ ASSERT_EQ(errno, ENOENT);
+ ASSERT_EQ(access("/tmp/bad", F_OK), -1);
+ ASSERT_EQ(errno, ENOENT);
+ ASSERT_EQ(access("\\bad", F_OK), -1);
+ ASSERT_EQ(errno, ENOENT);
+}
+
+TEST_F(IoWin32Test, OpenTest) {
+ ASSERT_INITIALIZED;
+
+ string path = test_tmpdir;
+ while (path.size() < MAX_PATH) {
+ path += "\\opentest";
+ EXPECT_EQ(mkdir(path.c_str(), 0644), 0);
+ }
+ string file = path + "\\file.txt";
+ int fd = open(file.c_str(), O_CREAT | O_WRONLY, 0644);
+ if (fd > 0) {
+ EXPECT_EQ(write(fd, "hello", 5), 5);
+ EXPECT_EQ(close(fd), 0);
+ } else {
+ EXPECT_TRUE(false);
+ }
+
+ ASSERT_EQ(open("c:bad.txt", O_CREAT | O_WRONLY, 0644), -1);
+ ASSERT_EQ(errno, ENOENT);
+ ASSERT_EQ(open("/tmp/bad.txt", O_CREAT | O_WRONLY, 0644), -1);
+ ASSERT_EQ(errno, ENOENT);
+ ASSERT_EQ(open("\\bad.txt", O_CREAT | O_WRONLY, 0644), -1);
+ ASSERT_EQ(errno, ENOENT);
+}
+
+TEST_F(IoWin32Test, MkdirTest) {
+ ASSERT_INITIALIZED;
+
+ string path = test_tmpdir;
+ do {
+ path += "\\mkdirtest";
+ ASSERT_EQ(mkdir(path.c_str(), 0644), 0);
+ } while (path.size() <= MAX_PATH);
+
+ ASSERT_EQ(mkdir("c:bad", 0644), -1);
+ ASSERT_EQ(errno, ENOENT);
+ ASSERT_EQ(mkdir("/tmp/bad", 0644), -1);
+ ASSERT_EQ(errno, ENOENT);
+ ASSERT_EQ(mkdir("\\bad", 0644), -1);
+ ASSERT_EQ(errno, ENOENT);
+}
+
+TEST_F(IoWin32Test, ChdirTest) {
+ char owd[MAX_PATH];
+ EXPECT_GT(::GetCurrentDirectoryA(MAX_PATH, owd), 0);
+ string path("C:\\");
+ EXPECT_EQ(access(path.c_str(), F_OK), 0);
+ ASSERT_EQ(chdir(path.c_str()), 0);
+ EXPECT_TRUE(::SetCurrentDirectoryA(owd));
+
+ // Do not try to chdir into the test_tmpdir, it may already contain directory
+ // names with trailing dots.
+ // Instead test here with an obviously dot-trailed path. If the win32_chdir
+ // function would not convert the path to absolute and prefix with "\\?\" then
+ // the Win32 API would ignore the trailing dot, but because of the prefixing
+ // there'll be no path processing done, so we'll actually attempt to chdir
+ // into "C:\some\path\foo."
+ path = test_tmpdir + "/foo.";
+ EXPECT_EQ(mkdir(path.c_str(), 644), 0);
+ EXPECT_EQ(access(path.c_str(), F_OK), 0);
+ ASSERT_NE(chdir(path.c_str()), 0);
+}
+
+TEST_F(IoWin32Test, AsWindowsPathTest) {
+ DWORD size = GetCurrentDirectoryW(0, NULL);
+ unique_ptr<wchar_t[]> cwd_str(new wchar_t[size]);
+ EXPECT_GT(GetCurrentDirectoryW(size, cwd_str.get()), 0);
+ wstring cwd = wstring(L"\\\\?\\") + cwd_str.get();
+
+ ASSERT_EQ(testonly_path_to_winpath("relative_mkdirtest"),
+ cwd + L"\\relative_mkdirtest");
+ ASSERT_EQ(testonly_path_to_winpath("preserve//\\trailing///"),
+ cwd + L"\\preserve\\trailing\\");
+ ASSERT_EQ(testonly_path_to_winpath("./normalize_me\\/../blah"),
+ cwd + L"\\blah");
+ std::ostringstream relpath;
+ for (wchar_t* p = cwd_str.get(); *p; ++p) {
+ if (*p == '/' || *p == '\\') {
+ relpath << "../";
+ }
+ }
+ relpath << ".\\/../\\./beyond-toplevel";
+ ASSERT_EQ(testonly_path_to_winpath(relpath.str()),
+ wstring(L"\\\\?\\") + cwd_str.get()[0] + L":\\beyond-toplevel");
+
+ // Absolute unix paths lack drive letters, driveless absolute windows paths
+ // do too. Neither can be converted to a drive-specifying absolute Windows
+ // path.
+ ASSERT_EQ(testonly_path_to_winpath("/absolute/unix/path"), L"");
+ // Though valid on Windows, we also don't support UNC paths (\\UNC\\blah).
+ ASSERT_EQ(testonly_path_to_winpath("\\driveless\\absolute"), L"");
+ // Though valid in cmd.exe, drive-relative paths are not supported.
+ ASSERT_EQ(testonly_path_to_winpath("c:foo"), L"");
+ ASSERT_EQ(testonly_path_to_winpath("c:/foo"), L"\\\\?\\c:\\foo");
+}
+
+} // namespace
+} // namespace win32
+} // namespace internal
+} // namespace protobuf
+} // namespace google
+
+#endif // defined(_WIN32)
+
diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h
index 7879aed4..83eaf31e 100644
--- a/src/google/protobuf/stubs/port.h
+++ b/src/google/protobuf/stubs/port.h
@@ -256,8 +256,11 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF);
# define GOOGLE_PROTOBUF_USE_UNALIGNED 0
#else
// x86 and x86-64 can perform unaligned loads/stores directly.
-# define GOOGLE_PROTOBUF_USE_UNALIGNED defined(_M_X64) || \
- defined(__x86_64__) || defined(_M_IX86) || defined(__i386__)
+# if defined(_M_X64) || defined(__x86_64__) || defined(_M_IX86) || defined(__i386__)
+# define GOOGLE_PROTOBUF_USE_UNALIGNED 1
+# else
+# define GOOGLE_PROTOBUF_USE_UNALIGNED 0
+# endif
#endif
#if GOOGLE_PROTOBUF_USE_UNALIGNED
diff --git a/src/google/protobuf/test_messages_proto2.proto b/src/google/protobuf/test_messages_proto2.proto
new file mode 100644
index 00000000..cbe0d170
--- /dev/null
+++ b/src/google/protobuf/test_messages_proto2.proto
@@ -0,0 +1,216 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Test schema for proto2 messages. This test schema is used by:
+//
+// - conformance tests
+//
+
+syntax = "proto2";
+
+package protobuf_test_messages.proto2;
+option java_package = "com.google.protobuf_test_messages.proto2";
+
+// This is the default, but we specify it here explicitly.
+option optimize_for = SPEED;
+
+option cc_enable_arenas = true;
+
+// This proto includes every type of field in both singular and repeated
+// forms.
+//
+// Also, crucially, all messages and enums in this file are eventually
+// submessages of this message. So for example, a fuzz test of TestAllTypes
+// could trigger bugs that occur in any message type in this file. We verify
+// this stays true in a unit test.
+message TestAllTypesProto2 {
+ message NestedMessage {
+ optional int32 a = 1;
+ optional TestAllTypesProto2 corecursive = 2;
+ }
+
+ enum NestedEnum {
+ FOO = 0;
+ BAR = 1;
+ BAZ = 2;
+ NEG = -1; // Intentionally negative.
+ }
+
+ // Singular
+ optional int32 optional_int32 = 1;
+ optional int64 optional_int64 = 2;
+ optional uint32 optional_uint32 = 3;
+ optional uint64 optional_uint64 = 4;
+ optional sint32 optional_sint32 = 5;
+ optional sint64 optional_sint64 = 6;
+ optional fixed32 optional_fixed32 = 7;
+ optional fixed64 optional_fixed64 = 8;
+ optional sfixed32 optional_sfixed32 = 9;
+ optional sfixed64 optional_sfixed64 = 10;
+ optional float optional_float = 11;
+ optional double optional_double = 12;
+ optional bool optional_bool = 13;
+ optional string optional_string = 14;
+ optional bytes optional_bytes = 15;
+
+ optional NestedMessage optional_nested_message = 18;
+ optional ForeignMessage optional_foreign_message = 19;
+
+ optional NestedEnum optional_nested_enum = 21;
+ optional ForeignEnum optional_foreign_enum = 22;
+
+ optional string optional_string_piece = 24 [ctype=STRING_PIECE];
+ optional string optional_cord = 25 [ctype=CORD];
+
+ optional TestAllTypesProto2 recursive_message = 27;
+
+ // Repeated
+ repeated int32 repeated_int32 = 31;
+ repeated int64 repeated_int64 = 32;
+ repeated uint32 repeated_uint32 = 33;
+ repeated uint64 repeated_uint64 = 34;
+ repeated sint32 repeated_sint32 = 35;
+ repeated sint64 repeated_sint64 = 36;
+ repeated fixed32 repeated_fixed32 = 37;
+ repeated fixed64 repeated_fixed64 = 38;
+ repeated sfixed32 repeated_sfixed32 = 39;
+ repeated sfixed64 repeated_sfixed64 = 40;
+ repeated float repeated_float = 41;
+ repeated double repeated_double = 42;
+ repeated bool repeated_bool = 43;
+ repeated string repeated_string = 44;
+ repeated bytes repeated_bytes = 45;
+
+ repeated NestedMessage repeated_nested_message = 48;
+ repeated ForeignMessage repeated_foreign_message = 49;
+
+ repeated NestedEnum repeated_nested_enum = 51;
+ repeated ForeignEnum repeated_foreign_enum = 52;
+
+ repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
+ repeated string repeated_cord = 55 [ctype=CORD];
+
+ // Map
+ map < int32, int32> map_int32_int32 = 56;
+ map < int64, int64> map_int64_int64 = 57;
+ map < uint32, uint32> map_uint32_uint32 = 58;
+ map < uint64, uint64> map_uint64_uint64 = 59;
+ map < sint32, sint32> map_sint32_sint32 = 60;
+ map < sint64, sint64> map_sint64_sint64 = 61;
+ map < fixed32, fixed32> map_fixed32_fixed32 = 62;
+ map < fixed64, fixed64> map_fixed64_fixed64 = 63;
+ map <sfixed32, sfixed32> map_sfixed32_sfixed32 = 64;
+ map <sfixed64, sfixed64> map_sfixed64_sfixed64 = 65;
+ map < int32, float> map_int32_float = 66;
+ map < int32, double> map_int32_double = 67;
+ map < bool, bool> map_bool_bool = 68;
+ map < string, string> map_string_string = 69;
+ map < string, bytes> map_string_bytes = 70;
+ map < string, NestedMessage> map_string_nested_message = 71;
+ map < string, ForeignMessage> map_string_foreign_message = 72;
+ map < string, NestedEnum> map_string_nested_enum = 73;
+ map < string, ForeignEnum> map_string_foreign_enum = 74;
+
+ oneof oneof_field {
+ uint32 oneof_uint32 = 111;
+ NestedMessage oneof_nested_message = 112;
+ string oneof_string = 113;
+ bytes oneof_bytes = 114;
+ bool oneof_bool = 115;
+ uint64 oneof_uint64 = 116;
+ float oneof_float = 117;
+ double oneof_double = 118;
+ NestedEnum oneof_enum = 119;
+ }
+
+ // extensions
+ extensions 120 to 200;
+
+ // groups
+ optional group Data = 201 {
+ optional int32 group_int32 = 202;
+ optional uint32 group_uint32 = 203;
+ };
+
+ // Test field-name-to-JSON-name convention.
+ // (protobuf says names can be any valid C/C++ identifier.)
+ optional int32 fieldname1 = 401;
+ optional int32 field_name2 = 402;
+ optional int32 _field_name3 = 403;
+ optional int32 field__name4_ = 404;
+ optional int32 field0name5 = 405;
+ optional int32 field_0_name6 = 406;
+ optional int32 fieldName7 = 407;
+ optional int32 FieldName8 = 408;
+ optional int32 field_Name9 = 409;
+ optional int32 Field_Name10 = 410;
+ optional int32 FIELD_NAME11 = 411;
+ optional int32 FIELD_name12 = 412;
+ optional int32 __field_name13 = 413;
+ optional int32 __Field_name14 = 414;
+ optional int32 field__name15 = 415;
+ optional int32 field__Name16 = 416;
+ optional int32 field_name17__ = 417;
+ optional int32 Field_name18__ = 418;
+
+ // message_set test case.
+ message MessageSetCorrect {
+ option message_set_wire_format = true;
+ extensions 4 to max;
+ }
+
+ message MessageSetCorrectExtension1 {
+ extend MessageSetCorrect {
+ optional MessageSetCorrectExtension1 message_set_extension = 1547769;
+ }
+ optional string str = 25;
+ }
+
+ message MessageSetCorrectExtension2 {
+ extend MessageSetCorrect {
+ optional MessageSetCorrectExtension2 message_set_extension = 4135312;
+ }
+ optional int32 i = 9;
+ }
+}
+
+message ForeignMessage {
+ optional int32 c = 1;
+}
+
+enum ForeignEnum {
+ FOREIGN_FOO = 0;
+ FOREIGN_BAR = 1;
+ FOREIGN_BAZ = 2;
+}
+
+extend TestAllTypesProto2 {
+ optional int32 extension_int32 = 120;
+}
diff --git a/src/google/protobuf/test_messages_proto3.proto b/src/google/protobuf/test_messages_proto3.proto
index 79230334..84b9da99 100644
--- a/src/google/protobuf/test_messages_proto3.proto
+++ b/src/google/protobuf/test_messages_proto3.proto
@@ -39,6 +39,7 @@ syntax = "proto3";
package protobuf_test_messages.proto3;
option java_package = "com.google.protobuf_test_messages.proto3";
+option objc_class_prefix = "Proto3";
// This is the default, but we specify it here explicitly.
option optimize_for = SPEED;
@@ -59,10 +60,10 @@ option cc_enable_arenas = true;
// submessages of this message. So for example, a fuzz test of TestAllTypes
// could trigger bugs that occur in any message type in this file. We verify
// this stays true in a unit test.
-message TestAllTypes {
+message TestAllTypesProto3 {
message NestedMessage {
int32 a = 1;
- TestAllTypes corecursive = 2;
+ TestAllTypesProto3 corecursive = 2;
}
enum NestedEnum {
@@ -98,7 +99,7 @@ message TestAllTypes {
string optional_string_piece = 24 [ctype=STRING_PIECE];
string optional_cord = 25 [ctype=CORD];
- TestAllTypes recursive_message = 27;
+ TestAllTypesProto3 recursive_message = 27;
// Repeated
repeated int32 repeated_int32 = 31;
diff --git a/src/google/protobuf/testing/file.cc b/src/google/protobuf/testing/file.cc
index 470512ed..a1850e44 100644
--- a/src/google/protobuf/testing/file.cc
+++ b/src/google/protobuf/testing/file.cc
@@ -38,24 +38,28 @@
#ifdef _MSC_VER
#define WIN32_LEAN_AND_MEAN // yeah, right
#include <windows.h> // Find*File(). :(
-#include <io.h>
-#include <direct.h>
+// #include <direct.h>
#else
#include <dirent.h>
#include <unistd.h>
#endif
#include <errno.h>
+#include <google/protobuf/stubs/io_win32.h>
+
namespace google {
namespace protobuf {
#ifdef _WIN32
-#define mkdir(name, mode) mkdir(name)
// Windows doesn't have symbolic links.
#define lstat stat
-#ifndef F_OK
-#define F_OK 00 // not defined by MSVC for whatever reason
-#endif
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::access;
+using google::protobuf::internal::win32::chdir;
+using google::protobuf::internal::win32::fopen;
+using google::protobuf::internal::win32::mkdir;
+using google::protobuf::internal::win32::stat;
#endif
bool File::Exists(const string& name) {
@@ -113,6 +117,9 @@ void File::WriteStringToFileOrDie(const string& contents, const string& name) {
}
bool File::CreateDir(const string& name, int mode) {
+ if (!name.empty()) {
+ GOOGLE_CHECK_OK(name.back() != '.');
+ }
return mkdir(name.c_str(), mode) == 0;
}
diff --git a/src/google/protobuf/testing/googletest.cc b/src/google/protobuf/testing/googletest.cc
index d45706b6..c6fb00d4 100644
--- a/src/google/protobuf/testing/googletest.cc
+++ b/src/google/protobuf/testing/googletest.cc
@@ -33,14 +33,14 @@
#include <google/protobuf/testing/googletest.h>
#include <google/protobuf/testing/file.h>
+#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/strutil.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <stdlib.h>
#ifdef _MSC_VER
-#include <io.h>
-#include <direct.h>
+// #include <direct.h>
#else
#include <unistd.h>
#endif
@@ -53,7 +53,13 @@ namespace google {
namespace protobuf {
#ifdef _WIN32
-#define mkdir(name, mode) mkdir(name)
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::close;
+using google::protobuf::internal::win32::dup2;
+using google::protobuf::internal::win32::dup;
+using google::protobuf::internal::win32::mkdir;
+using google::protobuf::internal::win32::open;
#endif
#ifndef O_BINARY
@@ -111,14 +117,32 @@ string GetTemporaryDirectoryName() {
char b[L_tmpnam + 1]; // HPUX multithread return 0 if s is 0
string result = tmpnam(b);
#ifdef _WIN32
+ // Avoid a trailing dot by changing it to an underscore. On Win32 the names of
+ // files and directories can, but should not, end with dot.
+ //
+ // In MS-DOS and FAT16 filesystem the filenames were 8dot3 style so it didn't
+ // make sense to have a name ending in dot without an extension, so the shell
+ // silently ignored trailing dots. To this day the Win32 API still maintains
+ // this behavior and silently ignores trailing dots in path arguments of
+ // functions such as CreateFile{A,W}. Even POSIX API function implementations
+ // seem to wrap the Win32 API functions (e.g. CreateDirectoryA) and behave
+ // this way.
+ // It's possible to avoid this behavior and create files / directories with
+ // trailing dots (using CreateFileW / CreateDirectoryW and prefixing the path
+ // with "\\?\") but these will be degenerate in the sense that you cannot
+ // chdir into such directories (or navigate into them with Windows Explorer)
+ // nor can you open such files with some programs (e.g. Notepad).
+ if (result.back() == '.') {
+ result[result.size() - 1] = '_';
+ }
// On Win32, tmpnam() returns a file prefixed with '\', but which is supposed
// to be used in the current working directory. WTF?
if (HasPrefixString(result, "\\")) {
result.erase(0, 1);
}
- // The Win32 API accepts forward slashes as a path delimiter even though
- // backslashes are standard. Let's avoid confusion and use only forward
- // slashes.
+ // The Win32 API accepts forward slashes as a path delimiter as long as the
+ // path doesn't use the "\\?\" prefix.
+ // Let's avoid confusion and use only forward slashes.
result = StringReplace(result, "\\", "/", true);
#endif // _WIN32
return result;
diff --git a/src/google/protobuf/testing/googletest.h b/src/google/protobuf/testing/googletest.h
index c0d99e69..bf8bf282 100644
--- a/src/google/protobuf/testing/googletest.h
+++ b/src/google/protobuf/testing/googletest.h
@@ -85,7 +85,7 @@ class ScopedMemoryLog {
const vector<string>& GetMessages(LogLevel error);
private:
- map<LogLevel, vector<string> > messages_;
+ std::map<LogLevel, vector<string> > messages_;
LogHandler* old_handler_;
static void HandleLog(LogLevel level, const char* filename, int line,
diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc
index 80ddc5bf..7c9d396e 100644
--- a/src/google/protobuf/timestamp.pb.cc
+++ b/src/google/protobuf/timestamp.pb.cc
@@ -102,6 +102,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -118,12 +119,13 @@ void AddDescriptorsImpl() {
"google/protobuf/timestamp.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -151,9 +153,7 @@ Timestamp::Timestamp()
Timestamp::Timestamp(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Timestamp)
@@ -301,6 +301,7 @@ void Timestamp::SerializeWithCachedSizes(
::google::protobuf::uint8* Timestamp::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Timestamp)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h
index 98478540..9ce2c96a 100644
--- a/src/google/protobuf/timestamp.pb.h
+++ b/src/google/protobuf/timestamp.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc
index 8a53d76a..fe422087 100644
--- a/src/google/protobuf/type.pb.cc
+++ b/src/google/protobuf/type.pb.cc
@@ -187,6 +187,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -239,12 +240,13 @@ void AddDescriptorsImpl() {
::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors();
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -406,9 +408,7 @@ Type::Type(::google::protobuf::Arena* arena)
fields_(arena),
oneofs_(arena),
options_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Type)
@@ -670,6 +670,7 @@ void Type::SerializeWithCachedSizes(
::google::protobuf::uint8* Type::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Type)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1170,9 +1171,7 @@ Field::Field(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena),
options_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Field)
@@ -1538,6 +1537,7 @@ void Field::SerializeWithCachedSizes(
::google::protobuf::uint8* Field::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Field)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -2243,9 +2243,7 @@ Enum::Enum(::google::protobuf::Arena* arena)
_internal_metadata_(arena),
enumvalue_(arena),
options_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Enum)
@@ -2478,6 +2476,7 @@ void Enum::SerializeWithCachedSizes(
::google::protobuf::uint8* Enum::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Enum)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -2882,9 +2881,7 @@ EnumValue::EnumValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena),
options_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.EnumValue)
@@ -3062,6 +3059,7 @@ void EnumValue::SerializeWithCachedSizes(
::google::protobuf::uint8* EnumValue::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -3377,9 +3375,7 @@ Option::Option()
Option::Option(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2ftype_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Option)
@@ -3545,6 +3541,7 @@ void Option::SerializeWithCachedSizes(
::google::protobuf::uint8* Option::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Option)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h
index 5ac80bb9..1138988d 100644
--- a/src/google/protobuf/type.pb.h
+++ b/src/google/protobuf/type.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.
diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc
index 245f7653..8b8dc150 100644
--- a/src/google/protobuf/wrappers.pb.cc
+++ b/src/google/protobuf/wrappers.pb.cc
@@ -213,6 +213,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -235,12 +236,13 @@ void AddDescriptorsImpl() {
"google/protobuf/wrappers.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
-// Force AddDescriptors() to be called at static initialization time.
+// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
@@ -267,9 +269,7 @@ DoubleValue::DoubleValue()
DoubleValue::DoubleValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.DoubleValue)
@@ -392,6 +392,7 @@ void DoubleValue::SerializeWithCachedSizes(
::google::protobuf::uint8* DoubleValue::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DoubleValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -531,9 +532,7 @@ FloatValue::FloatValue()
FloatValue::FloatValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.FloatValue)
@@ -656,6 +655,7 @@ void FloatValue::SerializeWithCachedSizes(
::google::protobuf::uint8* FloatValue::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FloatValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -795,9 +795,7 @@ Int64Value::Int64Value()
Int64Value::Int64Value(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Int64Value)
@@ -920,6 +918,7 @@ void Int64Value::SerializeWithCachedSizes(
::google::protobuf::uint8* Int64Value::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int64Value)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1061,9 +1060,7 @@ UInt64Value::UInt64Value()
UInt64Value::UInt64Value(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.UInt64Value)
@@ -1186,6 +1183,7 @@ void UInt64Value::SerializeWithCachedSizes(
::google::protobuf::uint8* UInt64Value::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt64Value)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1327,9 +1325,7 @@ Int32Value::Int32Value()
Int32Value::Int32Value(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.Int32Value)
@@ -1452,6 +1448,7 @@ void Int32Value::SerializeWithCachedSizes(
::google::protobuf::uint8* Int32Value::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Int32Value)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1593,9 +1590,7 @@ UInt32Value::UInt32Value()
UInt32Value::UInt32Value(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.UInt32Value)
@@ -1718,6 +1713,7 @@ void UInt32Value::SerializeWithCachedSizes(
::google::protobuf::uint8* UInt32Value::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UInt32Value)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -1859,9 +1855,7 @@ BoolValue::BoolValue()
BoolValue::BoolValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.BoolValue)
@@ -1984,6 +1978,7 @@ void BoolValue::SerializeWithCachedSizes(
::google::protobuf::uint8* BoolValue::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BoolValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -2123,9 +2118,7 @@ StringValue::StringValue()
StringValue::StringValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.StringValue)
@@ -2260,6 +2253,7 @@ void StringValue::SerializeWithCachedSizes(
::google::protobuf::uint8* StringValue::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.StringValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@@ -2460,9 +2454,7 @@ BytesValue::BytesValue()
BytesValue::BytesValue(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
-#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
protobuf_google_2fprotobuf_2fwrappers_2eproto::InitDefaults();
-#endif // GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:google.protobuf.BytesValue)
@@ -2589,6 +2581,7 @@ void BytesValue::SerializeWithCachedSizes(
::google::protobuf::uint8* BytesValue::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
+ (void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.protobuf.BytesValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h
index 4202541b..7495aa68 100644
--- a/src/google/protobuf/wrappers.pb.h
+++ b/src/google/protobuf/wrappers.pb.h
@@ -13,7 +13,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
-#if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 3003002 < GOOGLE_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.