diff --git a/cmake/conformance.cmake b/cmake/conformance.cmake index 056b5d0c60..b9485ff9d0 100644 --- a/cmake/conformance.cmake +++ b/cmake/conformance.cmake @@ -19,22 +19,22 @@ add_custom_command( ) add_executable(conformance_test_runner - ${protobuf_source_dir}/conformance/conformance.pb.cc - ${protobuf_source_dir}/conformance/conformance_test.cc ${protobuf_source_dir}/conformance/binary_json_conformance_suite.cc ${protobuf_source_dir}/conformance/binary_json_conformance_suite.h + ${protobuf_source_dir}/conformance/conformance.pb.cc + ${protobuf_source_dir}/conformance/conformance_test.cc ${protobuf_source_dir}/conformance/conformance_test_runner.cc ${protobuf_source_dir}/conformance/third_party/jsoncpp/json.h ${protobuf_source_dir}/conformance/third_party/jsoncpp/jsoncpp.cpp - ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc + ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc ) add_executable(conformance_cpp ${protobuf_source_dir}/conformance/conformance.pb.cc ${protobuf_source_dir}/conformance/conformance_cpp.cc - ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc + ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc ) target_include_directories( diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake index 379f3dceaf..b9caa83578 100644 --- a/cmake/libprotobuf-lite.cmake +++ b/cmake/libprotobuf-lite.cmake @@ -37,13 +37,13 @@ set(libprotobuf_lite_includes ${protobuf_source_dir}/src/google/protobuf/extension_set.h ${protobuf_source_dir}/src/google/protobuf/generated_message_util.h ${protobuf_source_dir}/src/google/protobuf/implicit_weak_message.h - ${protobuf_source_dir}/src/google/protobuf/parse_context.h ${protobuf_source_dir}/src/google/protobuf/io/coded_stream.h ${protobuf_source_dir}/src/google/protobuf/io/strtod.h ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.h ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl.h ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.h ${protobuf_source_dir}/src/google/protobuf/message_lite.h + ${protobuf_source_dir}/src/google/protobuf/parse_context.h ${protobuf_source_dir}/src/google/protobuf/repeated_field.h ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.h ${protobuf_source_dir}/src/google/protobuf/stubs/common.h diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake index f5a70becb2..d394467332 100644 --- a/cmake/libprotobuf.cmake +++ b/cmake/libprotobuf.cmake @@ -11,8 +11,8 @@ set(libprotobuf_files ${protobuf_source_dir}/src/google/protobuf/dynamic_message.cc ${protobuf_source_dir}/src/google/protobuf/empty.pb.cc ${protobuf_source_dir}/src/google/protobuf/extension_set_heavy.cc - ${protobuf_source_dir}/src/google/protobuf/field_access_listener.cc ${protobuf_source_dir}/src/google/protobuf/field_mask.pb.cc + ${protobuf_source_dir}/src/google/protobuf/generated_message_bases.cc ${protobuf_source_dir}/src/google/protobuf/generated_message_reflection.cc ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven.cc ${protobuf_source_dir}/src/google/protobuf/io/gzip_stream.cc @@ -68,6 +68,7 @@ set(libprotobuf_includes ${protobuf_source_dir}/src/google/protobuf/empty.pb.h ${protobuf_source_dir}/src/google/protobuf/field_access_listener.h ${protobuf_source_dir}/src/google/protobuf/field_mask.pb.h + ${protobuf_source_dir}/src/google/protobuf/generated_message_bases.h ${protobuf_source_dir}/src/google/protobuf/generated_message_reflection.h ${protobuf_source_dir}/src/google/protobuf/io/gzip_stream.h ${protobuf_source_dir}/src/google/protobuf/io/printer.h diff --git a/cmake/tests.cmake b/cmake/tests.cmake index 70e1015bf8..801c994fd2 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -132,6 +132,7 @@ set(tests_files ${protobuf_source_dir}/src/google/protobuf/arena_unittest.cc ${protobuf_source_dir}/src/google/protobuf/arenastring_unittest.cc ${protobuf_source_dir}/src/google/protobuf/compiler/annotation_test_util.cc + ${protobuf_source_dir}/src/google/protobuf/compiler/command_line_interface_unittest.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_move_unittest.cc ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc @@ -205,21 +206,12 @@ set(tests_files ${protobuf_source_dir}/src/google/protobuf/wire_format_unittest.inc ) -set(non_msvc_tests_files - ${protobuf_source_dir}/src/google/protobuf/compiler/command_line_interface_unittest.cc -) - -set(all_tests_files - ${tests_files} - ${non_msvc_tests_files} -) - if(protobuf_ABSOLUTE_TEST_PLUGIN_PATH) add_compile_options(-DGOOGLE_PROTOBUF_TEST_PLUGIN_PATH="$") endif() if(MINGW) - set_source_files_properties(${all_tests_files} PROPERTIES COMPILE_FLAGS "-Wno-narrowing") + set_source_files_properties(${tests_files} PROPERTIES COMPILE_FLAGS "-Wno-narrowing") # required for tests on MinGW Win64 if (CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -229,14 +221,14 @@ if(MINGW) endif() -add_executable(tests ${all_tests_files} ${common_test_files} ${tests_proto_files} ${lite_test_proto_files}) +add_executable(tests ${tests_files} ${common_test_files} ${tests_proto_files} ${lite_test_proto_files}) target_link_libraries(tests libprotoc libprotobuf gmock_main) set(test_plugin_files ${protobuf_source_dir}/src/google/protobuf/compiler/mock_code_generator.cc + ${protobuf_source_dir}/src/google/protobuf/compiler/test_plugin.cc ${protobuf_source_dir}/src/google/protobuf/testing/file.cc ${protobuf_source_dir}/src/google/protobuf/testing/file.h - ${protobuf_source_dir}/src/google/protobuf/compiler/test_plugin.cc ) add_executable(test_plugin ${test_plugin_files}) diff --git a/java/core/src/main/java/com/google/protobuf/FieldSet.java b/java/core/src/main/java/com/google/protobuf/FieldSet.java index f64b50a839..4853df2837 100644 --- a/java/core/src/main/java/com/google/protobuf/FieldSet.java +++ b/java/core/src/main/java/com/google/protobuf/FieldSet.java @@ -832,8 +832,6 @@ final class FieldSet> { */ static int computeElementSizeNoTag(final WireFormat.FieldType type, final Object value) { switch (type) { - // Note: Minor violation of 80-char limit rule here because this would - // actually be harder to read if we wrapped the lines. case DOUBLE: return CodedOutputStream.computeDoubleSizeNoTag((Double) value); case FLOAT: diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc index eeb844c2dc..8c326efa81 100644 --- a/python/google/protobuf/pyext/descriptor.cc +++ b/python/google/protobuf/pyext/descriptor.cc @@ -913,8 +913,9 @@ static int SetContainingType(PyBaseDescriptor *self, PyObject *value, } static PyObject* GetExtensionScope(PyBaseDescriptor *self, void *closure) { + const auto* desc = _GetDescriptor(self); const Descriptor* extension_scope = - _GetDescriptor(self)->extension_scope(); + desc->is_extension() ? desc->extension_scope() : nullptr; if (extension_scope) { return PyMessageDescriptor_FromDescriptor(extension_scope); } else { diff --git a/src/Makefile.am b/src/Makefile.am index 2d5f5074a8..538681072d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,18 +39,19 @@ protodir = $(includedir) # If you are adding new files here, also remember to change the build files for # all other languages, //protoc-artifacts/build-zip.sh and run # //update_file_list.sh for bazel. -nobase_dist_proto_DATA = google/protobuf/descriptor.proto \ - google/protobuf/any.proto \ - google/protobuf/api.proto \ - google/protobuf/duration.proto \ - google/protobuf/empty.proto \ - google/protobuf/field_mask.proto \ - google/protobuf/source_context.proto \ - google/protobuf/struct.proto \ - google/protobuf/timestamp.proto \ - google/protobuf/type.proto \ - google/protobuf/wrappers.proto \ - google/protobuf/compiler/plugin.proto +nobase_dist_proto_DATA = \ + google/protobuf/any.proto \ + google/protobuf/api.proto \ + google/protobuf/compiler/plugin.proto \ + google/protobuf/descriptor.proto \ + google/protobuf/duration.proto \ + google/protobuf/empty.proto \ + google/protobuf/field_mask.proto \ + google/protobuf/source_context.proto \ + google/protobuf/struct.proto \ + google/protobuf/timestamp.proto \ + google/protobuf/type.proto \ + google/protobuf/wrappers.proto # Not sure why these don't get cleaned automatically. clean-local: @@ -64,32 +65,34 @@ MAINTAINERCLEANFILES = \ Makefile.in nobase_include_HEADERS = \ - google/protobuf/stubs/callback.h \ - google/protobuf/stubs/bytestream.h \ - google/protobuf/stubs/casts.h \ - google/protobuf/stubs/common.h \ - google/protobuf/stubs/hash.h \ - google/protobuf/stubs/logging.h \ - google/protobuf/stubs/macros.h \ - google/protobuf/stubs/map_util.h \ - google/protobuf/stubs/mutex.h \ - google/protobuf/stubs/once.h \ - google/protobuf/stubs/platform_macros.h \ - google/protobuf/stubs/port.h \ - google/protobuf/stubs/status.h \ - google/protobuf/stubs/stl_util.h \ - google/protobuf/stubs/stringpiece.h \ - google/protobuf/stubs/strutil.h \ - google/protobuf/stubs/template_util.h \ + google/protobuf/any.h \ google/protobuf/any.pb.h \ google/protobuf/api.pb.h \ - google/protobuf/any.h \ google/protobuf/arena.h \ google/protobuf/arena_impl.h \ google/protobuf/arenastring.h \ - google/protobuf/descriptor_database.h \ + google/protobuf/compiler/code_generator.h \ + google/protobuf/compiler/command_line_interface.h \ + google/protobuf/compiler/cpp/cpp_generator.h \ + google/protobuf/compiler/csharp/csharp_generator.h \ + google/protobuf/compiler/csharp/csharp_names.h \ + google/protobuf/compiler/importer.h \ + google/protobuf/compiler/java/java_generator.h \ + google/protobuf/compiler/java/java_kotlin_generator.h \ + google/protobuf/compiler/java/java_names.h \ + google/protobuf/compiler/js/js_generator.h \ + google/protobuf/compiler/js/well_known_types_embed.h \ + google/protobuf/compiler/objectivec/objectivec_generator.h \ + google/protobuf/compiler/objectivec/objectivec_helpers.h \ + google/protobuf/compiler/parser.h \ + google/protobuf/compiler/php/php_generator.h \ + google/protobuf/compiler/plugin.h \ + google/protobuf/compiler/plugin.pb.h \ + google/protobuf/compiler/python/python_generator.h \ + google/protobuf/compiler/ruby/ruby_generator.h \ google/protobuf/descriptor.h \ google/protobuf/descriptor.pb.h \ + google/protobuf/descriptor_database.h \ google/protobuf/duration.pb.h \ google/protobuf/dynamic_message.h \ google/protobuf/empty.pb.h \ @@ -99,6 +102,7 @@ nobase_include_HEADERS = \ google/protobuf/field_mask.pb.h \ google/protobuf/generated_enum_reflection.h \ google/protobuf/generated_enum_util.h \ + google/protobuf/generated_message_bases.h \ google/protobuf/generated_message_reflection.h \ google/protobuf/generated_message_table_driven.h \ google/protobuf/generated_message_tctable_decl.h \ @@ -108,22 +112,30 @@ nobase_include_HEADERS = \ google/protobuf/has_bits.h \ google/protobuf/implicit_weak_message.h \ google/protobuf/inlined_string_field.h \ - google/protobuf/io/io_win32.h \ + google/protobuf/io/coded_stream.h \ + $(GZHEADERS) \ + google/protobuf/io/io_win32.h \ + google/protobuf/io/printer.h \ + google/protobuf/io/strtod.h \ + google/protobuf/io/tokenizer.h \ + google/protobuf/io/zero_copy_stream.h \ + google/protobuf/io/zero_copy_stream_impl.h \ + google/protobuf/io/zero_copy_stream_impl_lite.h \ + google/protobuf/map.h \ google/protobuf/map_entry.h \ google/protobuf/map_entry_lite.h \ google/protobuf/map_field.h \ google/protobuf/map_field_inl.h \ google/protobuf/map_field_lite.h \ - google/protobuf/map.h \ google/protobuf/map_type_handler.h \ google/protobuf/message.h \ google/protobuf/message_lite.h \ google/protobuf/metadata.h \ google/protobuf/metadata_lite.h \ google/protobuf/parse_context.h \ - google/protobuf/port.h \ google/protobuf/port_def.inc \ google/protobuf/port_undef.inc \ + google/protobuf/port.h \ google/protobuf/reflection.h \ google/protobuf/reflection_ops.h \ google/protobuf/repeated_field.h \ @@ -131,48 +143,38 @@ nobase_include_HEADERS = \ google/protobuf/source_context.pb.h \ google/protobuf/string_member_robber.h \ google/protobuf/struct.pb.h \ + google/protobuf/stubs/bytestream.h \ + google/protobuf/stubs/callback.h \ + google/protobuf/stubs/casts.h \ + google/protobuf/stubs/common.h \ + google/protobuf/stubs/hash.h \ + google/protobuf/stubs/logging.h \ + google/protobuf/stubs/macros.h \ + google/protobuf/stubs/map_util.h \ + google/protobuf/stubs/mutex.h \ + google/protobuf/stubs/once.h \ + google/protobuf/stubs/platform_macros.h \ + google/protobuf/stubs/port.h \ + google/protobuf/stubs/status.h \ + google/protobuf/stubs/stl_util.h \ + google/protobuf/stubs/stringpiece.h \ + google/protobuf/stubs/strutil.h \ + google/protobuf/stubs/template_util.h \ google/protobuf/text_format.h \ google/protobuf/timestamp.pb.h \ google/protobuf/type.pb.h \ google/protobuf/unknown_field_set.h \ - google/protobuf/wire_format.h \ - google/protobuf/wire_format_lite.h \ - google/protobuf/wrappers.pb.h \ - google/protobuf/io/coded_stream.h \ - $(GZHEADERS) \ - google/protobuf/io/printer.h \ - google/protobuf/io/strtod.h \ - google/protobuf/io/tokenizer.h \ - google/protobuf/io/zero_copy_stream.h \ - google/protobuf/io/zero_copy_stream_impl.h \ - google/protobuf/io/zero_copy_stream_impl_lite.h \ - google/protobuf/compiler/code_generator.h \ - google/protobuf/compiler/command_line_interface.h \ - google/protobuf/compiler/importer.h \ - google/protobuf/compiler/parser.h \ - google/protobuf/compiler/plugin.h \ - google/protobuf/compiler/plugin.pb.h \ - google/protobuf/compiler/cpp/cpp_generator.h \ - google/protobuf/compiler/csharp/csharp_generator.h \ - google/protobuf/compiler/csharp/csharp_names.h \ - google/protobuf/compiler/java/java_generator.h \ - google/protobuf/compiler/java/java_kotlin_generator.h \ - google/protobuf/compiler/java/java_names.h \ - google/protobuf/compiler/js/js_generator.h \ - google/protobuf/compiler/js/well_known_types_embed.h \ - google/protobuf/compiler/objectivec/objectivec_generator.h \ - google/protobuf/compiler/objectivec/objectivec_helpers.h \ - google/protobuf/compiler/php/php_generator.h \ - google/protobuf/compiler/python/python_generator.h \ - google/protobuf/compiler/ruby/ruby_generator.h \ - google/protobuf/util/type_resolver.h \ google/protobuf/util/delimited_message_util.h \ google/protobuf/util/field_comparator.h \ google/protobuf/util/field_mask_util.h \ google/protobuf/util/json_util.h \ + google/protobuf/util/message_differencer.h \ google/protobuf/util/time_util.h \ + google/protobuf/util/type_resolver.h \ google/protobuf/util/type_resolver_util.h \ - google/protobuf/util/message_differencer.h + google/protobuf/wire_format.h \ + google/protobuf/wire_format_lite.h \ + google/protobuf/wrappers.pb.h lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la @@ -183,18 +185,37 @@ libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.m EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map endif libprotobuf_lite_la_SOURCES = \ + google/protobuf/any_lite.cc \ + google/protobuf/arena.cc \ + google/protobuf/arenastring.cc \ + google/protobuf/extension_set.cc \ + google/protobuf/generated_enum_util.cc \ + google/protobuf/generated_message_table_driven_lite.cc \ + google/protobuf/generated_message_table_driven_lite.h \ + google/protobuf/generated_message_util.cc \ + google/protobuf/implicit_weak_message.cc \ + google/protobuf/inlined_string_field.cc \ + google/protobuf/io/coded_stream.cc \ + google/protobuf/io/io_win32.cc \ + google/protobuf/io/strtod.cc \ + google/protobuf/io/zero_copy_stream.cc \ + google/protobuf/io/zero_copy_stream_impl.cc \ + google/protobuf/io/zero_copy_stream_impl_lite.cc \ + google/protobuf/map.cc \ + google/protobuf/message_lite.cc \ + google/protobuf/parse_context.cc \ + google/protobuf/repeated_field.cc \ google/protobuf/stubs/bytestream.cc \ google/protobuf/stubs/bytestream.h \ google/protobuf/stubs/common.cc \ google/protobuf/stubs/hash.h \ google/protobuf/stubs/int128.cc \ google/protobuf/stubs/int128.h \ - google/protobuf/io/io_win32.cc \ google/protobuf/stubs/map_util.h \ google/protobuf/stubs/mathutil.h \ + google/protobuf/stubs/status_macros.h \ google/protobuf/stubs/status.cc \ google/protobuf/stubs/status.h \ - google/protobuf/stubs/status_macros.h \ google/protobuf/stubs/statusor.cc \ google/protobuf/stubs/statusor.h \ google/protobuf/stubs/stringpiece.cc \ @@ -205,26 +226,7 @@ libprotobuf_lite_la_SOURCES = \ google/protobuf/stubs/strutil.cc \ google/protobuf/stubs/time.cc \ google/protobuf/stubs/time.h \ - google/protobuf/any_lite.cc \ - google/protobuf/arena.cc \ - google/protobuf/arenastring.cc \ - google/protobuf/extension_set.cc \ - google/protobuf/generated_enum_util.cc \ - google/protobuf/generated_message_util.cc \ - google/protobuf/generated_message_table_driven_lite.h \ - google/protobuf/generated_message_table_driven_lite.cc \ - google/protobuf/implicit_weak_message.cc \ - google/protobuf/inlined_string_field.cc \ - google/protobuf/map.cc \ - google/protobuf/message_lite.cc \ - google/protobuf/parse_context.cc \ - google/protobuf/repeated_field.cc \ - google/protobuf/wire_format_lite.cc \ - google/protobuf/io/coded_stream.cc \ - google/protobuf/io/strtod.cc \ - google/protobuf/io/zero_copy_stream.cc \ - google/protobuf/io/zero_copy_stream_impl.cc \ - google/protobuf/io/zero_copy_stream_impl_lite.cc + google/protobuf/wire_format_lite.cc libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS) libprotobuf_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined @@ -234,21 +236,27 @@ EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map endif libprotobuf_la_SOURCES = \ $(libprotobuf_lite_la_SOURCES) \ + google/protobuf/any.cc \ google/protobuf/any.pb.cc \ google/protobuf/api.pb.cc \ - google/protobuf/any.cc \ + google/protobuf/compiler/importer.cc \ + google/protobuf/compiler/parser.cc \ google/protobuf/descriptor.cc \ - google/protobuf/descriptor_database.cc \ google/protobuf/descriptor.pb.cc \ + google/protobuf/descriptor_database.cc \ google/protobuf/duration.pb.cc \ google/protobuf/dynamic_message.cc \ google/protobuf/empty.pb.cc \ google/protobuf/extension_set_heavy.cc \ google/protobuf/field_access_listener.cc \ google/protobuf/field_mask.pb.cc \ + google/protobuf/generated_message_bases.cc \ google/protobuf/generated_message_reflection.cc \ - google/protobuf/generated_message_table_driven_lite.h \ google/protobuf/generated_message_table_driven.cc \ + google/protobuf/generated_message_table_driven_lite.h \ + google/protobuf/io/gzip_stream.cc \ + google/protobuf/io/printer.cc \ + google/protobuf/io/tokenizer.cc \ google/protobuf/map_field.cc \ google/protobuf/message.cc \ google/protobuf/reflection_internal.h \ @@ -262,13 +270,6 @@ libprotobuf_la_SOURCES = \ google/protobuf/timestamp.pb.cc \ google/protobuf/type.pb.cc \ google/protobuf/unknown_field_set.cc \ - google/protobuf/wire_format.cc \ - google/protobuf/wrappers.pb.cc \ - google/protobuf/io/gzip_stream.cc \ - google/protobuf/io/printer.cc \ - google/protobuf/io/tokenizer.cc \ - google/protobuf/compiler/importer.cc \ - google/protobuf/compiler/parser.cc \ google/protobuf/util/delimited_message_util.cc \ google/protobuf/util/field_comparator.cc \ google/protobuf/util/field_mask_util.cc \ @@ -294,12 +295,12 @@ libprotobuf_la_SOURCES = \ google/protobuf/util/internal/object_source.h \ google/protobuf/util/internal/object_writer.cc \ google/protobuf/util/internal/object_writer.h \ + google/protobuf/util/internal/proto_writer.cc \ + google/protobuf/util/internal/proto_writer.h \ google/protobuf/util/internal/protostream_objectsource.cc \ google/protobuf/util/internal/protostream_objectsource.h \ google/protobuf/util/internal/protostream_objectwriter.cc \ google/protobuf/util/internal/protostream_objectwriter.h \ - google/protobuf/util/internal/proto_writer.cc \ - google/protobuf/util/internal/proto_writer.h \ google/protobuf/util/internal/structured_objectwriter.h \ google/protobuf/util/internal/type_info.cc \ google/protobuf/util/internal/type_info.h \ @@ -310,7 +311,9 @@ libprotobuf_la_SOURCES = \ google/protobuf/util/json_util.cc \ google/protobuf/util/message_differencer.cc \ google/protobuf/util/time_util.cc \ - google/protobuf/util/type_resolver_util.cc + google/protobuf/util/type_resolver_util.cc \ + google/protobuf/wire_format.cc \ + google/protobuf/wrappers.pb.cc nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES) @@ -323,13 +326,6 @@ endif libprotoc_la_SOURCES = \ google/protobuf/compiler/code_generator.cc \ google/protobuf/compiler/command_line_interface.cc \ - google/protobuf/compiler/plugin.cc \ - google/protobuf/compiler/plugin.pb.cc \ - google/protobuf/compiler/scc.h \ - google/protobuf/compiler/subprocess.cc \ - google/protobuf/compiler/subprocess.h \ - google/protobuf/compiler/zip_writer.cc \ - google/protobuf/compiler/zip_writer.h \ google/protobuf/compiler/cpp/cpp_enum.cc \ google/protobuf/compiler/cpp/cpp_enum.h \ google/protobuf/compiler/cpp/cpp_enum_field.cc \ @@ -362,15 +358,49 @@ libprotoc_la_SOURCES = \ google/protobuf/compiler/cpp/cpp_service.h \ google/protobuf/compiler/cpp/cpp_string_field.cc \ google/protobuf/compiler/cpp/cpp_string_field.h \ + google/protobuf/compiler/csharp/csharp_doc_comment.cc \ + google/protobuf/compiler/csharp/csharp_doc_comment.h \ + google/protobuf/compiler/csharp/csharp_enum.cc \ + google/protobuf/compiler/csharp/csharp_enum.h \ + google/protobuf/compiler/csharp/csharp_enum_field.cc \ + google/protobuf/compiler/csharp/csharp_enum_field.h \ + google/protobuf/compiler/csharp/csharp_field_base.cc \ + google/protobuf/compiler/csharp/csharp_field_base.h \ + google/protobuf/compiler/csharp/csharp_generator.cc \ + google/protobuf/compiler/csharp/csharp_helpers.cc \ + google/protobuf/compiler/csharp/csharp_helpers.h \ + google/protobuf/compiler/csharp/csharp_map_field.cc \ + google/protobuf/compiler/csharp/csharp_map_field.h \ + google/protobuf/compiler/csharp/csharp_message.cc \ + google/protobuf/compiler/csharp/csharp_message.h \ + google/protobuf/compiler/csharp/csharp_message_field.cc \ + google/protobuf/compiler/csharp/csharp_message_field.h \ + google/protobuf/compiler/csharp/csharp_options.h \ + google/protobuf/compiler/csharp/csharp_primitive_field.cc \ + google/protobuf/compiler/csharp/csharp_primitive_field.h \ + google/protobuf/compiler/csharp/csharp_reflection_class.cc \ + google/protobuf/compiler/csharp/csharp_reflection_class.h \ + google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc \ + google/protobuf/compiler/csharp/csharp_repeated_enum_field.h \ + google/protobuf/compiler/csharp/csharp_repeated_message_field.cc \ + google/protobuf/compiler/csharp/csharp_repeated_message_field.h \ + google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc \ + google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h \ + google/protobuf/compiler/csharp/csharp_source_generator_base.cc \ + google/protobuf/compiler/csharp/csharp_source_generator_base.h \ + google/protobuf/compiler/csharp/csharp_wrapper_field.cc \ + google/protobuf/compiler/csharp/csharp_wrapper_field.h \ google/protobuf/compiler/java/java_context.cc \ google/protobuf/compiler/java/java_context.h \ + google/protobuf/compiler/java/java_doc_comment.cc \ + google/protobuf/compiler/java/java_doc_comment.h \ google/protobuf/compiler/java/java_enum.cc \ - google/protobuf/compiler/java/java_enum_lite.cc \ + google/protobuf/compiler/java/java_enum.h \ google/protobuf/compiler/java/java_enum_field.cc \ google/protobuf/compiler/java/java_enum_field.h \ google/protobuf/compiler/java/java_enum_field_lite.cc \ google/protobuf/compiler/java/java_enum_field_lite.h \ - google/protobuf/compiler/java/java_enum.h \ + google/protobuf/compiler/java/java_enum_lite.cc \ google/protobuf/compiler/java/java_enum_lite.h \ google/protobuf/compiler/java/java_extension.cc \ google/protobuf/compiler/java/java_extension.h \ @@ -391,17 +421,17 @@ libprotoc_la_SOURCES = \ google/protobuf/compiler/java/java_map_field_lite.cc \ google/protobuf/compiler/java/java_map_field_lite.h \ google/protobuf/compiler/java/java_message.cc \ - google/protobuf/compiler/java/java_message_lite.cc \ + google/protobuf/compiler/java/java_message.h \ google/protobuf/compiler/java/java_message_builder.cc \ + google/protobuf/compiler/java/java_message_builder.h \ google/protobuf/compiler/java/java_message_builder_lite.cc \ + google/protobuf/compiler/java/java_message_builder_lite.h \ google/protobuf/compiler/java/java_message_field.cc \ google/protobuf/compiler/java/java_message_field.h \ google/protobuf/compiler/java/java_message_field_lite.cc \ google/protobuf/compiler/java/java_message_field_lite.h \ - google/protobuf/compiler/java/java_message.h \ + google/protobuf/compiler/java/java_message_lite.cc \ google/protobuf/compiler/java/java_message_lite.h \ - google/protobuf/compiler/java/java_message_builder.h \ - google/protobuf/compiler/java/java_message_builder_lite.h \ google/protobuf/compiler/java/java_name_resolver.cc \ google/protobuf/compiler/java/java_name_resolver.h \ google/protobuf/compiler/java/java_options.h \ @@ -409,16 +439,14 @@ libprotoc_la_SOURCES = \ google/protobuf/compiler/java/java_primitive_field.h \ google/protobuf/compiler/java/java_primitive_field_lite.cc \ google/protobuf/compiler/java/java_primitive_field_lite.h \ - google/protobuf/compiler/java/java_shared_code_generator.cc \ - google/protobuf/compiler/java/java_shared_code_generator.h \ google/protobuf/compiler/java/java_service.cc \ google/protobuf/compiler/java/java_service.h \ + google/protobuf/compiler/java/java_shared_code_generator.cc \ + google/protobuf/compiler/java/java_shared_code_generator.h \ google/protobuf/compiler/java/java_string_field.cc \ google/protobuf/compiler/java/java_string_field.h \ google/protobuf/compiler/java/java_string_field_lite.cc \ google/protobuf/compiler/java/java_string_field_lite.h \ - google/protobuf/compiler/java/java_doc_comment.cc \ - google/protobuf/compiler/java/java_doc_comment.h \ google/protobuf/compiler/js/js_generator.cc \ google/protobuf/compiler/js/well_known_types_embed.cc \ google/protobuf/compiler/objectivec/objectivec_enum.cc \ @@ -440,46 +468,21 @@ libprotoc_la_SOURCES = \ google/protobuf/compiler/objectivec/objectivec_message.h \ google/protobuf/compiler/objectivec/objectivec_message_field.cc \ google/protobuf/compiler/objectivec/objectivec_message_field.h \ - google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h \ + google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h \ google/protobuf/compiler/objectivec/objectivec_oneof.cc \ google/protobuf/compiler/objectivec/objectivec_oneof.h \ google/protobuf/compiler/objectivec/objectivec_primitive_field.cc \ google/protobuf/compiler/objectivec/objectivec_primitive_field.h \ google/protobuf/compiler/php/php_generator.cc \ + google/protobuf/compiler/plugin.cc \ + google/protobuf/compiler/plugin.pb.cc \ google/protobuf/compiler/python/python_generator.cc \ google/protobuf/compiler/ruby/ruby_generator.cc \ - google/protobuf/compiler/csharp/csharp_doc_comment.cc \ - google/protobuf/compiler/csharp/csharp_doc_comment.h \ - google/protobuf/compiler/csharp/csharp_enum.cc \ - google/protobuf/compiler/csharp/csharp_enum.h \ - google/protobuf/compiler/csharp/csharp_enum_field.cc \ - google/protobuf/compiler/csharp/csharp_enum_field.h \ - google/protobuf/compiler/csharp/csharp_field_base.cc \ - google/protobuf/compiler/csharp/csharp_field_base.h \ - google/protobuf/compiler/csharp/csharp_generator.cc \ - google/protobuf/compiler/csharp/csharp_helpers.cc \ - google/protobuf/compiler/csharp/csharp_helpers.h \ - google/protobuf/compiler/csharp/csharp_map_field.cc \ - google/protobuf/compiler/csharp/csharp_map_field.h \ - google/protobuf/compiler/csharp/csharp_message.cc \ - google/protobuf/compiler/csharp/csharp_message.h \ - google/protobuf/compiler/csharp/csharp_message_field.cc \ - google/protobuf/compiler/csharp/csharp_message_field.h \ - google/protobuf/compiler/csharp/csharp_options.h \ - google/protobuf/compiler/csharp/csharp_primitive_field.cc \ - google/protobuf/compiler/csharp/csharp_primitive_field.h \ - google/protobuf/compiler/csharp/csharp_reflection_class.cc \ - google/protobuf/compiler/csharp/csharp_reflection_class.h \ - google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc \ - google/protobuf/compiler/csharp/csharp_repeated_enum_field.h \ - google/protobuf/compiler/csharp/csharp_repeated_message_field.cc \ - google/protobuf/compiler/csharp/csharp_repeated_message_field.h \ - google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc \ - google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h \ - google/protobuf/compiler/csharp/csharp_source_generator_base.cc \ - google/protobuf/compiler/csharp/csharp_source_generator_base.h \ - google/protobuf/compiler/csharp/csharp_wrapper_field.cc \ - google/protobuf/compiler/csharp/csharp_wrapper_field.h + google/protobuf/compiler/scc.h \ + google/protobuf/compiler/subprocess.cc \ + google/protobuf/compiler/subprocess.h \ + google/protobuf/compiler/zip_writer.cc \ + google/protobuf/compiler/zip_writer.h bin_PROGRAMS = protoc protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la @@ -490,32 +493,33 @@ protoc_SOURCES = google/protobuf/compiler/main.cc protoc_inputs = \ google/protobuf/any_test.proto \ google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto \ + google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto \ google/protobuf/map_lite_unittest.proto \ google/protobuf/map_proto2_unittest.proto \ google/protobuf/map_unittest.proto \ + google/protobuf/unittest.proto \ google/protobuf/unittest_arena.proto \ google/protobuf/unittest_custom_options.proto \ google/protobuf/unittest_drop_unknown_fields.proto \ google/protobuf/unittest_embed_optimize_for.proto \ google/protobuf/unittest_empty.proto \ google/protobuf/unittest_enormous_descriptor.proto \ - google/protobuf/unittest_import_lite.proto \ google/protobuf/unittest_import.proto \ - google/protobuf/unittest_import_public_lite.proto \ + google/protobuf/unittest_import_lite.proto \ google/protobuf/unittest_import_public.proto \ + google/protobuf/unittest_import_public_lite.proto \ google/protobuf/unittest_lazy_dependencies.proto \ google/protobuf/unittest_lazy_dependencies_custom_option.proto \ google/protobuf/unittest_lazy_dependencies_enum.proto \ - google/protobuf/unittest_lite_imports_nonlite.proto \ google/protobuf/unittest_lite.proto \ + google/protobuf/unittest_lite_imports_nonlite.proto \ google/protobuf/unittest_mset.proto \ google/protobuf/unittest_mset_wire_format.proto \ google/protobuf/unittest_no_field_presence.proto \ google/protobuf/unittest_no_generic_services.proto \ google/protobuf/unittest_optimize_for.proto \ - google/protobuf/unittest_preserve_unknown_enum2.proto \ google/protobuf/unittest_preserve_unknown_enum.proto \ - google/protobuf/unittest.proto \ + google/protobuf/unittest_preserve_unknown_enum2.proto \ google/protobuf/unittest_proto3.proto \ google/protobuf/unittest_proto3_arena.proto \ google/protobuf/unittest_proto3_arena_lite.proto \ @@ -535,22 +539,35 @@ protoc_inputs = \ google/protobuf/util/internal/testdata/wrappers.proto \ google/protobuf/util/json_format.proto \ google/protobuf/util/json_format_proto3.proto \ - google/protobuf/util/message_differencer_unittest.proto \ - google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto + google/protobuf/util/message_differencer_unittest.proto EXTRA_DIST = \ $(protoc_inputs) \ solaris/libstdc++.la \ - google/protobuf/test_messages_proto3.proto \ - google/protobuf/test_messages_proto2.proto \ + google/protobuf/compiler/package_info.h \ + google/protobuf/compiler/ruby/ruby_generated_code.proto \ + google/protobuf/compiler/ruby/ruby_generated_code_pb.rb \ + google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto \ + google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb \ + google/protobuf/compiler/ruby/ruby_generated_pkg_explicit.proto \ + google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy.proto \ + google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy_pb.rb \ + google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_pb.rb \ + google/protobuf/compiler/ruby/ruby_generated_pkg_implicit.proto \ + google/protobuf/compiler/ruby/ruby_generated_pkg_implicit_pb.rb \ + google/protobuf/compiler/zip_output_unittest.sh \ google/protobuf/io/gzip_stream.h \ google/protobuf/io/gzip_stream_unittest.sh \ + google/protobuf/io/package_info.h \ + google/protobuf/package_info.h \ + google/protobuf/test_messages_proto2.proto \ + google/protobuf/test_messages_proto3.proto \ + google/protobuf/testdata/bad_utf8_string \ google/protobuf/testdata/golden_message \ google/protobuf/testdata/golden_message_maps \ google/protobuf/testdata/golden_message_oneof_implemented \ google/protobuf/testdata/golden_message_proto3 \ google/protobuf/testdata/golden_packed_fields_message \ - google/protobuf/testdata/bad_utf8_string \ google/protobuf/testdata/map_test_data.txt \ google/protobuf/testdata/text_format_unittest_data.txt \ google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt \ @@ -558,21 +575,7 @@ EXTRA_DIST = \ google/protobuf/testdata/text_format_unittest_data_pointy_oneof.txt \ google/protobuf/testdata/text_format_unittest_extensions_data.txt \ google/protobuf/testdata/text_format_unittest_extensions_data_pointy.txt \ - google/protobuf/package_info.h \ - google/protobuf/io/package_info.h \ google/protobuf/util/package_info.h \ - google/protobuf/compiler/ruby/ruby_generated_code.proto \ - google/protobuf/compiler/ruby/ruby_generated_code_pb.rb \ - google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto \ - google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb \ - google/protobuf/compiler/ruby/ruby_generated_pkg_explicit.proto \ - google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy.proto \ - google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy_pb.rb \ - google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_pb.rb \ - google/protobuf/compiler/ruby/ruby_generated_pkg_implicit.proto \ - google/protobuf/compiler/ruby/ruby_generated_pkg_implicit_pb.rb \ - google/protobuf/compiler/package_info.h \ - google/protobuf/compiler/zip_output_unittest.sh \ libprotobuf-lite.map \ libprotobuf.map \ libprotoc.map \ @@ -581,12 +584,12 @@ EXTRA_DIST = \ protoc_lite_outputs = \ google/protobuf/map_lite_unittest.pb.cc \ google/protobuf/map_lite_unittest.pb.h \ - google/protobuf/unittest_lite.pb.cc \ - google/protobuf/unittest_lite.pb.h \ google/protobuf/unittest_import_lite.pb.cc \ google/protobuf/unittest_import_lite.pb.h \ google/protobuf/unittest_import_public_lite.pb.cc \ - google/protobuf/unittest_import_public_lite.pb.h + google/protobuf/unittest_import_public_lite.pb.h \ + google/protobuf/unittest_lite.pb.cc \ + google/protobuf/unittest_lite.pb.h protoc_outputs = \ $(protoc_lite_outputs) \ @@ -600,6 +603,8 @@ protoc_outputs = \ google/protobuf/map_proto2_unittest.pb.h \ google/protobuf/map_unittest.pb.cc \ google/protobuf/map_unittest.pb.h \ + google/protobuf/unittest.pb.cc \ + google/protobuf/unittest.pb.h \ google/protobuf/unittest_arena.pb.cc \ google/protobuf/unittest_arena.pb.h \ google/protobuf/unittest_custom_options.pb.cc \ @@ -634,12 +639,10 @@ protoc_outputs = \ google/protobuf/unittest_no_generic_services.pb.h \ google/protobuf/unittest_optimize_for.pb.cc \ google/protobuf/unittest_optimize_for.pb.h \ - google/protobuf/unittest.pb.cc \ - google/protobuf/unittest.pb.h \ - google/protobuf/unittest_preserve_unknown_enum2.pb.cc \ - google/protobuf/unittest_preserve_unknown_enum2.pb.h \ google/protobuf/unittest_preserve_unknown_enum.pb.cc \ google/protobuf/unittest_preserve_unknown_enum.pb.h \ + google/protobuf/unittest_preserve_unknown_enum2.pb.cc \ + google/protobuf/unittest_preserve_unknown_enum2.pb.h \ google/protobuf/unittest_proto3.pb.cc \ google/protobuf/unittest_proto3.pb.h \ google/protobuf/unittest_proto3_arena.pb.cc \ @@ -703,8 +706,8 @@ $(protoc_outputs): unittest_proto_middleman COMMON_TEST_SOURCES = \ google/protobuf/arena_test_util.cc \ google/protobuf/arena_test_util.h \ - google/protobuf/map_test_util.inc \ google/protobuf/map_test_util.h \ + google/protobuf/map_test_util.inc \ google/protobuf/map_test_util_impl.h \ google/protobuf/reflection_tester.cc \ google/protobuf/reflection_tester.h \ @@ -712,10 +715,10 @@ COMMON_TEST_SOURCES = \ google/protobuf/test_util.h \ google/protobuf/test_util.inc \ google/protobuf/test_util2.h \ - google/protobuf/testing/googletest.cc \ - google/protobuf/testing/googletest.h \ google/protobuf/testing/file.cc \ - google/protobuf/testing/file.h + google/protobuf/testing/file.h \ + google/protobuf/testing/googletest.cc \ + google/protobuf/testing/googletest.h GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock @@ -734,25 +737,31 @@ protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \ # since test_util.cc takes forever to compile with optimization (with GCC). # See configure.ac for more info. protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) -# Doesn't pass on Windows with MSVC -NON_MSVC_TEST_SOURCES = \ - google/protobuf/compiler/command_line_interface_unittest.cc protobuf_test_SOURCES = \ - google/protobuf/stubs/bytestream_unittest.cc \ - google/protobuf/stubs/common_unittest.cc \ - google/protobuf/stubs/int128_unittest.cc \ - google/protobuf/io/io_win32_unittest.cc \ - google/protobuf/stubs/statusor_test.cc \ - google/protobuf/stubs/status_test.cc \ - google/protobuf/stubs/stringpiece_unittest.cc \ - google/protobuf/stubs/stringprintf_unittest.cc \ - google/protobuf/stubs/structurally_valid_unittest.cc \ - google/protobuf/stubs/strutil_unittest.cc \ - google/protobuf/stubs/template_util_unittest.cc \ - google/protobuf/stubs/time_test.cc \ google/protobuf/any_test.cc \ - google/protobuf/arenastring_unittest.cc \ google/protobuf/arena_unittest.cc \ + google/protobuf/arenastring_unittest.cc \ + google/protobuf/compiler/annotation_test_util.cc \ + google/protobuf/compiler/annotation_test_util.h \ + google/protobuf/compiler/command_line_interface_unittest.cc \ + google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc \ + google/protobuf/compiler/cpp/cpp_move_unittest.cc \ + google/protobuf/compiler/cpp/cpp_plugin_unittest.cc \ + google/protobuf/compiler/cpp/cpp_unittest.cc \ + google/protobuf/compiler/cpp/cpp_unittest.h \ + google/protobuf/compiler/cpp/cpp_unittest.inc \ + google/protobuf/compiler/cpp/metadata_test.cc \ + google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc \ + google/protobuf/compiler/csharp/csharp_generator_unittest.cc \ + google/protobuf/compiler/importer_unittest.cc \ + google/protobuf/compiler/java/java_doc_comment_unittest.cc \ + google/protobuf/compiler/java/java_plugin_unittest.cc \ + google/protobuf/compiler/mock_code_generator.cc \ + google/protobuf/compiler/mock_code_generator.h \ + google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc \ + google/protobuf/compiler/parser_unittest.cc \ + google/protobuf/compiler/python/python_plugin_unittest.cc \ + google/protobuf/compiler/ruby/ruby_generator_unittest.cc \ google/protobuf/descriptor_database_unittest.cc \ google/protobuf/descriptor_unittest.cc \ google/protobuf/drop_unknown_fields_test.cc \ @@ -760,6 +769,11 @@ protobuf_test_SOURCES = \ google/protobuf/extension_set_unittest.cc \ google/protobuf/generated_message_reflection_unittest.cc \ google/protobuf/inlined_string_field_unittest.cc \ + google/protobuf/io/coded_stream_unittest.cc \ + google/protobuf/io/io_win32_unittest.cc \ + google/protobuf/io/printer_unittest.cc \ + google/protobuf/io/tokenizer_unittest.cc \ + google/protobuf/io/zero_copy_stream_unittest.cc \ google/protobuf/map_field_test.cc \ google/protobuf/map_test.cc \ google/protobuf/map_test.inc \ @@ -774,35 +788,19 @@ protobuf_test_SOURCES = \ google/protobuf/reflection_ops_unittest.cc \ google/protobuf/repeated_field_reflection_unittest.cc \ google/protobuf/repeated_field_unittest.cc \ + google/protobuf/stubs/bytestream_unittest.cc \ + google/protobuf/stubs/common_unittest.cc \ + google/protobuf/stubs/int128_unittest.cc \ + google/protobuf/stubs/status_test.cc \ + google/protobuf/stubs/statusor_test.cc \ + google/protobuf/stubs/stringpiece_unittest.cc \ + google/protobuf/stubs/stringprintf_unittest.cc \ + google/protobuf/stubs/structurally_valid_unittest.cc \ + google/protobuf/stubs/strutil_unittest.cc \ + google/protobuf/stubs/template_util_unittest.cc \ + google/protobuf/stubs/time_test.cc \ google/protobuf/text_format_unittest.cc \ google/protobuf/unknown_field_set_unittest.cc \ - google/protobuf/well_known_types_unittest.cc \ - google/protobuf/wire_format_unittest.cc \ - google/protobuf/wire_format_unittest.inc \ - google/protobuf/io/coded_stream_unittest.cc \ - google/protobuf/io/printer_unittest.cc \ - google/protobuf/io/tokenizer_unittest.cc \ - google/protobuf/io/zero_copy_stream_unittest.cc \ - google/protobuf/compiler/annotation_test_util.h \ - google/protobuf/compiler/annotation_test_util.cc \ - google/protobuf/compiler/importer_unittest.cc \ - google/protobuf/compiler/mock_code_generator.cc \ - google/protobuf/compiler/mock_code_generator.h \ - google/protobuf/compiler/parser_unittest.cc \ - google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc \ - google/protobuf/compiler/cpp/cpp_move_unittest.cc \ - google/protobuf/compiler/cpp/cpp_unittest.h \ - google/protobuf/compiler/cpp/cpp_unittest.cc \ - google/protobuf/compiler/cpp/cpp_unittest.inc \ - google/protobuf/compiler/cpp/cpp_plugin_unittest.cc \ - google/protobuf/compiler/cpp/metadata_test.cc \ - google/protobuf/compiler/java/java_plugin_unittest.cc \ - google/protobuf/compiler/java/java_doc_comment_unittest.cc \ - google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc \ - google/protobuf/compiler/python/python_plugin_unittest.cc \ - google/protobuf/compiler/ruby/ruby_generator_unittest.cc \ - google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc \ - google/protobuf/compiler/csharp/csharp_generator_unittest.cc \ google/protobuf/util/delimited_message_util_test.cc \ google/protobuf/util/field_comparator_test.cc \ google/protobuf/util/field_mask_util_test.cc \ @@ -816,8 +814,11 @@ protobuf_test_SOURCES = \ google/protobuf/util/message_differencer_unittest.cc \ google/protobuf/util/time_util_test.cc \ google/protobuf/util/type_resolver_util_test.cc \ - $(NON_MSVC_TEST_SOURCES) \ + google/protobuf/well_known_types_unittest.cc \ + google/protobuf/wire_format_unittest.cc \ + google/protobuf/wire_format_unittest.inc \ $(COMMON_TEST_SOURCES) + nodist_protobuf_test_SOURCES = $(protoc_outputs) $(am_protobuf_test_OBJECTS): unittest_proto_middleman @@ -884,9 +885,9 @@ test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include test_plugin_SOURCES = \ google/protobuf/compiler/mock_code_generator.cc \ + google/protobuf/compiler/test_plugin.cc \ google/protobuf/testing/file.cc \ - google/protobuf/testing/file.h \ - google/protobuf/compiler/test_plugin.cc + google/protobuf/testing/file.h if HAVE_ZLIB zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la @@ -902,9 +903,8 @@ endif no_warning_test.cc: echo "// Generated from Makefile.am" > no_warning_test.cc for FILE in $(nobase_include_HEADERS); do \ - if [[ $$FILE != *.inc ]]; then \ - echo "#include <$${FILE}>" >> no_warning_test.cc; \ - fi \ + case $$FILE in *.inc) continue;; esac; \ + echo "#include <$${FILE}>" >> no_warning_test.cc; \ done echo "int main(int, char**) { return 0; }" >> no_warning_test.cc diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc index 7fc1219549..a32c3e7f1a 100644 --- a/src/google/protobuf/any.pb.cc +++ b/src/google/protobuf/any.pb.cc @@ -38,20 +38,20 @@ static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_s const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fprotobuf_2fany_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Any, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Any, type_url_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Any, value_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, type_url_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Any, value_), }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(PROTOBUF_NAMESPACE_ID::Any)}, + { 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Any)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Any_default_instance_), + reinterpret_cast(&::PROTOBUF_NAMESPACE_ID::_Any_default_instance_), }; const char descriptor_table_protodef_google_2fprotobuf_2fany_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -331,8 +331,8 @@ void Any::InternalSwap(Any* other) { // @@protoc_insertion_point(namespace_scope) PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Any >(Arena* arena) { - return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::Any >(arena); +template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Any >(Arena* arena) { + return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Any >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h index f727663f38..5c6d92e99c 100644 --- a/src/google/protobuf/any.pb.h +++ b/src/google/protobuf/any.pb.h @@ -59,7 +59,7 @@ struct AnyDefaultTypeInternal; PROTOBUF_EXPORT extern AnyDefaultTypeInternal _Any_default_instance_; PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_EXPORT PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage(Arena*); +template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Any* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Any>(Arena*); PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN @@ -84,7 +84,11 @@ class PROTOBUF_EXPORT Any final : } inline Any& operator=(Any&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena()) { + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { InternalSwap(&from); } else { CopyFrom(from); diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index 8d45b603dd..5cca2f161d 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -75,50 +75,50 @@ static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_s const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fprotobuf_2fapi_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, name_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, methods_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, options_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, version_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, source_context_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, mixins_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Api, syntax_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, name_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, methods_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, options_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, version_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, source_context_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, mixins_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Api, syntax_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, name_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, request_type_url_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, request_streaming_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, response_type_url_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, response_streaming_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, options_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Method, syntax_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, name_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, request_type_url_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, request_streaming_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, response_type_url_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, response_streaming_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, options_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Method, syntax_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Mixin, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Mixin, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Mixin, name_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::Mixin, root_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Mixin, name_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::Mixin, root_), }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(PROTOBUF_NAMESPACE_ID::Api)}, - { 13, -1, -1, sizeof(PROTOBUF_NAMESPACE_ID::Method)}, - { 26, -1, -1, sizeof(PROTOBUF_NAMESPACE_ID::Mixin)}, + { 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Api)}, + { 13, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Method)}, + { 26, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::Mixin)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Api_default_instance_), - reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Method_default_instance_), - reinterpret_cast(&PROTOBUF_NAMESPACE_ID::_Mixin_default_instance_), + reinterpret_cast(&::PROTOBUF_NAMESPACE_ID::_Api_default_instance_), + reinterpret_cast(&::PROTOBUF_NAMESPACE_ID::_Method_default_instance_), + reinterpret_cast(&::PROTOBUF_NAMESPACE_ID::_Mixin_default_instance_), }; const char descriptor_table_protodef_google_2fprotobuf_2fapi_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -165,10 +165,10 @@ PROTOBUF_NAMESPACE_OPEN class Api::_Internal { public: - static const PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Api* msg); + static const ::PROTOBUF_NAMESPACE_ID::SourceContext& source_context(const Api* msg); }; -const PROTOBUF_NAMESPACE_ID::SourceContext& +const ::PROTOBUF_NAMESPACE_ID::SourceContext& Api::_Internal::source_context(const Api* msg) { return *msg->source_context_; } @@ -210,7 +210,7 @@ Api::Api(const Api& from) GetArenaForAllocation()); } if (from._internal_has_source_context()) { - source_context_ = new PROTOBUF_NAMESPACE_ID::SourceContext(*from.source_context_); + source_context_ = new ::PROTOBUF_NAMESPACE_ID::SourceContext(*from.source_context_); } else { source_context_ = nullptr; } @@ -348,7 +348,7 @@ const char* Api::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::intern if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - _internal_set_syntax(static_cast(val)); + _internal_set_syntax(static_cast<::PROTOBUF_NAMESPACE_ID::Syntax>(val)); } else goto handle_unusual; continue; @@ -536,7 +536,7 @@ void Api::MergeFrom(const Api& from) { _internal_set_version(from._internal_version()); } if (from._internal_has_source_context()) { - _internal_mutable_source_context()->PROTOBUF_NAMESPACE_ID::SourceContext::MergeFrom(from._internal_source_context()); + _internal_mutable_source_context()->::PROTOBUF_NAMESPACE_ID::SourceContext::MergeFrom(from._internal_source_context()); } if (from._internal_syntax() != 0) { _internal_set_syntax(from._internal_syntax()); @@ -751,7 +751,7 @@ const char* Method::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::int if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - _internal_set_syntax(static_cast(val)); + _internal_set_syntax(static_cast<::PROTOBUF_NAMESPACE_ID::Syntax>(val)); } else goto handle_unusual; continue; @@ -1234,14 +1234,14 @@ void Mixin::InternalSwap(Mixin* other) { // @@protoc_insertion_point(namespace_scope) PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Api* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Api >(Arena* arena) { - return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::Api >(arena); +template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::Api* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Api >(Arena* arena) { + return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Api >(arena); } -template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Method* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Method >(Arena* arena) { - return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::Method >(arena); +template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::Method* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Method >(Arena* arena) { + return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Method >(arena); } -template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::Mixin* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::Mixin >(Arena* arena) { - return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::Mixin >(arena); +template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::Mixin* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::Mixin >(Arena* arena) { + return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::Mixin >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index 1708da8a00..d0e1bb7335 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -67,9 +67,9 @@ struct MixinDefaultTypeInternal; PROTOBUF_EXPORT extern MixinDefaultTypeInternal _Mixin_default_instance_; PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_EXPORT PROTOBUF_NAMESPACE_ID::Api* Arena::CreateMaybeMessage(Arena*); -template<> PROTOBUF_EXPORT PROTOBUF_NAMESPACE_ID::Method* Arena::CreateMaybeMessage(Arena*); -template<> PROTOBUF_EXPORT PROTOBUF_NAMESPACE_ID::Mixin* Arena::CreateMaybeMessage(Arena*); +template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Api* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Api>(Arena*); +template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Method* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Method>(Arena*); +template<> PROTOBUF_EXPORT ::PROTOBUF_NAMESPACE_ID::Mixin* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Mixin>(Arena*); PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN @@ -94,7 +94,11 @@ class PROTOBUF_EXPORT Api final : } inline Api& operator=(Api&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena()) { + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { InternalSwap(&from); } else { CopyFrom(from); @@ -204,16 +208,16 @@ class PROTOBUF_EXPORT Api final : int _internal_methods_size() const; public: void clear_methods(); - PROTOBUF_NAMESPACE_ID::Method* mutable_methods(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method >* + ::PROTOBUF_NAMESPACE_ID::Method* mutable_methods(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Method >* mutable_methods(); private: - const PROTOBUF_NAMESPACE_ID::Method& _internal_methods(int index) const; - PROTOBUF_NAMESPACE_ID::Method* _internal_add_methods(); + const ::PROTOBUF_NAMESPACE_ID::Method& _internal_methods(int index) const; + ::PROTOBUF_NAMESPACE_ID::Method* _internal_add_methods(); public: - const PROTOBUF_NAMESPACE_ID::Method& methods(int index) const; - PROTOBUF_NAMESPACE_ID::Method* add_methods(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method >& + const ::PROTOBUF_NAMESPACE_ID::Method& methods(int index) const; + ::PROTOBUF_NAMESPACE_ID::Method* add_methods(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Method >& methods() const; // repeated .google.protobuf.Option options = 3; @@ -222,16 +226,16 @@ class PROTOBUF_EXPORT Api final : int _internal_options_size() const; public: void clear_options(); - PROTOBUF_NAMESPACE_ID::Option* mutable_options(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >* + ::PROTOBUF_NAMESPACE_ID::Option* mutable_options(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* mutable_options(); private: - const PROTOBUF_NAMESPACE_ID::Option& _internal_options(int index) const; - PROTOBUF_NAMESPACE_ID::Option* _internal_add_options(); + const ::PROTOBUF_NAMESPACE_ID::Option& _internal_options(int index) const; + ::PROTOBUF_NAMESPACE_ID::Option* _internal_add_options(); public: - const PROTOBUF_NAMESPACE_ID::Option& options(int index) const; - PROTOBUF_NAMESPACE_ID::Option* add_options(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >& + const ::PROTOBUF_NAMESPACE_ID::Option& options(int index) const; + ::PROTOBUF_NAMESPACE_ID::Option* add_options(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& options() const; // repeated .google.protobuf.Mixin mixins = 6; @@ -240,16 +244,16 @@ class PROTOBUF_EXPORT Api final : int _internal_mixins_size() const; public: void clear_mixins(); - PROTOBUF_NAMESPACE_ID::Mixin* mutable_mixins(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin >* + ::PROTOBUF_NAMESPACE_ID::Mixin* mutable_mixins(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Mixin >* mutable_mixins(); private: - const PROTOBUF_NAMESPACE_ID::Mixin& _internal_mixins(int index) const; - PROTOBUF_NAMESPACE_ID::Mixin* _internal_add_mixins(); + const ::PROTOBUF_NAMESPACE_ID::Mixin& _internal_mixins(int index) const; + ::PROTOBUF_NAMESPACE_ID::Mixin* _internal_add_mixins(); public: - const PROTOBUF_NAMESPACE_ID::Mixin& mixins(int index) const; - PROTOBUF_NAMESPACE_ID::Mixin* add_mixins(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin >& + const ::PROTOBUF_NAMESPACE_ID::Mixin& mixins(int index) const; + ::PROTOBUF_NAMESPACE_ID::Mixin* add_mixins(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Mixin >& mixins() const; // string name = 1; @@ -286,25 +290,25 @@ class PROTOBUF_EXPORT Api final : bool _internal_has_source_context() const; public: void clear_source_context(); - const PROTOBUF_NAMESPACE_ID::SourceContext& source_context() const; - PROTOBUF_MUST_USE_RESULT PROTOBUF_NAMESPACE_ID::SourceContext* release_source_context(); - PROTOBUF_NAMESPACE_ID::SourceContext* mutable_source_context(); - void set_allocated_source_context(PROTOBUF_NAMESPACE_ID::SourceContext* source_context); + const ::PROTOBUF_NAMESPACE_ID::SourceContext& source_context() const; + PROTOBUF_MUST_USE_RESULT ::PROTOBUF_NAMESPACE_ID::SourceContext* release_source_context(); + ::PROTOBUF_NAMESPACE_ID::SourceContext* mutable_source_context(); + void set_allocated_source_context(::PROTOBUF_NAMESPACE_ID::SourceContext* source_context); private: - const PROTOBUF_NAMESPACE_ID::SourceContext& _internal_source_context() const; - PROTOBUF_NAMESPACE_ID::SourceContext* _internal_mutable_source_context(); + const ::PROTOBUF_NAMESPACE_ID::SourceContext& _internal_source_context() const; + ::PROTOBUF_NAMESPACE_ID::SourceContext* _internal_mutable_source_context(); public: void unsafe_arena_set_allocated_source_context( - PROTOBUF_NAMESPACE_ID::SourceContext* source_context); - PROTOBUF_NAMESPACE_ID::SourceContext* unsafe_arena_release_source_context(); + ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context); + ::PROTOBUF_NAMESPACE_ID::SourceContext* unsafe_arena_release_source_context(); // .google.protobuf.Syntax syntax = 7; void clear_syntax(); - PROTOBUF_NAMESPACE_ID::Syntax syntax() const; - void set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value); + ::PROTOBUF_NAMESPACE_ID::Syntax syntax() const; + void set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value); private: - PROTOBUF_NAMESPACE_ID::Syntax _internal_syntax() const; - void _internal_set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value); + ::PROTOBUF_NAMESPACE_ID::Syntax _internal_syntax() const; + void _internal_set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value); public: // @@protoc_insertion_point(class_scope:google.protobuf.Api) @@ -314,12 +318,12 @@ class PROTOBUF_EXPORT Api final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method > methods_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option > options_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin > mixins_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Method > methods_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Mixin > mixins_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr version_; - PROTOBUF_NAMESPACE_ID::SourceContext* source_context_; + ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context_; int syntax_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_google_2fprotobuf_2fapi_2eproto; @@ -345,7 +349,11 @@ class PROTOBUF_EXPORT Method final : } inline Method& operator=(Method&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena()) { + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { InternalSwap(&from); } else { CopyFrom(from); @@ -455,16 +463,16 @@ class PROTOBUF_EXPORT Method final : int _internal_options_size() const; public: void clear_options(); - PROTOBUF_NAMESPACE_ID::Option* mutable_options(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >* + ::PROTOBUF_NAMESPACE_ID::Option* mutable_options(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* mutable_options(); private: - const PROTOBUF_NAMESPACE_ID::Option& _internal_options(int index) const; - PROTOBUF_NAMESPACE_ID::Option* _internal_add_options(); + const ::PROTOBUF_NAMESPACE_ID::Option& _internal_options(int index) const; + ::PROTOBUF_NAMESPACE_ID::Option* _internal_add_options(); public: - const PROTOBUF_NAMESPACE_ID::Option& options(int index) const; - PROTOBUF_NAMESPACE_ID::Option* add_options(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >& + const ::PROTOBUF_NAMESPACE_ID::Option& options(int index) const; + ::PROTOBUF_NAMESPACE_ID::Option* add_options(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& options() const; // string name = 1; @@ -529,11 +537,11 @@ class PROTOBUF_EXPORT Method final : // .google.protobuf.Syntax syntax = 7; void clear_syntax(); - PROTOBUF_NAMESPACE_ID::Syntax syntax() const; - void set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value); + ::PROTOBUF_NAMESPACE_ID::Syntax syntax() const; + void set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value); private: - PROTOBUF_NAMESPACE_ID::Syntax _internal_syntax() const; - void _internal_set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value); + ::PROTOBUF_NAMESPACE_ID::Syntax _internal_syntax() const; + void _internal_set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value); public: // @@protoc_insertion_point(class_scope:google.protobuf.Method) @@ -543,7 +551,7 @@ class PROTOBUF_EXPORT Method final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option > options_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option > options_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr request_type_url_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr response_type_url_; @@ -574,7 +582,11 @@ class PROTOBUF_EXPORT Mixin final : } inline Mixin& operator=(Mixin&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena()) { + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { InternalSwap(&from); } else { CopyFrom(from); @@ -780,31 +792,31 @@ inline int Api::methods_size() const { inline void Api::clear_methods() { methods_.Clear(); } -inline PROTOBUF_NAMESPACE_ID::Method* Api::mutable_methods(int index) { +inline ::PROTOBUF_NAMESPACE_ID::Method* Api::mutable_methods(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Api.methods) return methods_.Mutable(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method >* +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Method >* Api::mutable_methods() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.methods) return &methods_; } -inline const PROTOBUF_NAMESPACE_ID::Method& Api::_internal_methods(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::Method& Api::_internal_methods(int index) const { return methods_.Get(index); } -inline const PROTOBUF_NAMESPACE_ID::Method& Api::methods(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::Method& Api::methods(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Api.methods) return _internal_methods(index); } -inline PROTOBUF_NAMESPACE_ID::Method* Api::_internal_add_methods() { +inline ::PROTOBUF_NAMESPACE_ID::Method* Api::_internal_add_methods() { return methods_.Add(); } -inline PROTOBUF_NAMESPACE_ID::Method* Api::add_methods() { - PROTOBUF_NAMESPACE_ID::Method* _add = _internal_add_methods(); +inline ::PROTOBUF_NAMESPACE_ID::Method* Api::add_methods() { + ::PROTOBUF_NAMESPACE_ID::Method* _add = _internal_add_methods(); // @@protoc_insertion_point(field_add:google.protobuf.Api.methods) return _add; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Method >& +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Method >& Api::methods() const { // @@protoc_insertion_point(field_list:google.protobuf.Api.methods) return methods_; @@ -817,31 +829,31 @@ inline int Api::_internal_options_size() const { inline int Api::options_size() const { return _internal_options_size(); } -inline PROTOBUF_NAMESPACE_ID::Option* Api::mutable_options(int index) { +inline ::PROTOBUF_NAMESPACE_ID::Option* Api::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Api.options) return options_.Mutable(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >* +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* Api::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.options) return &options_; } -inline const PROTOBUF_NAMESPACE_ID::Option& Api::_internal_options(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::Option& Api::_internal_options(int index) const { return options_.Get(index); } -inline const PROTOBUF_NAMESPACE_ID::Option& Api::options(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::Option& Api::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Api.options) return _internal_options(index); } -inline PROTOBUF_NAMESPACE_ID::Option* Api::_internal_add_options() { +inline ::PROTOBUF_NAMESPACE_ID::Option* Api::_internal_add_options() { return options_.Add(); } -inline PROTOBUF_NAMESPACE_ID::Option* Api::add_options() { - PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); +inline ::PROTOBUF_NAMESPACE_ID::Option* Api::add_options() { + ::PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); // @@protoc_insertion_point(field_add:google.protobuf.Api.options) return _add; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >& +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& Api::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Api.options) return options_; @@ -900,17 +912,17 @@ inline bool Api::_internal_has_source_context() const { inline bool Api::has_source_context() const { return _internal_has_source_context(); } -inline const PROTOBUF_NAMESPACE_ID::SourceContext& Api::_internal_source_context() const { - const PROTOBUF_NAMESPACE_ID::SourceContext* p = source_context_; - return p != nullptr ? *p : reinterpret_cast( - PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_); +inline const ::PROTOBUF_NAMESPACE_ID::SourceContext& Api::_internal_source_context() const { + const ::PROTOBUF_NAMESPACE_ID::SourceContext* p = source_context_; + return p != nullptr ? *p : reinterpret_cast( + ::PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_); } -inline const PROTOBUF_NAMESPACE_ID::SourceContext& Api::source_context() const { +inline const ::PROTOBUF_NAMESPACE_ID::SourceContext& Api::source_context() const { // @@protoc_insertion_point(field_get:google.protobuf.Api.source_context) return _internal_source_context(); } inline void Api::unsafe_arena_set_allocated_source_context( - PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { + ::PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { if (GetArenaForAllocation() == nullptr) { delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); } @@ -922,9 +934,9 @@ inline void Api::unsafe_arena_set_allocated_source_context( } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Api.source_context) } -inline PROTOBUF_NAMESPACE_ID::SourceContext* Api::release_source_context() { +inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::release_source_context() { - PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; + ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; source_context_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); @@ -937,27 +949,27 @@ inline PROTOBUF_NAMESPACE_ID::SourceContext* Api::release_source_context() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline PROTOBUF_NAMESPACE_ID::SourceContext* Api::unsafe_arena_release_source_context() { +inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::unsafe_arena_release_source_context() { // @@protoc_insertion_point(field_release:google.protobuf.Api.source_context) - PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; + ::PROTOBUF_NAMESPACE_ID::SourceContext* temp = source_context_; source_context_ = nullptr; return temp; } -inline PROTOBUF_NAMESPACE_ID::SourceContext* Api::_internal_mutable_source_context() { +inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::_internal_mutable_source_context() { if (source_context_ == nullptr) { - auto* p = CreateMaybeMessage(GetArenaForAllocation()); + auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::SourceContext>(GetArenaForAllocation()); source_context_ = p; } return source_context_; } -inline PROTOBUF_NAMESPACE_ID::SourceContext* Api::mutable_source_context() { - PROTOBUF_NAMESPACE_ID::SourceContext* _msg = _internal_mutable_source_context(); +inline ::PROTOBUF_NAMESPACE_ID::SourceContext* Api::mutable_source_context() { + ::PROTOBUF_NAMESPACE_ID::SourceContext* _msg = _internal_mutable_source_context(); // @@protoc_insertion_point(field_mutable:google.protobuf.Api.source_context) return _msg; } -inline void Api::set_allocated_source_context(PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { +inline void Api::set_allocated_source_context(::PROTOBUF_NAMESPACE_ID::SourceContext* source_context) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_context_); @@ -989,31 +1001,31 @@ inline int Api::mixins_size() const { inline void Api::clear_mixins() { mixins_.Clear(); } -inline PROTOBUF_NAMESPACE_ID::Mixin* Api::mutable_mixins(int index) { +inline ::PROTOBUF_NAMESPACE_ID::Mixin* Api::mutable_mixins(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Api.mixins) return mixins_.Mutable(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin >* +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Mixin >* Api::mutable_mixins() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Api.mixins) return &mixins_; } -inline const PROTOBUF_NAMESPACE_ID::Mixin& Api::_internal_mixins(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::Mixin& Api::_internal_mixins(int index) const { return mixins_.Get(index); } -inline const PROTOBUF_NAMESPACE_ID::Mixin& Api::mixins(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::Mixin& Api::mixins(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Api.mixins) return _internal_mixins(index); } -inline PROTOBUF_NAMESPACE_ID::Mixin* Api::_internal_add_mixins() { +inline ::PROTOBUF_NAMESPACE_ID::Mixin* Api::_internal_add_mixins() { return mixins_.Add(); } -inline PROTOBUF_NAMESPACE_ID::Mixin* Api::add_mixins() { - PROTOBUF_NAMESPACE_ID::Mixin* _add = _internal_add_mixins(); +inline ::PROTOBUF_NAMESPACE_ID::Mixin* Api::add_mixins() { + ::PROTOBUF_NAMESPACE_ID::Mixin* _add = _internal_add_mixins(); // @@protoc_insertion_point(field_add:google.protobuf.Api.mixins) return _add; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Mixin >& +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Mixin >& Api::mixins() const { // @@protoc_insertion_point(field_list:google.protobuf.Api.mixins) return mixins_; @@ -1023,18 +1035,18 @@ Api::mixins() const { inline void Api::clear_syntax() { syntax_ = 0; } -inline PROTOBUF_NAMESPACE_ID::Syntax Api::_internal_syntax() const { - return static_cast< PROTOBUF_NAMESPACE_ID::Syntax >(syntax_); +inline ::PROTOBUF_NAMESPACE_ID::Syntax Api::_internal_syntax() const { + return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(syntax_); } -inline PROTOBUF_NAMESPACE_ID::Syntax Api::syntax() const { +inline ::PROTOBUF_NAMESPACE_ID::Syntax Api::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.Api.syntax) return _internal_syntax(); } -inline void Api::_internal_set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value) { +inline void Api::_internal_set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { syntax_ = value; } -inline void Api::set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value) { +inline void Api::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { _internal_set_syntax(value); // @@protoc_insertion_point(field_set:google.protobuf.Api.syntax) } @@ -1228,31 +1240,31 @@ inline int Method::_internal_options_size() const { inline int Method::options_size() const { return _internal_options_size(); } -inline PROTOBUF_NAMESPACE_ID::Option* Method::mutable_options(int index) { +inline ::PROTOBUF_NAMESPACE_ID::Option* Method::mutable_options(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.Method.options) return options_.Mutable(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >* +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >* Method::mutable_options() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.Method.options) return &options_; } -inline const PROTOBUF_NAMESPACE_ID::Option& Method::_internal_options(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::Option& Method::_internal_options(int index) const { return options_.Get(index); } -inline const PROTOBUF_NAMESPACE_ID::Option& Method::options(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::Option& Method::options(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.Method.options) return _internal_options(index); } -inline PROTOBUF_NAMESPACE_ID::Option* Method::_internal_add_options() { +inline ::PROTOBUF_NAMESPACE_ID::Option* Method::_internal_add_options() { return options_.Add(); } -inline PROTOBUF_NAMESPACE_ID::Option* Method::add_options() { - PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); +inline ::PROTOBUF_NAMESPACE_ID::Option* Method::add_options() { + ::PROTOBUF_NAMESPACE_ID::Option* _add = _internal_add_options(); // @@protoc_insertion_point(field_add:google.protobuf.Method.options) return _add; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::Option >& +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::Option >& Method::options() const { // @@protoc_insertion_point(field_list:google.protobuf.Method.options) return options_; @@ -1262,18 +1274,18 @@ Method::options() const { inline void Method::clear_syntax() { syntax_ = 0; } -inline PROTOBUF_NAMESPACE_ID::Syntax Method::_internal_syntax() const { - return static_cast< PROTOBUF_NAMESPACE_ID::Syntax >(syntax_); +inline ::PROTOBUF_NAMESPACE_ID::Syntax Method::_internal_syntax() const { + return static_cast< ::PROTOBUF_NAMESPACE_ID::Syntax >(syntax_); } -inline PROTOBUF_NAMESPACE_ID::Syntax Method::syntax() const { +inline ::PROTOBUF_NAMESPACE_ID::Syntax Method::syntax() const { // @@protoc_insertion_point(field_get:google.protobuf.Method.syntax) return _internal_syntax(); } -inline void Method::_internal_set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value) { +inline void Method::_internal_set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { syntax_ = value; } -inline void Method::set_syntax(PROTOBUF_NAMESPACE_ID::Syntax value) { +inline void Method::set_syntax(::PROTOBUF_NAMESPACE_ID::Syntax value) { _internal_set_syntax(value); // @@protoc_insertion_point(field_set:google.protobuf.Method.syntax) } diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h index 305a511cc4..8b1a6b5776 100644 --- a/src/google/protobuf/arena.h +++ b/src/google/protobuf/arena.h @@ -299,7 +299,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { // We must delegate to CreateMaybeMessage() and NOT CreateMessageInternal() // because protobuf generated classes specialize CreateMaybeMessage() and we // need to use that specialization for code size reasons. - return Arena::CreateMaybeMessage(arena, std::forward(args)...); + return Arena::CreateMaybeMessage(arena, static_cast(args)...); } // API to create any objects on the arena. Note that only the object will @@ -320,7 +320,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { template PROTOBUF_NDEBUG_INLINE static T* Create(Arena* arena, Args&&... args) { return CreateInternal(arena, std::is_convertible(), - std::forward(args)...); + static_cast(args)...); } // Create an array of object type T on the arena *without* invoking the @@ -484,7 +484,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { template static T* Construct(void* ptr, Args&&... args) { - return new (ptr) T(std::forward(args)...); + return new (ptr) T(static_cast(args)...); } static T* New() { @@ -528,9 +528,9 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { InternalHelper::is_arena_constructable::value, "CreateMessage can only construct types that are ArenaConstructable"); if (arena == NULL) { - return new T(nullptr, std::forward(args)...); + return new T(nullptr, static_cast(args)...); } else { - return arena->DoCreateMessage(std::forward(args)...); + return arena->DoCreateMessage(static_cast(args)...); } } diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index 1f20c4d819..3de72941fd 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -1181,6 +1181,9 @@ void FileGenerator::GenerateLibraryIncludes(io::Printer* printer) { if (options_.force_inline_string || options_.profile_driven_inline_string) { IncludeFile("net/proto2/public/inlined_string_field.h", printer); } + if (HasSimpleBaseClasses(file_, options_)) { + IncludeFile("net/proto2/public/generated_message_bases.h", printer); + } IncludeFile("net/proto2/public/generated_message_table_driven.h", printer); if (HasGeneratedMethods(file_, options_) && options_.tctable_mode != Options::kTCTableNever) { diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.cc b/src/google/protobuf/compiler/cpp/cpp_helpers.cc index 88721ac947..937a42a4df 100644 --- a/src/google/protobuf/compiler/cpp/cpp_helpers.cc +++ b/src/google/protobuf/compiler/cpp/cpp_helpers.cc @@ -376,7 +376,7 @@ std::string Namespace(const FileDescriptor* d, const Options& options) { ret = StringReplace(ret, "::google::" "protobuf", - "PROTOBUF_NAMESPACE_ID", false); + "::PROTOBUF_NAMESPACE_ID", false); } return ret; } diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.h b/src/google/protobuf/compiler/cpp/cpp_helpers.h index 24412cd734..e6359a1ea6 100644 --- a/src/google/protobuf/compiler/cpp/cpp_helpers.h +++ b/src/google/protobuf/compiler/cpp/cpp_helpers.h @@ -659,6 +659,15 @@ inline bool HasSimpleBaseClass(const Descriptor* desc, const Options& options) { return false; } +inline bool HasSimpleBaseClasses(const FileDescriptor* file, + const Options& options) { + bool v = false; + ForEachMessage(file, [&v, &options](const Descriptor* desc) { + v |= HasSimpleBaseClass(desc, options); + }); + return v; +} + inline std::string SimpleBaseClass(const Descriptor* desc, const Options& options) { if (!HasDescriptorMethods(desc->file(), options)) return ""; diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index d15f9b6cfc..c29be76c07 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -1460,7 +1460,11 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* printer) { "}\n" "inline $classname$& operator=($classname$&& from) noexcept {\n" " if (this == &from) return *this;\n" - " if (GetOwningArena() == from.GetOwningArena()) {\n" + " if (GetOwningArena() == from.GetOwningArena()\n" + "#ifdef PROTOBUF_FORCE_COPY_IN_MOVE\n" + " && GetOwningArena() != nullptr\n" + "#endif // !PROTOBUF_FORCE_COPY_IN_MOVE\n" + " ) {\n" " InternalSwap(&from);\n" " } else {\n" " CopyFrom(from);\n" diff --git a/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc b/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc index 3991d12a08..1a8468dacf 100644 --- a/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc +++ b/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc @@ -214,7 +214,8 @@ TailCallTableInfo::TailCallTableInfo(const Descriptor* descriptor, case FieldDescriptor::TYPE_BYTES: if (field->options().ctype() == FieldOptions::STRING && - field->default_value_string().empty()) { + field->default_value_string().empty() && + !IsStringInlined(field, options)) { name = FieldParseFunctionName(field, options, table_size_log2); } break; @@ -628,8 +629,9 @@ void ParseFunctionGenerator::GenerateArenaString(Formatter& format, int inlined_string_index = inlined_string_indices_[field->index()]; GOOGLE_DCHECK_GE(inlined_string_index, 0); format( - ", $msg$_internal_$name$_donated(), &_inlined_string_donated_[$1$], " - "~0x$2$u", + ", $msg$_internal_$name$_donated()" + ", &$msg$_inlined_string_donated_[$1$]" + ", ~0x$2$u", inlined_string_index / 32, strings::Hex(1u << (inlined_string_index % 32), strings::ZERO_PAD_8)); } diff --git a/src/google/protobuf/compiler/cpp/cpp_unittest.inc b/src/google/protobuf/compiler/cpp/cpp_unittest.inc index 24104db265..bfdbfd102e 100644 --- a/src/google/protobuf/compiler/cpp/cpp_unittest.inc +++ b/src/google/protobuf/compiler/cpp/cpp_unittest.inc @@ -510,7 +510,12 @@ TEST(GENERATED_MESSAGE_TEST_NAME, ADLSwap) { TestUtil::ExpectAllFieldsSet(message2); TestUtil::ExpectClear(message1); +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + EXPECT_NE(addr, &message2.repeated_int32().Get(0)); + EXPECT_EQ(*addr, message2.repeated_int32().Get(0)); +#else EXPECT_EQ(addr, &message2.repeated_int32().Get(0)); +#endif } TEST(GENERATED_MESSAGE_TEST_NAME, CopyConstructor) { @@ -938,12 +943,12 @@ TEST(GENERATED_MESSAGE_TEST_NAME, TestOneofSpaceUsed) { // Setting a message in oneof should delete the other fields and increase the // size by the size of the nested message type. NestedMessage is simple enough - // that it is equal to sizeof(NestedMessage) + // that it is equal to sizeof(NestedMessage). It may be backed by LazyField, + // increasing space used by LazyField and backing Cord. message1.mutable_foo_message(); ASSERT_EQ(sizeof(UNITTEST::TestOneof2::NestedMessage), message1.foo_message().SpaceUsedLong()); - EXPECT_EQ(empty_message_size + - sizeof(UNITTEST::TestOneof2::NestedMessage), + EXPECT_LE(empty_message_size + sizeof(UNITTEST::TestOneof2::NestedMessage), message1.SpaceUsedLong()); } diff --git a/src/google/protobuf/compiler/java/java_message.cc b/src/google/protobuf/compiler/java/java_message.cc index ebd57a7786..e30e9f99cf 100644 --- a/src/google/protobuf/compiler/java/java_message.cc +++ b/src/google/protobuf/compiler/java/java_message.cc @@ -316,7 +316,6 @@ void ImmutableMessageGenerator::Generate(io::Printer* printer) { WriteMessageDocComment(printer, descriptor_); MaybePrintGeneratedAnnotation(context_, printer, descriptor_, /* immutable = */ true); - // The builder_type stores the super type name of the nested Builder class. std::string builder_type; if (descriptor_->extension_range_count() > 0) { diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 9f35b1c284..d7f4aea2e6 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -84,73 +84,73 @@ static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptor static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fcompiler_2fplugin_2eproto = nullptr; const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::Version, _has_bits_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::Version, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _has_bits_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::Version, major_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::Version, minor_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::Version, patch_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::Version, suffix_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, major_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, minor_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, patch_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::Version, suffix_), 1, 2, 3, 0, - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _has_bits_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _has_bits_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, file_to_generate_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, parameter_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, proto_file_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, compiler_version_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, file_to_generate_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, parameter_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, proto_file_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest, compiler_version_), ~0u, 0, ~0u, 1, - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _has_bits_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _has_bits_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, name_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, insertion_point_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, content_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, generated_code_info_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, name_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, insertion_point_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, content_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File, generated_code_info_), 0, 1, 2, 3, - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _has_bits_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, error_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, supported_features_), - PROTOBUF_FIELD_OFFSET(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, file_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, error_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, supported_features_), + PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse, file_), 0, 1, ~0u, }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, 10, -1, sizeof(PROTOBUF_NAMESPACE_ID::compiler::Version)}, - { 14, 24, -1, sizeof(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest)}, - { 28, 38, -1, sizeof(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File)}, - { 42, 51, -1, sizeof(PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse)}, + { 0, 10, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::Version)}, + { 14, 24, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest)}, + { 28, 38, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File)}, + { 42, 51, -1, sizeof(::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&PROTOBUF_NAMESPACE_ID::compiler::_Version_default_instance_), - reinterpret_cast(&PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorRequest_default_instance_), - reinterpret_cast(&PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorResponse_File_default_instance_), - reinterpret_cast(&PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorResponse_default_instance_), + reinterpret_cast(&::PROTOBUF_NAMESPACE_ID::compiler::_Version_default_instance_), + reinterpret_cast(&::PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorRequest_default_instance_), + reinterpret_cast(&::PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorResponse_File_default_instance_), + reinterpret_cast(&::PROTOBUF_NAMESPACE_ID::compiler::_CodeGeneratorResponse_default_instance_), }; const char descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fplugin_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -538,13 +538,13 @@ class CodeGeneratorRequest::_Internal { static void set_has_parameter(HasBits* has_bits) { (*has_bits)[0] |= 1u; } - static const PROTOBUF_NAMESPACE_ID::compiler::Version& compiler_version(const CodeGeneratorRequest* msg); + static const ::PROTOBUF_NAMESPACE_ID::compiler::Version& compiler_version(const CodeGeneratorRequest* msg); static void set_has_compiler_version(HasBits* has_bits) { (*has_bits)[0] |= 2u; } }; -const PROTOBUF_NAMESPACE_ID::compiler::Version& +const ::PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::_Internal::compiler_version(const CodeGeneratorRequest* msg) { return *msg->compiler_version_; } @@ -574,7 +574,7 @@ CodeGeneratorRequest::CodeGeneratorRequest(const CodeGeneratorRequest& from) GetArenaForAllocation()); } if (from._internal_has_compiler_version()) { - compiler_version_ = new PROTOBUF_NAMESPACE_ID::compiler::Version(*from.compiler_version_); + compiler_version_ = new ::PROTOBUF_NAMESPACE_ID::compiler::Version(*from.compiler_version_); } else { compiler_version_ = nullptr; } @@ -833,7 +833,7 @@ void CodeGeneratorRequest::MergeFrom(const CodeGeneratorRequest& from) { _internal_set_parameter(from._internal_parameter()); } if (cached_has_bits & 0x00000002u) { - _internal_mutable_compiler_version()->PROTOBUF_NAMESPACE_ID::compiler::Version::MergeFrom(from._internal_compiler_version()); + _internal_mutable_compiler_version()->::PROTOBUF_NAMESPACE_ID::compiler::Version::MergeFrom(from._internal_compiler_version()); } } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -887,13 +887,13 @@ class CodeGeneratorResponse_File::_Internal { static void set_has_content(HasBits* has_bits) { (*has_bits)[0] |= 4u; } - static const PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& generated_code_info(const CodeGeneratorResponse_File* msg); + static const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& generated_code_info(const CodeGeneratorResponse_File* msg); static void set_has_generated_code_info(HasBits* has_bits) { (*has_bits)[0] |= 8u; } }; -const PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& +const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_File::_Internal::generated_code_info(const CodeGeneratorResponse_File* msg) { return *msg->generated_code_info_; } @@ -930,7 +930,7 @@ CodeGeneratorResponse_File::CodeGeneratorResponse_File(const CodeGeneratorRespon GetArenaForAllocation()); } if (from._internal_has_generated_code_info()) { - generated_code_info_ = new PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo(*from.generated_code_info_); + generated_code_info_ = new ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo(*from.generated_code_info_); } else { generated_code_info_ = nullptr; } @@ -1196,7 +1196,7 @@ void CodeGeneratorResponse_File::MergeFrom(const CodeGeneratorResponse_File& fro _internal_set_content(from._internal_content()); } if (cached_has_bits & 0x00000008u) { - _internal_mutable_generated_code_info()->PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo::MergeFrom(from._internal_generated_code_info()); + _internal_mutable_generated_code_info()->::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo::MergeFrom(from._internal_generated_code_info()); } } _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -1529,17 +1529,17 @@ void CodeGeneratorResponse::InternalSwap(CodeGeneratorResponse* other) { } // namespace compiler PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::compiler::Version* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::compiler::Version >(Arena* arena) { - return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::compiler::Version >(arena); +template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::compiler::Version* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::compiler::Version >(Arena* arena) { + return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::compiler::Version >(arena); } -template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest >(Arena* arena) { - return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest >(arena); +template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest >(Arena* arena) { + return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest >(arena); } -template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >(Arena* arena) { - return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >(arena); +template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >(Arena* arena) { + return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >(arena); } -template<> PROTOBUF_NOINLINE PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse* Arena::CreateMaybeMessage< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse >(Arena* arena) { - return Arena::CreateMessageInternal< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse >(arena); +template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse* Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index d230cd4f82..2e58226551 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -78,10 +78,10 @@ PROTOC_EXPORT extern VersionDefaultTypeInternal _Version_default_instance_; } // namespace compiler PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN -template<> PROTOC_EXPORT PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest* Arena::CreateMaybeMessage(Arena*); -template<> PROTOC_EXPORT PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse* Arena::CreateMaybeMessage(Arena*); -template<> PROTOC_EXPORT PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* Arena::CreateMaybeMessage(Arena*); -template<> PROTOC_EXPORT PROTOBUF_NAMESPACE_ID::compiler::Version* Arena::CreateMaybeMessage(Arena*); +template<> PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorRequest>(Arena*); +template<> PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse>(Arena*); +template<> PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File>(Arena*); +template<> PROTOC_EXPORT ::PROTOBUF_NAMESPACE_ID::compiler::Version* Arena::CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::Version>(Arena*); PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN namespace compiler { @@ -130,7 +130,11 @@ class PROTOC_EXPORT Version final : } inline Version& operator=(Version&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena()) { + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { InternalSwap(&from); } else { CopyFrom(from); @@ -331,7 +335,11 @@ class PROTOC_EXPORT CodeGeneratorRequest final : } inline CodeGeneratorRequest& operator=(CodeGeneratorRequest&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena()) { + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { InternalSwap(&from); } else { CopyFrom(from); @@ -469,16 +477,16 @@ class PROTOC_EXPORT CodeGeneratorRequest final : int _internal_proto_file_size() const; public: void clear_proto_file(); - PROTOBUF_NAMESPACE_ID::FileDescriptorProto* mutable_proto_file(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::FileDescriptorProto >* + ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* mutable_proto_file(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >* mutable_proto_file(); private: - const PROTOBUF_NAMESPACE_ID::FileDescriptorProto& _internal_proto_file(int index) const; - PROTOBUF_NAMESPACE_ID::FileDescriptorProto* _internal_add_proto_file(); + const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& _internal_proto_file(int index) const; + ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* _internal_add_proto_file(); public: - const PROTOBUF_NAMESPACE_ID::FileDescriptorProto& proto_file(int index) const; - PROTOBUF_NAMESPACE_ID::FileDescriptorProto* add_proto_file(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::FileDescriptorProto >& + const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& proto_file(int index) const; + ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* add_proto_file(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >& proto_file() const; // optional string parameter = 2; @@ -505,17 +513,17 @@ class PROTOC_EXPORT CodeGeneratorRequest final : bool _internal_has_compiler_version() const; public: void clear_compiler_version(); - const PROTOBUF_NAMESPACE_ID::compiler::Version& compiler_version() const; - PROTOBUF_MUST_USE_RESULT PROTOBUF_NAMESPACE_ID::compiler::Version* release_compiler_version(); - PROTOBUF_NAMESPACE_ID::compiler::Version* mutable_compiler_version(); - void set_allocated_compiler_version(PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version); + const ::PROTOBUF_NAMESPACE_ID::compiler::Version& compiler_version() const; + PROTOBUF_MUST_USE_RESULT ::PROTOBUF_NAMESPACE_ID::compiler::Version* release_compiler_version(); + ::PROTOBUF_NAMESPACE_ID::compiler::Version* mutable_compiler_version(); + void set_allocated_compiler_version(::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version); private: - const PROTOBUF_NAMESPACE_ID::compiler::Version& _internal_compiler_version() const; - PROTOBUF_NAMESPACE_ID::compiler::Version* _internal_mutable_compiler_version(); + const ::PROTOBUF_NAMESPACE_ID::compiler::Version& _internal_compiler_version() const; + ::PROTOBUF_NAMESPACE_ID::compiler::Version* _internal_mutable_compiler_version(); public: void unsafe_arena_set_allocated_compiler_version( - PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version); - PROTOBUF_NAMESPACE_ID::compiler::Version* unsafe_arena_release_compiler_version(); + ::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version); + ::PROTOBUF_NAMESPACE_ID::compiler::Version* unsafe_arena_release_compiler_version(); // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest) private: @@ -527,9 +535,9 @@ class PROTOC_EXPORT CodeGeneratorRequest final : ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField file_to_generate_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::FileDescriptorProto > proto_file_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto > proto_file_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr parameter_; - PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version_; + ::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version_; friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; }; // ------------------------------------------------------------------- @@ -553,7 +561,11 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : } inline CodeGeneratorResponse_File& operator=(CodeGeneratorResponse_File&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena()) { + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { InternalSwap(&from); } else { CopyFrom(from); @@ -721,17 +733,17 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : bool _internal_has_generated_code_info() const; public: void clear_generated_code_info(); - const PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& generated_code_info() const; - PROTOBUF_MUST_USE_RESULT PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* release_generated_code_info(); - PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* mutable_generated_code_info(); - void set_allocated_generated_code_info(PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info); + const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& generated_code_info() const; + PROTOBUF_MUST_USE_RESULT ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* release_generated_code_info(); + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* mutable_generated_code_info(); + void set_allocated_generated_code_info(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info); private: - const PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& _internal_generated_code_info() const; - PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* _internal_mutable_generated_code_info(); + const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& _internal_generated_code_info() const; + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* _internal_mutable_generated_code_info(); public: void unsafe_arena_set_allocated_generated_code_info( - PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info); - PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* unsafe_arena_release_generated_code_info(); + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info); + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* unsafe_arena_release_generated_code_info(); // @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File) private: @@ -745,7 +757,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr insertion_point_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr content_; - PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info_; + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info_; friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; }; // ------------------------------------------------------------------- @@ -769,7 +781,11 @@ class PROTOC_EXPORT CodeGeneratorResponse final : } inline CodeGeneratorResponse& operator=(CodeGeneratorResponse&& from) noexcept { if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena()) { + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { InternalSwap(&from); } else { CopyFrom(from); @@ -914,16 +930,16 @@ class PROTOC_EXPORT CodeGeneratorResponse final : int _internal_file_size() const; public: void clear_file(); - PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* mutable_file(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >* + ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* mutable_file(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >* mutable_file(); private: - const PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& _internal_file(int index) const; - PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* _internal_add_file(); + const ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& _internal_file(int index) const; + ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* _internal_add_file(); public: - const PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& file(int index) const; - PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* add_file(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >& + const ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& file(int index) const; + ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* add_file(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >& file() const; // optional string error = 1; @@ -966,7 +982,7 @@ class PROTOC_EXPORT CodeGeneratorResponse final : typedef void DestructorSkippable_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File > file_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File > file_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr error_; ::PROTOBUF_NAMESPACE_ID::uint64 supported_features_; friend struct ::TableStruct_google_2fprotobuf_2fcompiler_2fplugin_2eproto; @@ -1268,31 +1284,31 @@ inline int CodeGeneratorRequest::_internal_proto_file_size() const { inline int CodeGeneratorRequest::proto_file_size() const { return _internal_proto_file_size(); } -inline PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::mutable_proto_file(int index) { +inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::mutable_proto_file(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.proto_file) return proto_file_.Mutable(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::FileDescriptorProto >* +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >* CodeGeneratorRequest::mutable_proto_file() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file) return &proto_file_; } -inline const PROTOBUF_NAMESPACE_ID::FileDescriptorProto& CodeGeneratorRequest::_internal_proto_file(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& CodeGeneratorRequest::_internal_proto_file(int index) const { return proto_file_.Get(index); } -inline const PROTOBUF_NAMESPACE_ID::FileDescriptorProto& CodeGeneratorRequest::proto_file(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto& CodeGeneratorRequest::proto_file(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.proto_file) return _internal_proto_file(index); } -inline PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::_internal_add_proto_file() { +inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::_internal_add_proto_file() { return proto_file_.Add(); } -inline PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::add_proto_file() { - PROTOBUF_NAMESPACE_ID::FileDescriptorProto* _add = _internal_add_proto_file(); +inline ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* CodeGeneratorRequest::add_proto_file() { + ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto* _add = _internal_add_proto_file(); // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorRequest.proto_file) return _add; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::FileDescriptorProto >& +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::FileDescriptorProto >& CodeGeneratorRequest::proto_file() const { // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorRequest.proto_file) return proto_file_; @@ -1311,17 +1327,17 @@ inline void CodeGeneratorRequest::clear_compiler_version() { if (compiler_version_ != nullptr) compiler_version_->Clear(); _has_bits_[0] &= ~0x00000002u; } -inline const PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::_internal_compiler_version() const { - const PROTOBUF_NAMESPACE_ID::compiler::Version* p = compiler_version_; - return p != nullptr ? *p : reinterpret_cast( - PROTOBUF_NAMESPACE_ID::compiler::_Version_default_instance_); +inline const ::PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::_internal_compiler_version() const { + const ::PROTOBUF_NAMESPACE_ID::compiler::Version* p = compiler_version_; + return p != nullptr ? *p : reinterpret_cast( + ::PROTOBUF_NAMESPACE_ID::compiler::_Version_default_instance_); } -inline const PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::compiler_version() const { +inline const ::PROTOBUF_NAMESPACE_ID::compiler::Version& CodeGeneratorRequest::compiler_version() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) return _internal_compiler_version(); } inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version( - PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version) { + ::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version) { if (GetArenaForAllocation() == nullptr) { delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(compiler_version_); } @@ -1333,9 +1349,9 @@ inline void CodeGeneratorRequest::unsafe_arena_set_allocated_compiler_version( } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) } -inline PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::release_compiler_version() { +inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::release_compiler_version() { _has_bits_[0] &= ~0x00000002u; - PROTOBUF_NAMESPACE_ID::compiler::Version* temp = compiler_version_; + ::PROTOBUF_NAMESPACE_ID::compiler::Version* temp = compiler_version_; compiler_version_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); @@ -1348,34 +1364,34 @@ inline PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::release_c #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::unsafe_arena_release_compiler_version() { +inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::unsafe_arena_release_compiler_version() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) _has_bits_[0] &= ~0x00000002u; - PROTOBUF_NAMESPACE_ID::compiler::Version* temp = compiler_version_; + ::PROTOBUF_NAMESPACE_ID::compiler::Version* temp = compiler_version_; compiler_version_ = nullptr; return temp; } -inline PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::_internal_mutable_compiler_version() { +inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::_internal_mutable_compiler_version() { _has_bits_[0] |= 0x00000002u; if (compiler_version_ == nullptr) { - auto* p = CreateMaybeMessage(GetArenaForAllocation()); + auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::compiler::Version>(GetArenaForAllocation()); compiler_version_ = p; } return compiler_version_; } -inline PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::mutable_compiler_version() { - PROTOBUF_NAMESPACE_ID::compiler::Version* _msg = _internal_mutable_compiler_version(); +inline ::PROTOBUF_NAMESPACE_ID::compiler::Version* CodeGeneratorRequest::mutable_compiler_version() { + ::PROTOBUF_NAMESPACE_ID::compiler::Version* _msg = _internal_mutable_compiler_version(); // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) return _msg; } -inline void CodeGeneratorRequest::set_allocated_compiler_version(PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version) { +inline void CodeGeneratorRequest::set_allocated_compiler_version(::PROTOBUF_NAMESPACE_ID::compiler::Version* compiler_version) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { delete compiler_version_; } if (compiler_version) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper::GetOwningArena(compiler_version); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper<::PROTOBUF_NAMESPACE_ID::compiler::Version>::GetOwningArena(compiler_version); if (message_arena != submessage_arena) { compiler_version = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, compiler_version, submessage_arena); @@ -1575,17 +1591,17 @@ inline bool CodeGeneratorResponse_File::_internal_has_generated_code_info() cons inline bool CodeGeneratorResponse_File::has_generated_code_info() const { return _internal_has_generated_code_info(); } -inline const PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_File::_internal_generated_code_info() const { - const PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* p = generated_code_info_; - return p != nullptr ? *p : reinterpret_cast( - PROTOBUF_NAMESPACE_ID::_GeneratedCodeInfo_default_instance_); +inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_File::_internal_generated_code_info() const { + const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* p = generated_code_info_; + return p != nullptr ? *p : reinterpret_cast( + ::PROTOBUF_NAMESPACE_ID::_GeneratedCodeInfo_default_instance_); } -inline const PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_File::generated_code_info() const { +inline const ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo& CodeGeneratorResponse_File::generated_code_info() const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) return _internal_generated_code_info(); } inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_generated_code_info( - PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info) { + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info) { if (GetArenaForAllocation() == nullptr) { delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(generated_code_info_); } @@ -1597,9 +1613,9 @@ inline void CodeGeneratorResponse_File::unsafe_arena_set_allocated_generated_cod } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) } -inline PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::release_generated_code_info() { +inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::release_generated_code_info() { _has_bits_[0] &= ~0x00000008u; - PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = generated_code_info_; + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = generated_code_info_; generated_code_info_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); @@ -1612,27 +1628,27 @@ inline PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::rel #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::unsafe_arena_release_generated_code_info() { +inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::unsafe_arena_release_generated_code_info() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) _has_bits_[0] &= ~0x00000008u; - PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = generated_code_info_; + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* temp = generated_code_info_; generated_code_info_ = nullptr; return temp; } -inline PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::_internal_mutable_generated_code_info() { +inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::_internal_mutable_generated_code_info() { _has_bits_[0] |= 0x00000008u; if (generated_code_info_ == nullptr) { - auto* p = CreateMaybeMessage(GetArenaForAllocation()); + auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo>(GetArenaForAllocation()); generated_code_info_ = p; } return generated_code_info_; } -inline PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::mutable_generated_code_info() { - PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* _msg = _internal_mutable_generated_code_info(); +inline ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* CodeGeneratorResponse_File::mutable_generated_code_info() { + ::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* _msg = _internal_mutable_generated_code_info(); // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info) return _msg; } -inline void CodeGeneratorResponse_File::set_allocated_generated_code_info(PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info) { +inline void CodeGeneratorResponse_File::set_allocated_generated_code_info(::PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo* generated_code_info) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(generated_code_info_); @@ -1754,31 +1770,31 @@ inline int CodeGeneratorResponse::file_size() const { inline void CodeGeneratorResponse::clear_file() { file_.Clear(); } -inline PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::mutable_file(int index) { +inline ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::mutable_file(int index) { // @@protoc_insertion_point(field_mutable:google.protobuf.compiler.CodeGeneratorResponse.file) return file_.Mutable(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >* +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >* CodeGeneratorResponse::mutable_file() { // @@protoc_insertion_point(field_mutable_list:google.protobuf.compiler.CodeGeneratorResponse.file) return &file_; } -inline const PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::_internal_file(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::_internal_file(int index) const { return file_.Get(index); } -inline const PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::file(int index) const { +inline const ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File& CodeGeneratorResponse::file(int index) const { // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorResponse.file) return _internal_file(index); } -inline PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::_internal_add_file() { +inline ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::_internal_add_file() { return file_.Add(); } -inline PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::add_file() { - PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* _add = _internal_add_file(); +inline ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* CodeGeneratorResponse::add_file() { + ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File* _add = _internal_add_file(); // @@protoc_insertion_point(field_add:google.protobuf.compiler.CodeGeneratorResponse.file) return _add; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >& +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_File >& CodeGeneratorResponse::file() const { // @@protoc_insertion_point(field_list:google.protobuf.compiler.CodeGeneratorResponse.file) return file_; @@ -1801,10 +1817,10 @@ PROTOBUF_NAMESPACE_CLOSE PROTOBUF_NAMESPACE_OPEN -template <> struct is_proto_enum< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_Feature> : ::std::true_type {}; +template <> struct is_proto_enum< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_Feature> : ::std::true_type {}; template <> -inline const EnumDescriptor* GetEnumDescriptor< PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_Feature>() { - return PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_Feature_descriptor(); +inline const EnumDescriptor* GetEnumDescriptor< ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_Feature>() { + return ::PROTOBUF_NAMESPACE_ID::compiler::CodeGeneratorResponse_Feature_descriptor(); } PROTOBUF_NAMESPACE_CLOSE diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 5bc8537b68..b6c31fd2ae 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -686,7 +686,7 @@ class TableArena { T(std::forward(args)...); } - TableArena(): small_size_blocks_() {} + TableArena() {} TableArena(const TableArena&) = delete; TableArena& operator=(const TableArena&) = delete; @@ -1010,7 +1010,7 @@ class TableArena { } Block* current_ = nullptr; - std::array small_size_blocks_; + std::array small_size_blocks_ = {{}}; Block* full_blocks_ = nullptr; size_t num_allocations_ = 0; @@ -2465,7 +2465,7 @@ bool DescriptorPool::TryFindExtensionInFallbackDatabase( // =================================================================== bool FieldDescriptor::is_map_message_type() const { - return message_type_->options().map_entry(); + return type_descriptor_.message_type->options().map_entry(); } std::string FieldDescriptor::DefaultValueAsString( @@ -5249,6 +5249,7 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, result->file_ = file_; result->number_ = proto.number(); result->is_extension_ = is_extension; + result->is_oneof_ = false; result->proto3_optional_ = proto.proto3_optional(); if (proto.proto3_optional() && @@ -5284,9 +5285,6 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, // Some of these may be filled in when cross-linking. result->containing_type_ = nullptr; - result->extension_scope_ = nullptr; - result->message_type_ = nullptr; - result->enum_type_ = nullptr; result->type_once_ = nullptr; result->default_value_enum_ = nullptr; @@ -5461,16 +5459,13 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, "FieldDescriptorProto.extendee not set for extension field."); } - result->extension_scope_ = parent; + result->scope_.extension_scope = parent; if (proto.has_oneof_index()) { AddError(result->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, "FieldDescriptorProto.oneof_index should not be set for " "extensions."); } - - // Fill in later (maybe). - result->containing_oneof_ = nullptr; } else { if (proto.has_extendee()) { AddError(result->full_name(), proto, @@ -5488,12 +5483,11 @@ void DescriptorBuilder::BuildFieldOrExtension(const FieldDescriptorProto& proto, strings::Substitute("FieldDescriptorProto.oneof_index $0 is " "out of range for type \"$1\".", proto.oneof_index(), parent->name())); - result->containing_oneof_ = nullptr; } else { - result->containing_oneof_ = parent->oneof_decl(proto.oneof_index()); + result->is_oneof_ = true; + result->scope_.containing_oneof = + parent->oneof_decl(proto.oneof_index()); } - } else { - result->containing_oneof_ = nullptr; } } @@ -6159,8 +6153,8 @@ void DescriptorBuilder::CrossLinkField(FieldDescriptor* field, } if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - field->message_type_ = type.descriptor(); - if (field->message_type_ == nullptr) { + field->type_descriptor_.message_type = type.descriptor(); + if (field->type_descriptor_.message_type == nullptr) { AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, "\"" + proto.type_name() + "\" is not a message type."); @@ -6173,8 +6167,8 @@ void DescriptorBuilder::CrossLinkField(FieldDescriptor* field, "Messages can't have default values."); } } else if (field->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) { - field->enum_type_ = type.enum_descriptor(); - if (field->enum_type_ == nullptr) { + field->type_descriptor_.enum_type = type.enum_descriptor(); + if (field->type_descriptor_.enum_type == nullptr) { AddError(field->full_name(), proto, DescriptorPool::ErrorCollector::TYPE, "\"" + proto.type_name() + "\" is not an enum type."); @@ -7772,22 +7766,23 @@ Symbol DescriptorPool::CrossLinkOnDemandHelper(StringPiece name, // enum_type_, message_type_, and default_value_enum_ appropriately. void FieldDescriptor::InternalTypeOnceInit() const { GOOGLE_CHECK(file()->finished_building_ == true); + const EnumDescriptor* enum_type = nullptr; if (type_once_->field.type_name) { Symbol result = file()->pool()->CrossLinkOnDemandHelper( *type_once_->field.type_name, type_ == FieldDescriptor::TYPE_ENUM); if (result.type() == Symbol::MESSAGE) { type_ = FieldDescriptor::TYPE_MESSAGE; - message_type_ = result.descriptor(); + type_descriptor_.message_type = result.descriptor(); } else if (result.type() == Symbol::ENUM) { type_ = FieldDescriptor::TYPE_ENUM; - enum_type_ = result.enum_descriptor(); + enum_type = type_descriptor_.enum_type = result.enum_descriptor(); } } - if (enum_type_ && !default_value_enum_) { + if (enum_type && !default_value_enum_) { if (type_once_->field.default_value_enum_name) { // Have to build the full name now instead of at CrossLink time, - // because enum_type_ may not be known at the time. - std::string name = enum_type_->full_name(); + // because enum_type may not be known at the time. + std::string name = enum_type->full_name(); // Enum values reside in the same scope as the enum type. std::string::size_type last_dot = name.find_last_of('.'); if (last_dot != std::string::npos) { @@ -7802,8 +7797,8 @@ void FieldDescriptor::InternalTypeOnceInit() const { if (!default_value_enum_) { // We use the first defined value as the default // if a default is not explicitly defined. - GOOGLE_CHECK(enum_type_->value_count()); - default_value_enum_ = enum_type_->value(0); + GOOGLE_CHECK(enum_type->value_count()); + default_value_enum_ = enum_type->value(0); } } } @@ -7819,14 +7814,16 @@ const Descriptor* FieldDescriptor::message_type() const { if (type_once_) { internal::call_once(type_once_->once, FieldDescriptor::TypeOnceInit, this); } - return message_type_; + return type_ == TYPE_MESSAGE || type_ == TYPE_GROUP + ? type_descriptor_.message_type + : nullptr; } const EnumDescriptor* FieldDescriptor::enum_type() const { if (type_once_) { internal::call_once(type_once_->once, FieldDescriptor::TypeOnceInit, this); } - return enum_type_; + return type_ == TYPE_ENUM ? type_descriptor_.enum_type : nullptr; } const EnumValueDescriptor* FieldDescriptor::default_value_enum() const { diff --git a/src/google/protobuf/descriptor.h b/src/google/protobuf/descriptor.h index d2bf86e918..67c3f69214 100644 --- a/src/google/protobuf/descriptor.h +++ b/src/google/protobuf/descriptor.h @@ -62,6 +62,7 @@ #include #include +#include #include #include #include @@ -916,6 +917,8 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { // Actually a `Label` but stored as uint8_t to save space. uint8_t label_; + bool is_oneof_ : 1; + // Logically: // all_names_ = [name, full_name, lower, camel, json] // However: @@ -935,10 +938,14 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { int number_; int index_in_oneof_; const Descriptor* containing_type_; - const OneofDescriptor* containing_oneof_; - const Descriptor* extension_scope_; - mutable const Descriptor* message_type_; - mutable const EnumDescriptor* enum_type_; + union { + const OneofDescriptor* containing_oneof; + const Descriptor* extension_scope; + } scope_; + union { + mutable const Descriptor* message_type; + mutable const EnumDescriptor* enum_type; + } type_descriptor_; const FieldOptions* options_; // IMPORTANT: If you add a new field, make sure to search for all instances // of Allocate() and AllocateArray() in @@ -2089,10 +2096,7 @@ PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, file, const FileDescriptor*) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, number, int) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, is_extension, bool) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, containing_type, const Descriptor*) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, containing_oneof, - const OneofDescriptor*) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, index_in_oneof, int) -PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, extension_scope, const Descriptor*) PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FieldDescriptor, FieldOptions) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_default_value, bool) PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, has_json_name, bool) @@ -2225,6 +2229,15 @@ inline const std::string& FieldDescriptor::json_name() const { return all_names_[json_name_index_]; } +inline const OneofDescriptor* FieldDescriptor::containing_oneof() const { + return is_oneof_ ? scope_.containing_oneof : nullptr; +} + +inline const Descriptor* FieldDescriptor::extension_scope() const { + GOOGLE_CHECK(is_extension_); + return scope_.extension_scope; +} + inline FieldDescriptor::Label FieldDescriptor::label() const { return static_cast